@@ -319,7 +319,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
319
319
thirdTry
320
320
case tp1 : TypeParamRef =>
321
321
def flagNothingBound = {
322
- if (! frozenConstraint && tp2.isRef(defn. NothingClass ) && state.isGlobalCommittable) {
322
+ if (! frozenConstraint && tp2.isRef(NothingClass ) && state.isGlobalCommittable) {
323
323
def msg = s " !!! instantiated to Nothing: $tp1, constraint = ${constraint.show}"
324
324
if (Config .failOnInstantiationToNothing) assert(false , msg)
325
325
else ctx.log(msg)
@@ -404,11 +404,12 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
404
404
if (cls2.isClass) {
405
405
if (cls2.typeParams.isEmpty) {
406
406
if (cls2 eq AnyKindClass ) return true
407
- if (tp1.isRef(defn. NothingClass )) return true
407
+ if (tp1.isRef(NothingClass )) return true
408
408
if (tp1.isLambdaSub) return false
409
409
// Note: We would like to replace this by `if (tp1.hasHigherKind)`
410
410
// but right now we cannot since some parts of the standard library rely on the
411
411
// idiom that e.g. `List <: Any`. We have to bootstrap without scalac first.
412
+ if (cls2 eq AnyClass ) return true
412
413
if (cls2 == defn.SingletonClass && tp1.isStable) return true
413
414
return tryBaseType(cls2)
414
415
}
@@ -417,7 +418,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
417
418
val base = tp1.baseType(cls2)
418
419
if (base.typeSymbol == cls2) return true
419
420
}
420
- else if (tp1.isLambdaSub && ! tp1.isRef(defn. AnyKindClass ))
421
+ else if (tp1.isLambdaSub && ! tp1.isRef(AnyKindClass ))
421
422
return recur(tp1, EtaExpansion (cls2.typeRef))
422
423
}
423
424
fourthTry
@@ -1382,7 +1383,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
1382
1383
// at run time. It would not work to replace that with `Nothing`.
1383
1384
// However, maybe we can still apply the replacement to
1384
1385
// types which are not explicitly written.
1385
- defn. NothingType
1386
+ NothingType
1386
1387
case _ => andType(tp1, tp2)
1387
1388
}
1388
1389
case _ => andType(tp1, tp2)
@@ -1393,8 +1394,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
1393
1394
}
1394
1395
1395
1396
/** The greatest lower bound of a list types */
1396
- final def glb (tps : List [Type ]): Type =
1397
- ((defn.AnyType : Type ) /: tps)(glb)
1397
+ final def glb (tps : List [Type ]): Type = ((AnyType : Type ) /: tps)(glb)
1398
1398
1399
1399
/** The least upper bound of two types
1400
1400
* @param canConstrain If true, new constraints might be added to simplify the lub.
@@ -1424,7 +1424,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling {
1424
1424
1425
1425
/** The least upper bound of a list of types */
1426
1426
final def lub (tps : List [Type ]): Type =
1427
- ((defn. NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1427
+ ((NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1428
1428
1429
1429
/** Try to produce joint arguments for a lub `A[T_1, ..., T_n] | A[T_1', ..., T_n']` using
1430
1430
* the following strategies:
0 commit comments