We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb3dbf7 commit 03b391cCopy full SHA for 03b391c
library/src/scala/runtime/stdLibPatches/Predef.scala
@@ -50,6 +50,9 @@ object Predef:
50
extension [T](x: T | Null) inline def nn: x.type & T =
51
scala.runtime.Scala3RunTime.nn(x)
52
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`. */
56
extension (inline x: AnyRef | Null)
57
@experimental
58
inline def eq(inline y: AnyRef | Null): Boolean =
0 commit comments