File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1175,11 +1175,13 @@ class Definitions {
1175
1175
def isBottomClassAfterErasure (cls : Symbol ): Boolean = cls == NothingClass || cls == NullClass
1176
1176
1177
1177
def isBottomType (tp : Type ): Boolean =
1178
- if (ctx.explicitNulls && ! ctx.phase.erasedTypes) tp.isCombinedRef(NothingClass )
1179
- else isBottomTypeAfterErasure(tp)
1178
+ val tpw = tp.widen
1179
+ tpw.isCombinedRef(NothingClass )
1180
+ || tpw.isCombinedRef(NullClass ) && (! ctx.explicitNulls || ctx.phase.erasedTypes)
1180
1181
1181
1182
def isBottomTypeAfterErasure (tp : Type ): Boolean =
1182
- tp.isCombinedRef(NothingClass ) || tp.isCombinedRef(NullClass )
1183
+ val tpw = tp.widen
1184
+ tpw.isCombinedRef(NothingClass ) || tpw.isCombinedRef(NullClass )
1183
1185
1184
1186
/** Is a function class.
1185
1187
* - FunctionXXL
Original file line number Diff line number Diff line change @@ -1539,9 +1539,6 @@ object Types {
1539
1539
/** Is this (an alias of) the `scala.Null` type? */
1540
1540
final def isNullType (using Context ) = isRef(defn.NullClass )
1541
1541
1542
- /** Is this (an alias of) the `scala.Null` or `scala.Nothing` type? */
1543
- final def isNullOrNothingType (using Context ) = isNullType || isRef(defn.NothingClass )
1544
-
1545
1542
/** The resultType of a LambdaType, or ExprType, the type itself for others */
1546
1543
def resultType (using Context ): Type = this
1547
1544
You can’t perform that action at this time.
0 commit comments