LocalsOrMyInstanceFieldsControlFlowPolicy: disallow qualified this

According to JLS Chapter 16 qualified "this" is not considered as reference to field in definite assignment analysis
Fixes IDEA-193386 Good code is red: Variable may not have been initialized
This commit is contained in:
Tagir Valeev
2018-06-07 11:28:07 +07:00
parent a13bec1e73
commit 698afa3b24
3 changed files with 17 additions and 2 deletions
@@ -249,6 +249,6 @@ class QualifiedThis {
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;
this.x = 5;
}
}