@@ -297,7 +297,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
297
297
thirdTry
298
298
case tp1 : TypeParamRef =>
299
299
def flagNothingBound = {
300
- if (! frozenConstraint && tp2.isRef(defn. NothingClass ) && state.isGlobalCommittable) {
300
+ if (! frozenConstraint && tp2.isRef(NothingClass ) && state.isGlobalCommittable) {
301
301
def msg = s " !!! instantiated to Nothing: $tp1, constraint = ${constraint.show}"
302
302
if (Config .failOnInstantiationToNothing) assert(false , msg)
303
303
else ctx.log(msg)
@@ -379,8 +379,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
379
379
if (cls2.isClass) {
380
380
if (cls2.typeParams.isEmpty) {
381
381
if (cls2 eq AnyKindClass ) return true
382
- if (tp1.isRef(defn. NothingClass )) return true
382
+ if (tp1.isRef(NothingClass )) return true
383
383
if (tp1.isLambdaSub) return false
384
+ if (cls2 eq AnyClass ) return true
384
385
// Note: We would like to replace this by `if (tp1.hasHigherKind)`
385
386
// but right now we cannot since some parts of the standard library rely on the
386
387
// idiom that e.g. `List <: Any`. We have to bootstrap without scalac first.
@@ -394,7 +395,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
394
395
val base = tp1.baseType(cls2)
395
396
if (base.typeSymbol == cls2) return true
396
397
}
397
- else if (tp1.isLambdaSub && ! tp1.isRef(defn. AnyKindClass ))
398
+ else if (tp1.isLambdaSub && ! tp1.isRef(AnyKindClass ))
398
399
return recur(tp1, EtaExpansion (cls2.typeRef))
399
400
}
400
401
fourthTry
@@ -1257,7 +1258,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1257
1258
// at run time. It would not work to replace that with `Nothing`.
1258
1259
// However, maybe we can still apply the replacement to
1259
1260
// types which are not explicitly written.
1260
- defn. NothingType
1261
+ NothingType
1261
1262
case _ => andType(tp1, tp2)
1262
1263
}
1263
1264
case _ => andType(tp1, tp2)
@@ -1268,8 +1269,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1268
1269
}
1269
1270
1270
1271
/** The greatest lower bound of a list types */
1271
- final def glb (tps : List [Type ]): Type =
1272
- ((defn.AnyType : Type ) /: tps)(glb)
1272
+ final def glb (tps : List [Type ]): Type = ((AnyType : Type ) /: tps)(glb)
1273
1273
1274
1274
/** The least upper bound of two types
1275
1275
* @param canConstrain If true, new constraints might be added to simplify the lub.
@@ -1299,7 +1299,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1299
1299
1300
1300
/** The least upper bound of a list of types */
1301
1301
final def lub (tps : List [Type ]): Type =
1302
- ((defn. NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1302
+ ((NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1303
1303
1304
1304
/** Try to produce joint arguments for a lub `A[T_1, ..., T_n] | A[T_1', ..., T_n']` using
1305
1305
* the following strategies:
0 commit comments