@@ -34,10 +34,6 @@ object TypeTestsCasts {
34
34
*
35
35
* First do the following substitution:
36
36
* (a) replace `T @unchecked` and pattern binder types (e.g., `_$1`) in P with WildcardType
37
- * (b) replace pattern binder types (e.g., `_$1`) in X:
38
- * - variance = 1 : hiBound
39
- * - variance = -1 : loBound
40
- * - variance = 0 : OrType(Any, Nothing) // TODO: use original type param bounds
41
37
*
42
38
* Then check:
43
39
*
@@ -67,16 +63,6 @@ object TypeTestsCasts {
67
63
}
68
64
}.apply(tp)
69
65
70
- def replaceX (tp : Type )(using Context ) = new TypeMap {
71
- def apply (tp : Type ) = tp match {
72
- case tref : TypeRef if tref.typeSymbol.isPatternBound =>
73
- if (variance == 1 ) tref.info.hiBound
74
- else if (variance == - 1 ) tref.info.loBound
75
- else OrType (defn.AnyType , defn.NothingType , soft = true ) // TODO: what does this line do?
76
- case _ => mapOver(tp)
77
- }
78
- }.apply(tp)
79
-
80
66
/** Returns true if the type arguments of `P` can be determined from `X` */
81
67
def typeArgsTrivial (X : Type , P : AppliedType )(using Context ) = inContext(ctx.fresh.setExploreTyperState().setFreshGADTBounds) {
82
68
val AppliedType (tycon, _) = P
@@ -154,7 +140,7 @@ object TypeTestsCasts {
154
140
case _ => true
155
141
})
156
142
157
- val res = recur(replaceX( X .widen) , replaceP(P ))
143
+ val res = recur(X .widen, replaceP(P ))
158
144
159
145
debug.println(i " checking ${X .show} isInstanceOf ${P } = $res" )
160
146
0 commit comments