@@ -830,9 +830,9 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
830830 * tp1 <:< tp2 using fourthTry (this might instantiate params in tp1)
831831 * tp1 <:< app2 using isSubType (this might instantiate params in tp2)
832832 */
833- def compareLower (tycon2bounds : TypeBounds , followSuperType : Boolean ): Boolean =
833+ def compareLower (tycon2bounds : TypeBounds , tyconIsTypeRef : Boolean ): Boolean =
834834 if ((tycon2bounds.lo `eq` tycon2bounds.hi) && ! tycon2bounds.isInstanceOf [MatchAlias ])
835- if (followSuperType ) recur(tp1, tp2.superType)
835+ if (tyconIsTypeRef ) recur(tp1, tp2.superType)
836836 else isSubApproxHi(tp1, tycon2bounds.lo.applyIfParameterized(args2))
837837 else
838838 fallback(tycon2bounds.lo)
@@ -841,15 +841,13 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
841841 case param2 : TypeParamRef =>
842842 isMatchingApply(tp1) ||
843843 canConstrain(param2) && canInstantiate(param2) ||
844- compareLower(bounds(param2), followSuperType = false )
844+ compareLower(bounds(param2), tyconIsTypeRef = false )
845845 case tycon2 : TypeRef =>
846846 isMatchingApply(tp1) ||
847847 defn.isTypelevel_S(tycon2.symbol) && compareS(tp2, tp1, fromBelow = true ) || {
848848 tycon2.info match {
849849 case info2 : TypeBounds =>
850- val gbounds2 = ctx.gadt.bounds(tycon2.symbol)
851- if (gbounds2 == null ) compareLower(info2, followSuperType = true )
852- else compareLower(gbounds2 & info2, followSuperType = false )
850+ compareLower(info2, tyconIsTypeRef = true )
853851 case info2 : ClassInfo =>
854852 tycon2.name.toString.startsWith(" Tuple" ) &&
855853 defn.isTupleType(tp2) && isSubType(tp1, tp2.toNestedPairs) ||
@@ -885,11 +883,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
885883 case tycon1 : TypeRef =>
886884 val sym = tycon1.symbol
887885 ! sym.isClass && (
888- defn.isTypelevel_S(sym) && compareS(tp1, tp2, fromBelow = false ) || {
889- val gbounds1 = ctx.gadt.bounds(tycon1.symbol)
890- if (gbounds1 == null ) recur(tp1.superType, tp2)
891- else recur((gbounds1.hi & tycon1.info.bounds.hi).applyIfParameterized(args1), tp2)
892- })
886+ defn.isTypelevel_S(sym) && compareS(tp1, tp2, fromBelow = false ) ||
887+ recur(tp1.superType, tp2))
893888 case tycon1 : TypeProxy =>
894889 recur(tp1.superType, tp2)
895890 case _ =>
0 commit comments