RFR: 8204610: Compiler confused by parenthesized "this" in final fields assignments
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Jun 8 13:55:47 UTC 2018
Hi,
this patch fixes the problem we have been talking about yesterday [1].
Basically, javac does not consistently skip parenthesis when enforcing
foward refs and DA/DU rules.
I decided to consolidate the 'is this a variable name, possibly
qualified by "this" ', into a separate TreeInfo routine, and call that
from Flow and Attr (it turned out that the wrong logic was applied in
both places).
I have included a combo test which tests several combinations of the kind
((this).(x)) = 1
This might include (as in the example above, as the selected variable
symbol can't be wrapped in its own parenthesis) nonsensical combination,
which the test makes sure they are rejected.
Webrev:
http://cr.openjdk.java.net/~mcimadamore/8204610/
Cheers
Maurizio
[1] -
http://mail.openjdk.java.net/pipermail/compiler-dev/2018-June/012005.html
More information about the compiler-dev
mailing list