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 4a1c9f2 commit ceddf52Copy full SHA for ceddf52
library/src/scala/runtime/Scala3RunTime.scala
@@ -15,8 +15,7 @@ object Scala3RunTime:
15
* Extracted to minimize the bytecode size at call site.
16
*/
17
def nn[T](x: T | Null): x.type & T =
18
- val isNull = x == null
19
- if (isNull) throw new NullPointerException("tried to cast away nullability, but value is null")
20
- else x.asInstanceOf[x.type & T]
+ if (x == null) throw new NullPointerException("tried to cast away nullability, but value is null")
+ else x
21
22
end Scala3RunTime
0 commit comments