Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With minimal changes to preserve the status quo. These are forward ports of compiler, library and build changes from the following upstream commits:
WellKnownNames
.NewLambda
to synthesize instances of SAM types.AnonFunctionN
references to useNewLambda
.From the
NewLambda
commit, we only adapt the way we compile Scala function lambdas. We do not useNewLambda
for arbitrary SAM types yet. This is left for a future, independent commit, as it is not required for correctness.These are the minimal changes that have to go in 3.7.0 if we want to add support for
async/await
and JSPI in the 3.7.x line.I tried going further and actually port that as well. However I need to forward-port scala-js/scala-js@0d16b42 first. And that proves difficult because Scala 3 does not have a reliable
isDelambdafyTarget
test. Too much of Closures gets transformed away before the JS backend. I will need more time to figure this out (I'll try again tomorrow). But AFAICT we could do that in patch releases, unlike the initial upgrade to 1.19.0 that this PR does./cc @WojciechMazur for consideration to be included as a last-minute change to 3.7.0. The idea is that we would like to get the JSPI improvements of Scala.js 1.19.0 rather sooner than later. It's a game changer for "direct style" libraries such as Ox and Gears.