File tree 2 files changed +11
-10
lines changed
library/src/scala/runtime
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
package scala .runtime
2
2
3
- import scala .annotation .since
4
-
5
3
object Scala3RunTime :
6
4
7
5
// Called by inline def assert's. Extracted to minimize the bytecode size at call site.
@@ -21,12 +19,4 @@ object Scala3RunTime:
21
19
if (isNull) throw new NullPointerException (" tried to cast away nullability, but value is null" )
22
20
else x.asInstanceOf [x.type & T ]
23
21
24
- extension (inline x : AnyRef | Null )
25
- @ since(" 3.2" )
26
- inline def eq (inline y : AnyRef | Null ): Boolean =
27
- x.asInstanceOf [AnyRef ] eq y.asInstanceOf [AnyRef ]
28
- @ since(" 3.2" )
29
- inline def ne (inline y : AnyRef | Null ): Boolean =
30
- ! (x eq y)
31
-
32
22
end Scala3RunTime
Original file line number Diff line number Diff line change 1
1
package scala .runtime .stdLibPatches
2
2
3
+ import scala .annotation .since
4
+
3
5
object Predef :
4
6
import compiletime .summonFrom
5
7
@@ -47,4 +49,13 @@ object Predef:
47
49
*/
48
50
extension [T ](x : T | Null ) inline def nn : x.type & T =
49
51
scala.runtime.Scala3RunTime .nn(x)
52
+
53
+ extension (inline x : AnyRef | Null )
54
+ @ since(" 3.2" )
55
+ inline def eq (inline y : AnyRef | Null ): Boolean =
56
+ x.asInstanceOf [AnyRef ] eq y.asInstanceOf [AnyRef ]
57
+ @ since(" 3.2" )
58
+ inline def ne (inline y : AnyRef | Null ): Boolean =
59
+ ! (x eq y)
60
+
50
61
end Predef
You can’t perform that action at this time.
0 commit comments