LocalsOrMyInstanceFieldsControlFlowPolicy#isLocalOrMyInstanceReference extracted

Fixes parentheses handling like (this).x. Review ID: IDEA-CR-33345
This commit is contained in:
Tagir Valeev
2018-06-07 16:11:00 +07:00
parent 3cce8e2682
commit d90e0b79e5
3 changed files with 29 additions and 14 deletions
@@ -251,4 +251,14 @@ class QualifiedThis {
<error descr="Cannot assign a value to final variable 'x'">QualifiedThis.this.x</error> = 5;
this.x = 5;
}
}
class ParenthesizedThis {
final int x;
final int y = (this).x + 1; // allowed as qualifier is not naked 'this'!
ParenthesizedThis() {
<error descr="Cannot assign a value to final variable 'x'">(this).x</error> = 5;
this.x = 6;
}
}