@@ -302,7 +302,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
302
302
thirdTry
303
303
case tp1 : TypeParamRef =>
304
304
def flagNothingBound = {
305
- if (! frozenConstraint && tp2.isRef(defn. NothingClass ) && state.isGlobalCommittable) {
305
+ if (! frozenConstraint && tp2.isRef(NothingClass ) && state.isGlobalCommittable) {
306
306
def msg = s " !!! instantiated to Nothing: $tp1, constraint = ${constraint.show}"
307
307
if (Config .failOnInstantiationToNothing) assert(false , msg)
308
308
else ctx.log(msg)
@@ -384,8 +384,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
384
384
if (cls2.isClass) {
385
385
if (cls2.typeParams.isEmpty) {
386
386
if (cls2 eq AnyKindClass ) return true
387
- if (tp1.isRef(defn. NothingClass )) return true
387
+ if (tp1.isRef(NothingClass )) return true
388
388
if (tp1.isLambdaSub) return false
389
+ if (cls2 eq AnyClass ) return true
389
390
// Note: We would like to replace this by `if (tp1.hasHigherKind)`
390
391
// but right now we cannot since some parts of the standard library rely on the
391
392
// idiom that e.g. `List <: Any`. We have to bootstrap without scalac first.
@@ -399,7 +400,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
399
400
val base = tp1.baseType(cls2)
400
401
if (base.typeSymbol == cls2) return true
401
402
}
402
- else if (tp1.isLambdaSub && ! tp1.isRef(defn. AnyKindClass ))
403
+ else if (tp1.isLambdaSub && ! tp1.isRef(AnyKindClass ))
403
404
return recur(tp1, EtaExpansion (cls2.typeRef))
404
405
}
405
406
fourthTry
@@ -1296,7 +1297,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1296
1297
// at run time. It would not work to replace that with `Nothing`.
1297
1298
// However, maybe we can still apply the replacement to
1298
1299
// types which are not explicitly written.
1299
- defn. NothingType
1300
+ NothingType
1300
1301
case _ => andType(tp1, tp2)
1301
1302
}
1302
1303
case _ => andType(tp1, tp2)
@@ -1307,8 +1308,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1307
1308
}
1308
1309
1309
1310
/** The greatest lower bound of a list types */
1310
- final def glb (tps : List [Type ]): Type =
1311
- ((defn.AnyType : Type ) /: tps)(glb)
1311
+ final def glb (tps : List [Type ]): Type = ((AnyType : Type ) /: tps)(glb)
1312
1312
1313
1313
/** The least upper bound of two types
1314
1314
* @param canConstrain If true, new constraints might be added to simplify the lub.
@@ -1338,7 +1338,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
1338
1338
1339
1339
/** The least upper bound of a list of types */
1340
1340
final def lub (tps : List [Type ]): Type =
1341
- ((defn. NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1341
+ ((NothingType : Type ) /: tps)(lub(_,_, canConstrain = false ))
1342
1342
1343
1343
/** Try to produce joint arguments for a lub `A[T_1, ..., T_n] | A[T_1', ..., T_n']` using
1344
1344
* the following strategies:
0 commit comments