scala.runtime.Scala3RunTime.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala3-library_sjs1_3 Show documentation
Show all versions of scala3-library_sjs1_3 Show documentation
scala3-library-bootstrappedJS
package scala.runtime
object Scala3RunTime:
// Called by inline def assert's. Extracted to minimize the bytecode size at call site.
def assertFailed(message: Any): Nothing =
throw new java.lang.AssertionError("assertion failed: " + message)
def assertFailed(): Nothing =
throw new java.lang.AssertionError("assertion failed")
/** Called by the inline extension def `nn`.
*
* Extracted to minimize the bytecode size at call site.
*/
@deprecated("use Predef.nn instead", "3.2")
def nn[T](x: T | Null): x.type & T =
val isNull = x == null
if isNull then nnFail()
else x.asInstanceOf[x.type & T]
/** Called by the inline extension def `nn`.
*
* Extracted to minimize the bytecode size at call site.
*/
def nnFail(): Nothing =
throw new NullPointerException("tried to cast away nullability, but value is null")
end Scala3RunTime
© 2015 - 2024 Weber Informatics LLC | Privacy Policy