RFR: 8204610: Compiler confused by parenthesized "this" in final fields assignments

Alex Buckley alex.buckley at oracle.com
Sat Jun 9 00:17:14 UTC 2018


On 6/8/2018 6:55 AM, Maurizio Cimadamore wrote:
> Basically, javac does not consistently skip parenthesis when enforcing
> foward refs and DA/DU rules.

I want to check that javac skips parentheses for `x` and `this.x` in 
DA/DU rules, but only for `x` in a forward field reference. At this 
time, JLS 8.3.3 detects a forward field reference only if made with a 
simple name; it's a bit late to expand that for JLS11, so I'm a bit 
alarmed by this unified treatment of variable access:

> 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).

Alex


More information about the compiler-dev mailing list