Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport "Make more anonymous functions static" to LTS #20799

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Conversation

WojciechMazur
Copy link
Contributor

Backports #19251 to the LTS branch.

PR submitted by the release tooling.
[skip ci]

odersky added 3 commits June 25, 2024 13:45
An anonymous function in a static object was previously mapped to a member
of that object. We now map it to a static member of the toplevel class instead.
This causes the backend to memoize the function, which fixes #19224. On the
other hand, we don't do that for anonymous functions nested in the object
constructor, since that can cause deadlocks (see run/deadlock.scala).

Scala 2's behavior is different: it does lift lambdas in constructors
to be static, too, which can cause deadlocks.

Fixes #19224

[Cherry-picked 22a959a]
Base automatically changed from lts-19250 to lts-3.3 June 26, 2024 09:24
@WojciechMazur
Copy link
Contributor Author

No regressions detected in the community build up to lts-19356.

Reference

@WojciechMazur WojciechMazur merged commit 453df6b into lts-3.3 Jun 26, 2024
19 checks passed
@WojciechMazur WojciechMazur deleted the lts-19251 branch June 26, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants