File tree Expand file tree Collapse file tree 2 files changed +20
-14
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -1036,20 +1036,17 @@ class TypeComparer(using val comparerCtx: Context) extends ConstraintHandling wi
10361036 case _ => false
10371037 }
10381038
1039- tp1.widen match {
1040- case tp1w : AppliedType => appOK(tp1w)
1041- case tp1w =>
1042- tp1w.typeSymbol.isClass && {
1043- val classBounds = tycon2.classSymbols
1044- def liftToBase (bcs : List [ClassSymbol ]): Boolean = bcs match {
1045- case bc :: bcs1 =>
1046- classBounds.exists(bc.derivesFrom) && appOK(nonExprBaseType(tp1, bc))
1047- || liftToBase(bcs1)
1048- case _ =>
1049- false
1050- }
1051- liftToBase(tp1w.baseClasses)
1052- }
1039+ val tp1w = tp1.widen
1040+ appOK(tp1w) || tp1w.typeSymbol.isClass && {
1041+ val classBounds = tycon2.classSymbols
1042+ def liftToBase (bcs : List [ClassSymbol ]): Boolean = bcs match {
1043+ case bc :: bcs1 =>
1044+ classBounds.exists(bc.derivesFrom) && appOK(nonExprBaseType(tp1, bc))
1045+ || liftToBase(bcs1)
1046+ case _ =>
1047+ false
1048+ }
1049+ liftToBase(tp1w.baseClasses)
10531050 }
10541051 }
10551052
Original file line number Diff line number Diff line change 1+ class Two [A , B ]
2+ class One [A ] extends Two [A , A ]
3+
4+ object Test {
5+ def foo [F [_, _]](x : F [Int , Int ]) = x
6+
7+ val t : One [Int ] = ???
8+ foo(t)
9+ }
You can’t perform that action at this time.
0 commit comments