Skip to content

Commit cf849a6

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 968332e commit cf849a6

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
@@ -1027,8 +1027,7 @@ class TypeComparer(using val comparerCtx: Context) extends ConstraintHandling wi
10271027

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

0 commit comments

Comments
 (0)