Skip to content

Conversation

liufengyun
Copy link
Contributor

Fix #2143: remove widenForMatchSelector in typing pattern matches.

@@ -354,7 +354,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
case Bind(_, pat) => project(pat)
case UnApply(_, _, pats) =>
if (pat.tpe.classSymbol.is(CaseClass))
Kon(pat.tpe.stripAnnots, pats.map(pat => project(pat, roundUp)))
Kon(pat.tpe.stripAnnots.dealias, pats.map(pat => project(pat, roundUp)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change fix the exhaustivity check if we remove the widenForMatchSelector. But normally, shouldn't TypeComparer take care of dealiasing in subtype checking? Ping @odersky @smarter ?

@felixmulder
Copy link
Contributor

Put a FIXME then LGTM

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