File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -588,6 +588,12 @@ class Definitions {
588
588
name.startsWith(prefix) && name.drop(prefix.length).forall(_.isDigit)
589
589
}
590
590
591
+ def isBottomClass (cls : Symbol ) = cls == NothingClass || cls == NullClass
592
+ def isBottomType (tp : Type ) = tp match {
593
+ case tp : TypeRef => isBottomClass(tp.symbol)
594
+ case _ => false
595
+ }
596
+
591
597
def isFunctionClass (cls : Symbol ) = isVarArityClass(cls, tpnme.Function )
592
598
def isAbstractFunctionClass (cls : Symbol ) = isVarArityClass(cls, tpnme.AbstractFunction )
593
599
def isTupleClass (cls : Symbol ) = isVarArityClass(cls, tpnme.Tuple )
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ object Inferencing {
89
89
val minimize =
90
90
variance >= 0 && ! (
91
91
force == ForceDegree .noBottom &&
92
- isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true )))
92
+ defn. isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true )))
93
93
if (minimize) instantiate(tvar, fromBelow = true )
94
94
else toMaximize = true
95
95
}
@@ -173,9 +173,6 @@ object Inferencing {
173
173
approxAbove - approxBelow
174
174
}
175
175
176
- def isBottomType (tp : Type )(implicit ctx : Context ) =
177
- tp == defn.NothingType || tp == defn.NullType
178
-
179
176
/** Recursively widen and also follow type declarations and type aliases. */
180
177
def widenForMatchSelector (tp : Type )(implicit ctx : Context ): Type = tp.widen match {
181
178
case tp : TypeRef if ! tp.symbol.isClass => widenForMatchSelector(tp.info.bounds.hi)
You can’t perform that action at this time.
0 commit comments