File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
library/src/scala/runtime/stdLibPatches Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,16 @@ object Predef:
50
50
extension [T ](x : T | Null ) inline def nn : x.type & T =
51
51
scala.runtime.Scala3RunTime .nn(x)
52
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
53
extension (inline x : AnyRef | Null )
54
+ /** Enables an expression of type `T|Null`, where `T` is a subtype of `AnyRef`, to be checked for `null`
55
+ * using `eq` rather than only `==`. This is needed because `Null` no longer has
56
+ * `eq` or `ne` methods, only `==` and `!=` inherited from `Any`. */
57
57
@ experimental
58
58
inline def eq (inline y : AnyRef | Null ): Boolean =
59
59
x.asInstanceOf [AnyRef ] eq y.asInstanceOf [AnyRef ]
60
+ /** Enables an expression of type `T|Null`, where `T` is a subtype of `AnyRef`, to be checked for `null`
61
+ * using `ne` rather than only `!=`. This is needed because `Null` no longer has
62
+ * `eq` or `ne` methods, only `==` and `!=` inherited from `Any`. */
60
63
@ experimental
61
64
inline def ne (inline y : AnyRef | Null ): Boolean =
62
65
! (x eq y)
You can’t perform that action at this time.
0 commit comments