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

Three fixes to SAM type handling #21596

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Three fixes to SAM type handling #21596

merged 3 commits into from
Sep 18, 2024

Commits on Sep 15, 2024

  1. Three fixes for SAM type handling

    The first two fixes concern characterization of SAM types. One condition of a SAM
    type is that it can be instantiated with an empty argument list. This was implemented
    incorrectly. First, we missed the case where the SAM type is a trait with a parent
    class that takes arguments. In this case the SAM type _cannot_ be instantiated with an
    empty argument list. Second, we missed the case where the SAM type constructor has a
    single vararg parameter. In this case the SAM type _can_ be instantiated with an empty
    argument list.
    
    The second case was also translated incorrectly which led to illegal bytecodes.
    
    Fixes scala#15855
    odersky committed Sep 15, 2024
    Configuration menu
    Copy the full SHA
    f0b6763 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Align SAM test and expansion

    Fix SAM test to use the same scheme as SAM expansion to determine whether
    a type needs zero arguments for construction.
    odersky committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    8aa59f8 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. Address review comments

    odersky committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    3af67ba View commit details
    Browse the repository at this point in the history