Skip to content

Tweak unapply check to fail if type param follows explicit term param #23502

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

Closed
wants to merge 2 commits into from

Conversation

som-snytt
Copy link
Contributor

Fixes #23499

Allow the test case, which has no explicit parameter.

With booleans, one has a 50/50 chance of correctness. I'll review this again after a nap.

@som-snytt som-snytt marked this pull request as ready for review July 10, 2025 15:53
@som-snytt som-snytt marked this pull request as draft July 10, 2025 19:28
@som-snytt
Copy link
Contributor Author

som-snytt commented Jul 10, 2025

It must be pretty special if I have to look at tests.

Edit: extensions may have 2 explicit params.

@som-snytt som-snytt force-pushed the issue/23499-unapplyish branch from f9983af to 17324cc Compare July 11, 2025 02:23
@som-snytt som-snytt marked this pull request as ready for review July 11, 2025 21:43
@Gedochao Gedochao added the stat:needs decision Some aspects of this issue need a decision from the maintainance team. label Jul 14, 2025
@Gedochao Gedochao requested a review from odersky July 14, 2025 09:20
@Gedochao
Copy link
Contributor

We'll discuss this on this week's Scala Core.

@odersky
Copy link
Contributor

odersky commented Jul 15, 2025

I still think this is an abuse of the language, and the pattern should not longer be supported.

@Gedochao
Copy link
Contributor

After discussing it on today's Scala Core, we decided against this fix.
We'll treat the current behaviour as expected.
@som-snytt Thanks for the contribution regardless, shame we can't use it!
Closing this.

@Gedochao Gedochao closed this Jul 16, 2025
@Gedochao Gedochao removed the stat:needs decision Some aspects of this issue need a decision from the maintainance team. label Jul 16, 2025
@som-snytt som-snytt deleted the issue/23499-unapplyish branch July 17, 2025 12:32
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.

def unapply(implicit ev: T) no longer works in pattern matching
3 participants