Skip to content

Commit 03b391c

Browse files
committed
add comment
1 parent bb3dbf7 commit 03b391c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/src/scala/runtime/stdLibPatches/Predef.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ object Predef:
5050
extension [T](x: T | Null) inline def nn: x.type & T =
5151
scala.runtime.Scala3RunTime.nn(x)
5252

53+
/** Enables an expression of type `T|Null`, where `T` is a subtype of `AnyRef`, to be checked for `null`
54+
* using `eq` and `ne`, rather than only `==` and `!=`. This is needed because `Null` no longer has
55+
* `eq` or `ne` methods, only `==` and `!=` inherited from `Any`. */
5356
extension (inline x: AnyRef | Null)
5457
@experimental
5558
inline def eq(inline y: AnyRef | Null): Boolean =

0 commit comments

Comments
 (0)