RFR: 8194743: Compiler implementation for Statements before super() [v14]
Archie Cobbs
acobbs at openjdk.org
Mon Sep 25 13:58:17 UTC 2023
On Mon, 25 Sep 2023 13:47:48 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> In the new specification, constructor prologues are no longer considered a static context. Instead they're a pre-construction context (new concept). So emitting an error that says something "cannot be referenced from a static context" would be wrong. The new exception class `RefBeforeCtorCalledError` is intended to be the pre-construction context analogue of `StaticError`.
>
> I'm aware of that - but I note that the implementation uses a STATIC_ERR under the hood. Hence my comment on using a custom static error with a custom diagnostic.
Oh I see. Hmm, I'll admit ignorance on how exactly these `Kind` enum error values like `STATICERR`, `HIDDEN`, etc. are used. Is there a better `Kind` choice for this error? Or does this warrant a new `Kind` value? In the latter case, there is a scary warning about ordering of the enum values so any advice appreciated. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13656#discussion_r1335927718
More information about the compiler-dev
mailing list