Error is reported when qualified this is used to initialize a final variable

Fixes IDEA-191686 Bad code is green (cannot assign a value to final variable)
This commit is contained in:
Tagir Valeev
2018-05-10 13:03:40 +07:00
parent bc106a2ff8
commit 0418d57ade
2 changed files with 11 additions and 1 deletions
@@ -243,3 +243,12 @@ class AssignmentInUnreachablePolyadic {
else if (true && (<error descr="Variable 'bbbb' might already have been assigned to">bbbb</error> = false)) ;
}
}
class QualifiedThis {
final int x;
QualifiedThis() {
<error descr="Cannot assign a value to final variable 'x'">QualifiedThis.this.x</error> = 5;
<error descr="Variable 'x' might already have been assigned to">this.x</error> = 5;
}
}