[code-reflection] RFR: Drop support for quoted structural lambdas [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Nov 6 22:17:09 UTC 2025
> The Babylon compiler extension supports structural quoting of lambdas. That is, if a lambda expression has `Quoted` target, then it must have explicit parameter types, and must be type-checked bottom up:
>
>
> Quoted q = () -> {}
>
>
> Historically, `Quoted` was the first way to model quotable lambda expressions, and the language changes to support structural quotable lambdas were fairly invasive. Since then we moved to a more minimalistic approach which is similar to what we do for serializable lambdas: we use an intersection type cast to force quotability of the lambda expression:
>
>
> Runnable r = (Runnable & Quotable)() -> {}
>
>
> Since the surface area of the `Quotable` support is much smaller (it shares the same machinery already available for serializable lambdas), it would be better to remove support for Quoted target when moving towards incubation.
>
> This PR fixes all existing tests in langtools/JDK to use `Quotable` instead of `Quoted`. I did **not** check HAT, or `cr-examples`.
Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
Drop QuotesTest
-------------
Changes:
- all: https://git.openjdk.org/babylon/pull/667/files
- new: https://git.openjdk.org/babylon/pull/667/files/bd6ddc10..80d86cc6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=babylon&pr=667&range=02
- incr: https://webrevs.openjdk.org/?repo=babylon&pr=667&range=01-02
Stats: 69 lines in 1 file changed: 0 ins; 69 del; 0 mod
Patch: https://git.openjdk.org/babylon/pull/667.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/667/head:pull/667
PR: https://git.openjdk.org/babylon/pull/667
More information about the babylon-dev
mailing list