File tree 1 file changed +6
-6
lines changed
compiler/src/dotty/tools/dotc/core 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -153,16 +153,16 @@ object Types {
153
153
154
154
/** Is this type an instance of a non-bottom subclass of the given class `cls`? */
155
155
final def derivesFrom (cls : Symbol )(implicit ctx : Context ): Boolean = {
156
- def loop (tp : Type ) = tp match {
156
+ def loop (tp : Type ): Boolean = tp match {
157
157
case tp : TypeRef =>
158
158
val sym = tp.symbol
159
- if (sym.isClass) sym.derivesFrom(cls) else tp.superType.derivesFrom(cls)
159
+ if (sym.isClass) sym.derivesFrom(cls) else loop( tp.superType) : @ tailrec
160
160
case tp : TypeProxy =>
161
- tp.underlying.derivesFrom(cls)
161
+ loop( tp.underlying) : @ tailrec
162
162
case tp : AndType =>
163
- tp.tp1.derivesFrom(cls ) || tp.tp2.derivesFrom(cls)
163
+ loop( tp.tp1) || loop( tp.tp2) : @ tailrec
164
164
case tp : OrType =>
165
- tp.tp1.derivesFrom(cls ) && tp.tp2.derivesFrom(cls)
165
+ loop( tp.tp1) && loop( tp.tp2) : @ tailrec
166
166
case tp : JavaArrayType =>
167
167
cls == defn.ObjectClass
168
168
case _ =>
@@ -1011,7 +1011,7 @@ object Types {
1011
1011
}
1012
1012
else NoType
1013
1013
case SkolemType (tp) =>
1014
- tp.lookupRefined(name )
1014
+ loop(tp )
1015
1015
case pre : WildcardType =>
1016
1016
WildcardType
1017
1017
case pre : TypeRef =>
You can’t perform that action at this time.
0 commit comments