RFR: 8334252: Verifier error for lambda declared in early construction context
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Jun 13 21:28:16 UTC 2024
On Thu, 13 Jun 2024 21:07:59 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> Technically, not all constructors invoke `super()` or `this()`, albeit so far, `java.lang.Object` is the only exception.
>
> Of course, it's unlikely that any day soon there will be other examples of this, or that the `java.lang.Object()` constructor will contain a lambda, but if either of those two things ever does happen then this code will still be correct :)
Uhm ok. I asked because scanning for a constructor is a bit heavy. And, now that you bring up Object, perhaps one might argue that the entire constructor body in Object represents a pre-construction context. All things considered, given the remote nature of the scenario you propose (Object is so special that it doesn't really count, and we can even check specifically for it, if needed), combined with the computationally-heavy nature of the method you call, I have a mild preference for just checking if it's a constructor.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19707#discussion_r1638967826
More information about the compiler-dev
mailing list