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

Make more anonymous functions static #19251

Merged
merged 3 commits into from
Dec 14, 2023
Merged

Commits on Dec 13, 2023

  1. Make more anonymous functions static

    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 scala#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 scala#19224
    odersky committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    22a959a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b8e6c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7878dbc View commit details
    Browse the repository at this point in the history