File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ object TypeTestsCasts {
90
90
}
91
91
}.apply(tp)
92
92
93
- def isClassDetermined (X : Type , P : AppliedType )(implicit ctx : Context ) = {
93
+ /** Returns true if the type arguments of `P` can be determined from `X` */
94
+ def typeArgsTrivial (X : Type , P : AppliedType )(implicit ctx : Context ) = {
94
95
val AppliedType (tycon, _) = P
95
96
96
97
def underlyingLambda (tp : Type ): TypeLambda = tp.ensureLambdaSub match {
@@ -147,8 +148,8 @@ object TypeTestsCasts {
147
148
// always false test warnings are emitted elsewhere
148
149
X .classSymbol.exists && P .classSymbol.exists && ! X .classSymbol.asClass.mayHaveCommonChild(P .classSymbol.asClass) ||
149
150
// first try without striping type parameters for performance
150
- isClassDetermined (X , tpe)(ctx.fresh.setNewTyperState().setFreshGADTBounds) ||
151
- isClassDetermined (stripTypeParam(X ), tpe)(ctx.fresh.setNewTyperState().setFreshGADTBounds)
151
+ typeArgsTrivial (X , tpe)(ctx.fresh.setNewTyperState().setFreshGADTBounds) ||
152
+ typeArgsTrivial (stripTypeParam(X ), tpe)(ctx.fresh.setNewTyperState().setFreshGADTBounds)
152
153
}
153
154
case AndType (tp1, tp2) => recur(X , tp1) && recur(X , tp2)
154
155
case OrType (tp1, tp2) => recur(X , tp1) && recur(X , tp2)
You can’t perform that action at this time.
0 commit comments