Integrated: 8334252: Verifier error for lambda declared in early construction context
Archie Cobbs
acobbs at openjdk.org
Fri Jun 14 14:56:27 UTC 2024
On Thu, 13 Jun 2024 17:38:11 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> When a lambda is declared in an early construction context, any reference to an outer instance must be acquired through the synthetic constructor rather than the synthetic outer instance field, because 'this' is not available yet.
>
> The code in `LambdaToMethod.java` has logic for this using the `typesUnderConstruction` field, but that logic assumes that the only early construction context that can exist is within a `super()` or `this()` parameter list. While this was true previously, with the "flexible constructors" JEP 482, this is no longer the case.
>
> So the fix is to update the logic for managing `typesUnderConstruction` to also include any statements prior to `super()` or `this()`.
This pull request has now been integrated.
Changeset: dae0bda9
Author: Archie Cobbs <acobbs at openjdk.org>
Committer: Vicente Romero <vromero at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/dae0bda9d0096c25d6378561ab2d09df05f381cf
Stats: 63 lines in 2 files changed: 50 ins; 6 del; 7 mod
8334252: Verifier error for lambda declared in early construction context
Reviewed-by: mcimadamore
-------------
PR: https://git.openjdk.org/jdk/pull/19707
More information about the compiler-dev
mailing list