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 {
9090 }
9191 }.apply(tp)
9292
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 ) = {
9495 val AppliedType (tycon, _) = P
9596
9697 def underlyingLambda (tp : Type ): TypeLambda = tp.ensureLambdaSub match {
@@ -147,8 +148,8 @@ object TypeTestsCasts {
147148 // always false test warnings are emitted elsewhere
148149 X .classSymbol.exists && P .classSymbol.exists && ! X .classSymbol.asClass.mayHaveCommonChild(P .classSymbol.asClass) ||
149150 // 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)
152153 }
153154 case AndType (tp1, tp2) => recur(X , tp1) && recur(X , tp2)
154155 case OrType (tp1, tp2) => recur(X , tp1) && recur(X , tp2)
You can’t perform that action at this time.
0 commit comments