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

Tagir Valeev amaembo at gmail.com
Tue Jun 12 01:00:46 UTC 2018


вт, 12 июня 2018 г., 2:57 Liam Miller-Cushon <cushon at google.com>:

> Where does qualified 'this' fit in here (e.g. `TypeName.this.x = 1`)?
> Should it be handled similarly?
>

I think that the programmer can always cheat. E. g. how about
(true?this:this).x? Or ((TypeName)this).x. So there's no point to
overcomplicate the compiler further to handle more cases as something will
still be unsupported. After all one can always declare instance method like
TypeName getThis() { return this;} and use getThis().x.

With best regards,
Tagir Valeev


> Related: JDK-8193904
>
> On Mon, Jun 11, 2018 at 12:43 PM Alex Buckley <alex.buckley at oracle.com>
> wrote:
>
>> A finger-in-the-air guess the impact of this source-incompatible change:
>> 1/4 the impact of banning `_` as a variable name.
>>
>
> I'd be happy to help measure the impact of that change once there's a
> prototype.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180612/5e08dabc/attachment.html>


More information about the compiler-dev mailing list