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 {
11751175 def isBottomClassAfterErasure (cls : Symbol ): Boolean = cls == NothingClass || cls == NullClass
11761176
11771177 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)
11801181
11811182 def isBottomTypeAfterErasure (tp : Type ): Boolean =
1182- tp.isCombinedRef(NothingClass ) || tp.isCombinedRef(NullClass )
1183+ val tpw = tp.widen
1184+ tpw.isCombinedRef(NothingClass ) || tpw.isCombinedRef(NullClass )
11831185
11841186 /** Is a function class.
11851187 * - FunctionXXL
Original file line number Diff line number Diff line change @@ -1539,9 +1539,6 @@ object Types {
15391539 /** Is this (an alias of) the `scala.Null` type? */
15401540 final def isNullType (using Context ) = isRef(defn.NullClass )
15411541
1542- /** Is this (an alias of) the `scala.Null` or `scala.Nothing` type? */
1543- final def isNullOrNothingType (using Context ) = isNullType || isRef(defn.NothingClass )
1544-
15451542 /** The resultType of a LambdaType, or ExprType, the type itself for others */
15461543 def resultType (using Context ): Type = this
15471544
You can’t perform that action at this time.
0 commit comments