Skip to content

Refine Matchtype checking - #15423

Merged
odersky merged 4 commits into
scala:mainfrom
dotty-staging:fix-11982
Jun 19, 2022
Merged

Refine Matchtype checking#15423
odersky merged 4 commits into
scala:mainfrom
dotty-staging:fix-11982

Conversation

@odersky

@odersky odersky commented Jun 12, 2022

Copy link
Copy Markdown
Contributor

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

odersky added 3 commits June 12, 2022 10:36
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.
Comment thread compiler/src/dotty/tools/dotc/core/TypeComparer.scala Outdated
@odersky

odersky commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

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

@odersky

odersky commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

smarter commented Jun 15, 2022

Copy link
Copy Markdown
Member

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

odersky commented Jun 15, 2022

Copy link
Copy Markdown
Contributor Author

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

prova commented Jul 11, 2022

Copy link
Copy Markdown

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

odersky commented Jul 11, 2022

Copy link
Copy Markdown
Contributor Author

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

@prova

prova commented Jul 11, 2022

Copy link
Copy Markdown

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