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

Curried methods are not valid SAM methods #18110

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 30, 2023

This reverts most of #17740 and instead add a check on currying in SAMType. We could consider allowing curried methods in SAM types, but this would be a language change that requires a SIP, and the implementation would need an adaptation step in erasure since the invokedynamic method needs to have a compatible signature with the abstract method in the trait.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. But you need add an // error to that moved test.

This reverts most of scala#17740 and instead add a check on currying in SAMType. We
could consider allowing curried methods in SAM types, but this would be a
language change that requires a SIP, and the implementation would need an
adaptation step in erasure since the invokedynamic method needs to have a
compatible signature with the abstract method in the trait.
@smarter smarter merged commit 13f877b into scala:main Jul 5, 2023
@smarter smarter deleted the illegal-sams branch July 5, 2023 20:56
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
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.

3 participants