More tests for this handling in javac

This commit is contained in:
Tagir Valeev
2018-06-08 13:27:58 +07:00
parent 8e19b6c7fa
commit 62792959f0
2 changed files with 6 additions and 2 deletions
@@ -255,10 +255,10 @@ class QualifiedThis {
class ParenthesizedThis {
final int x;
final int y = <error descr="Variable '(this).x' might not have been initialized">(this).x</error> + 1; // javac allows this?
final int y = <error descr="Variable '(this).x' might not have been initialized">(this).x</error> + 1;
ParenthesizedThis() {
(this).x = 5;
(this).x = 5; // javac disallows this -- probably a bug in javac
<error descr="Variable 'x' might already have been assigned to">this.x</error> = 6;
}
}