@@ -1945,19 +1945,6 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
19451945 true
19461946 }
19471947 case (AppliedType (tycon1, args1), AppliedType (tycon2, args2)) if tycon1 == tycon2 =>
1948- // Unboxed xs.zip(ys).zip(zs).forall { case ((a, b), c) => f(a, b, c) }
1949- def zip_zip_forall [A , B , C ](xs : List [A ], ys : List [B ], zs : List [C ])(f : (A , B , C ) => Boolean ): Boolean = {
1950- xs match {
1951- case x :: xs => ys match {
1952- case y :: ys => zs match {
1953- case z :: zs => f(x, y, z) && zip_zip_forall(xs, ys, zs)(f)
1954- case _ => true
1955- }
1956- case _ => true
1957- }
1958- case _ => true
1959- }
1960- }
19611948 def covariantIntersecting (tp1 : Type , tp2 : Type , tparam : TypeParamInfo ): Boolean = {
19621949 intersecting(tp1, tp2) || {
19631950 // We still need to proof that `Nothing` is not a valid
@@ -1981,7 +1968,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
19811968 }
19821969 }
19831970
1984- zip_zip_forall (args1, args2, tycon1.typeParams) {
1971+ (args1, args2, tycon1.typeParams).zipped.forall {
19851972 (arg1, arg2, tparam) =>
19861973 val v = tparam.paramVariance
19871974 if (v > 0 )
@@ -1994,7 +1981,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
19941981 covariantIntersecting(arg1, arg2, tparam) && (isSameType(arg1, arg2) || {
19951982 // We can only trust a "no" from `isSameType` when both
19961983 // `arg1` and `arg2` are fully instantiated.
1997- val fullyInstantiated = new TypeAccumulator [Boolean ] {
1984+ def fullyInstantiated ( tp : Type ) : Boolean = new TypeAccumulator [Boolean ] {
19981985 override def apply (x : Boolean , t : Type ) =
19991986 x && {
20001987 t match {
@@ -2003,9 +1990,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
20031990 case _ => foldOver(x, t)
20041991 }
20051992 }
2006- }
2007- ! (fullyInstantiated.apply(true , arg1) &&
2008- fullyInstantiated.apply(true , arg2))
1993+ }.apply(true , tp)
1994+ ! (fullyInstantiated(arg1) && fullyInstantiated(arg2))
20091995 })
20101996 }
20111997 case (tp1 : HKLambda , tp2 : HKLambda ) =>
0 commit comments