Skip to content

Commit da4bed3

Browse files
committed
Temporary hack to support testing
For now, we treat _every_ type spelled "Null" as the Null type. That way we can introduce a user-level Null that sits next to AnyVal and AnyRef, like the real Null will once explicit nulls are in. This hack should be reverted once we have the changes for Null implemented.
1 parent 71f10e3 commit da4bed3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ object Types {
14031403
/** Is this (an alias of) the `scala.Null` type? */
14041404
final def isNull(given Context) =
14051405
isRef(defn.NullClass)
1406+
|| classSymbol.name == tpnme.Null // !!! temporary kludge for being able to test without the explicit nulls PR
14061407

14071408
/** The resultType of a LambdaType, or ExprType, the type itself for others */
14081409
def resultType(implicit ctx: Context): Type = this

0 commit comments

Comments
 (0)