File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1007,7 +1007,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
10071007 case tp1 : MatchType =>
10081008 def compareMatch = tp2 match {
10091009 case tp2 : MatchType =>
1010- isSubType(tp1.scrutinee, tp2.scrutinee) &&
1010+ val scrutinee1 = tp1.scrutinee match
1011+ case tp : TermRef if tp.symbol.is(InlineProxy ) => tp.info
1012+ case tp => tp.widenSkolem
1013+ isSameType(scrutinee1, tp2.scrutinee) &&
10111014 tp1.cases.corresponds(tp2.cases)(isSubType)
10121015 case _ => false
10131016 }
Original file line number Diff line number Diff line change 1+ final class A
2+ final class B
3+
4+ type MT [X ] = X match
5+ case A => String
6+ case B => Int
7+
8+ def test : MT [A | B ] = ??? : MT [A ] // error
9+ // testing that
10+ // MT[A] !<: MT[A | B]
11+ // otherwise
12+ // String <: MT[A] <: MT[A | B]
13+ // but
14+ // String !<: MT[A | B]
You can’t perform that action at this time.
0 commit comments