LocalsOrMyInstanceFieldsControlFlowPolicy: allow parentheses

See also IDEA-156926, JDK-8156180
This commit is contained in:
Tagir Valeev
2018-06-07 17:55:13 +07:00
parent 67d2b6ca2b
commit 51af524343
2 changed files with 5 additions and 4 deletions
@@ -255,10 +255,10 @@ class QualifiedThis {
class ParenthesizedThis {
final int x;
final int y = (this).x + 1; // allowed as qualifier is not naked 'this'!
final int y = <error descr="Variable '(this).x' might not have been initialized">(this).x</error> + 1; // javac allows this?
ParenthesizedThis() {
<error descr="Cannot assign a value to final variable 'x'">(this).x</error> = 5;
this.x = 6;
(this).x = 5;
<error descr="Variable 'x' might already have been assigned to">this.x</error> = 6;
}
}