File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -243,8 +243,8 @@ object Types {
243
243
// then the OrType derivesFrom the class. Otherwise, we need to check both sides
244
244
// derivesFrom the class.
245
245
loop(tp.tp1) && loop(tp.tp2)
246
- || tp.tp1.isNullType && loop(tp.tp2)
247
- || tp.tp2.isNullType && loop(tp.tp2 )
246
+ || tp.tp1.isNullOrNothingType && loop(tp.tp2)
247
+ || tp.tp2.isNullOrNothingType && loop(tp.tp1 )
248
248
case tp : JavaArrayType =>
249
249
cls == defn.ObjectClass
250
250
case _ =>
@@ -1534,6 +1534,9 @@ object Types {
1534
1534
/** Is this (an alias of) the `scala.Null` type? */
1535
1535
final def isNullType (using Context ) = isRef(defn.NullClass )
1536
1536
1537
+ /** Is this (an alias of) the `scala.Null` or `scala.Nothing` type? */
1538
+ final def isNullOrNothingType (using Context ) = isNullType || isRef(defn.NothingClass )
1539
+
1537
1540
/** The resultType of a LambdaType, or ExprType, the type itself for others */
1538
1541
def resultType (using Context ): Type = this
1539
1542
You can’t perform that action at this time.
0 commit comments