Loosening requirements for super() invocation

Archie Cobbs archie.cobbs at gmail.com
Thu Jan 26 18:52:14 UTC 2023


On Thu, Jan 26, 2023 at 12:07 PM Archie Cobbs <archie.cobbs at gmail.com>
wrote:

>
> Add the following restrictions on constructors:
>>     No access to this, other than assignments to fields, may occur unless
>> this is DA
>>
>>
> Thanks for pointing that out. I've updated the draft to say "other than
> assignments to local fields".
>

I just realized that this wording change nicely avoids the "weirdness"
problem of writing to non-final superclass fields before super(). That
seems like a good thing based on the earlier discussion.

Another instance where the JVMS would allow something, but that doesn't
necessarily mean it's a good idea in the language.

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230126/8e2d56ab/attachment-0001.htm>


More information about the amber-dev mailing list