Skip to content

Commit 52e7962

Browse files
committed
Remove extraneous fourthTry
If `canInstantiate` fails, we fallback to `compareLower` which itself can fallback to `fourthTry`, so there's no need to fallback to `fourhTry` inside `canInstantiate` itself.
1 parent 7ba37f2 commit 52e7962

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,7 @@ class TypeComparer(using val comparerCtx: Context) extends ConstraintHandling wi
10281028

10291029
/** `param2` can be instantiated to a type application prefix of the LHS
10301030
* or to a type application prefix of one of the LHS base class instances
1031-
* and the resulting type application is a supertype of `tp1`,
1032-
* or fallback to fourthTry.
1031+
* and the resulting type application is a supertype of `tp1`.
10331032
*/
10341033
def canInstantiate(tycon2: TypeParamRef): Boolean = {
10351034
def appOK(tp1base: Type) = tp1base match {
@@ -1051,8 +1050,7 @@ class TypeComparer(using val comparerCtx: Context) extends ConstraintHandling wi
10511050
false
10521051
}
10531052
liftToBase(tp1w.baseClasses)
1054-
} ||
1055-
fourthTry
1053+
}
10561054
}
10571055
}
10581056

0 commit comments

Comments
 (0)