Skip to content

Commit fb672e5

Browse files
committed
Address review: rename isClassDetermined to typeArgsTrivial
1 parent 33094bf commit fb672e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)