@@ -900,8 +900,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
900
900
901
901
def tryBaseType (cls2 : Symbol ) =
902
902
903
- def computeBase (tp : Type ): Type = tp .widenDealias match
904
- case tp @ AndType (tp1, tp2 ) =>
903
+ def computeBase (tp1 : Type ): Type = tp1 .widenDealias match
904
+ case tp @ AndType (tp11, tp12 ) =>
905
905
// We have to treat AndTypes specially, since the normal treatment
906
906
// of `(T1 & T2).baseType(C)` combines the base types of T1 and T2 via glb
907
907
// which drops any types that don't exist. That forgets possible solutions.
@@ -912,11 +912,11 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
912
912
// does not hold. The new strategy is to declare that the base type computation
913
913
// failed since R does not have a base type, and to proceed to fourthTry instead,
914
914
// where we try both sides of an AndType individually.
915
- val b1 = computeBase(tp1 )
916
- val b2 = computeBase(tp2 )
915
+ val b1 = computeBase(tp11 )
916
+ val b2 = computeBase(tp12 )
917
917
if b1.exists && b2.exists then tp.derivedAndType(b1, b2) else NoType
918
918
case _ =>
919
- nonExprBaseType(tp , cls2).boxedIfTypeParam(tp .typeSymbol)
919
+ nonExprBaseType(tp1 , cls2).boxedIfTypeParam(tp1 .typeSymbol)
920
920
921
921
val base = computeBase(tp1)
922
922
if base.exists && (base ne tp1)
0 commit comments