[code-reflection] RFR: Add isQuotable attribute to LambdaOp
Mourad Abbay
mabbay at openjdk.org
Wed Sep 3 20:27:59 UTC 2025
On Wed, 3 Sep 2025 20:17:28 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> In the `interpreter` and `ByteCodeGenerator` we detect if a lambda is quotable based on its functional interface. This approach will not work if intersection type is used e.g. `Runnable r = (Runnable & Quotable) () -> {};` This PR adds a flag to LambdaOp that will be set by the `javac` for quotable lambdas.
>
> src/jdk.incubator.code/share/classes/jdk/incubator/code/dialect/java/JavaOp.java line 191:
>
>> 189: boolean isQuotable = def.extractAttributeValue(ATTRIBUTE_LAMBDA_IS_QUOTABLE,
>> 190: false, v -> switch (v) {
>> 191: case Boolean b -> b;
>
> Can we use the `boolean` primitive type?
It's a preview feature
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/545#discussion_r2320101806
More information about the babylon-dev
mailing list