@@ -1945,19 +1945,6 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
1945
1945
true
1946
1946
}
1947
1947
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
- }
1961
1948
def covariantIntersecting (tp1 : Type , tp2 : Type , tparam : TypeParamInfo ): Boolean = {
1962
1949
intersecting(tp1, tp2) || {
1963
1950
// We still need to proof that `Nothing` is not a valid
@@ -1981,7 +1968,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
1981
1968
}
1982
1969
}
1983
1970
1984
- zip_zip_forall (args1, args2, tycon1.typeParams) {
1971
+ (args1, args2, tycon1.typeParams).zipped.forall {
1985
1972
(arg1, arg2, tparam) =>
1986
1973
val v = tparam.paramVariance
1987
1974
if (v > 0 )
@@ -1994,7 +1981,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
1994
1981
covariantIntersecting(arg1, arg2, tparam) && (isSameType(arg1, arg2) || {
1995
1982
// We can only trust a "no" from `isSameType` when both
1996
1983
// `arg1` and `arg2` are fully instantiated.
1997
- val fullyInstantiated = new TypeAccumulator [Boolean ] {
1984
+ def fullyInstantiated ( tp : Type ) : Boolean = new TypeAccumulator [Boolean ] {
1998
1985
override def apply (x : Boolean , t : Type ) =
1999
1986
x && {
2000
1987
t match {
@@ -2003,9 +1990,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
2003
1990
case _ => foldOver(x, t)
2004
1991
}
2005
1992
}
2006
- }
2007
- ! (fullyInstantiated.apply(true , arg1) &&
2008
- fullyInstantiated.apply(true , arg2))
1993
+ }.apply(true , tp)
1994
+ ! (fullyInstantiated(arg1) && fullyInstantiated(arg2))
2009
1995
})
2010
1996
}
2011
1997
case (tp1 : HKLambda , tp2 : HKLambda ) =>
0 commit comments