[code-reflection] RFR: Fix lambda bugs [v5]

Paul Sandoz psandoz at openjdk.org
Tue Aug 26 18:27:58 UTC 2025


On Tue, 26 Aug 2025 10:50:13 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> Fix lambda bugs:
>> 1. Unnecessary load of static fields accessed inside the lambda body (bug 1).
>> 2. The model of a lambda expression that returns void, contains additional boxing whose result is not used (bug 2).
>> 3. Inner lambda is incorrectly quoted (bug 3).
>
> Mourad Abbay has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix bug 3

test/langtools/tools/javac/reflect/QuotableSubtypeTest.java line 328:

> 326:             };
> 327:             """)
> 328:     // @@@ should this be the excepted behaviour in case we have a nested quotable lambda ?

Yes, the program behavior is to produce an instance of a functional interface whose implementation is bound to the lambda's body. Because the lambda is also targeted to a `Quotable` interface, there is additional program behaviour that gives access to the code model of the lambda via a corresponding Quoted instance.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/532#discussion_r2301788256


More information about the babylon-dev mailing list