Refine Matchtype checking - #15423
Conversation
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.
|
@dwijnand @OlivierBlanvillain can one of you give this a quick review today? It would be good to get this into 3.2. |
|
Going to merge this now, so that it makes it into 3.2. The alternative would be to keep the unsound previous behavior. |
|
I was thinking of chatting about it tomorrow afternoon, thinking that was soon enough? Maybe I'm misremembering the 3.2 cutoff date. |
|
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. |
|
That's a pity. I would have hoped to get this in, to address the unsoundness. |
Backport #15423: Refine Matchtype checking
|
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! |
|
It's a neg test, right? So yes this would be expected. |
|
Thanks |
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