JEP 492: javac error on a valid code

Archie Cobbs archie.cobbs at gmail.com
Mon Feb 10 14:58:08 UTC 2025


Hi Ekaterina,

On Mon, Feb 10, 2025 at 8:30 AM Ekaterina Semenova <
ekaterina.semenova at jetbrains.com> wrote:

> I would expect though the code to be compilable because in this case i
> should refer to the containing class private field, not to the superclass
> field (because it is private thus inaccessible to the subclass), so it
> should be allowed to reference it in the constructor prologue.
> Could you please take a look?
>

Thanks - it looks like the "before supertype constructor has been called"
check is flawed and being too aggressive here. I'll take a look.

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250210/7a6beb32/attachment.htm>


More information about the amber-dev mailing list