Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
olhotak committed May 9, 2022
1 parent bb3dbf7 commit cc44db8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/src/scala/runtime/stdLibPatches/Predef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ object Predef:
extension [T](x: T | Null) inline def nn: x.type & T =
scala.runtime.Scala3RunTime.nn(x)

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

0 comments on commit cc44db8

Please sign in to comment.