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 "Three fixes to SAM type handling" to LTS #22132

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

WojciechMazur
Copy link
Contributor

Backports #21596 to the 3.3.5.

PR submitted by the release tooling.
[skip ci]

@WojciechMazur WojciechMazur force-pushed the backport-lts-3.3-21590 branch from a8f2409 to 3c05414 Compare December 3, 2024 21:59
odersky and others added 3 commits December 3, 2024 23:00
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 #15855

[Cherry-picked f0b6763]
Fix SAM test to use the same scheme as SAM expansion to determine whether
a type needs zero arguments for construction.

[Cherry-picked 8aa59f8][modified]
[Cherry-picked 3af67ba][modified]
@WojciechMazur WojciechMazur force-pushed the backport-lts-3.3-21596 branch from 2f3444c to 81ff618 Compare December 3, 2024 22:00
Base automatically changed from backport-lts-3.3-21590 to lts-3.3 December 4, 2024 17:22
@WojciechMazur
Copy link
Contributor Author

No regressions detected in the community build up to backport-lts-3.3-21857.

Reference

@WojciechMazur WojciechMazur merged commit 0c5915c into lts-3.3 Dec 4, 2024
19 checks passed
@WojciechMazur WojciechMazur deleted the backport-lts-3.3-21596 branch December 4, 2024 17:22
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