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

Refine Matchtype checking #15423

Merged
merged 4 commits into from
Jun 19, 2022
Merged

Refine Matchtype checking #15423

merged 4 commits into from
Jun 19, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 12, 2022

Take up #13780 again, but refine it so that abstract types are allowed in match type
reduction as long as they uniquely instantiate type parameters of the type pattern.

Fixes #11982
Fixes #15352

Take up scala#13780 again, but refine it so that abstract types are allowed in match type
reduction as long as they uniquely instantiate type parameters of the type pattern.

Fixes scala#11982
Allow uninstantiated match parameters if the result of the match does
not depend on them.
@odersky
Copy link
Contributor Author

odersky commented Jun 15, 2022

@dwijnand @OlivierBlanvillain can one of you give this a quick review today? It would be good to get this into 3.2.

@odersky
Copy link
Contributor Author

odersky commented Jun 15, 2022

Going to merge this now, so that it makes it into 3.2. The alternative would be to keep the unsound previous behavior.

@dwijnand
Copy link
Member

I was thinking of chatting about it tomorrow afternoon, thinking that was soon enough? Maybe I'm misremembering the 3.2 cutoff date.

@smarter
Copy link
Member

smarter commented Jun 15, 2022

3.2.0-RC1 has already been tagged: https://github.com/lampepfl/dotty/releases/tag/3.2.0-RC1, so this will have to go in 3.2.1 and/or be backported to RC2.

@odersky
Copy link
Contributor Author

odersky commented Jun 15, 2022

That's a pity. I would have hoped to get this in, to address the unsoundness.

@odersky odersky merged commit 4cb967f into scala:main Jun 19, 2022
@odersky odersky deleted the fix-11982 branch June 19, 2022 21:26
@odersky odersky added this to the 3.2.0 backports milestone Jun 20, 2022
@Kordyjan Kordyjan added the backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" label Jun 22, 2022
odersky added a commit that referenced this pull request Jun 22, 2022
@prova
Copy link

prova commented Jul 11, 2022

Trying to compile https://github.com/lampepfl/dotty/pull/15423/files#diff-4258b2458e1b344a3f6431e949a5c7180a433428ec8c12bd387c68d4c43db534 with 3.2.0-RC2 that includes the backported fix, and this fails. Is this expected? Thanks!

@odersky
Copy link
Contributor Author

odersky commented Jul 11, 2022

It's a neg test, right? So yes this would be expected.

@prova
Copy link

prova commented Jul 11, 2022

Thanks

@smarter smarter added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Jul 14, 2022
@Kordyjan Kordyjan modified the milestones: 3.2.0 backports, 3.2.1 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler crash with recursive match type Singleton inference failure when used in same file
6 participants