IR: '!!' is generated as 'CHECK_NOT_NULL' intrinsic
``` fun <T : Any> CHECK_NOT_NULL(x: T?): x = if (x != null) x else throw NullPointerException(...) ``` This allows to compile both Kotlin/JVM and Kotlin/JS effectively.
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ class ExceptionHelperCallsTransformer(private val context: JsIrBackendContext) :
|
||||
}
|
||||
|
||||
private val helperMapping = mapOf(
|
||||
context.irBuiltIns.throwNpeSymbol to referenceFunction(kotlinPackageFqn.child(Name.identifier("THROW_NPE"))),
|
||||
// context.irBuiltIns.throwNpeSymbol to referenceFunction(kotlinPackageFqn.child(Name.identifier("THROW_NPE"))), -- TODO checkNotNullSymbol
|
||||
context.irBuiltIns.throwCceSymbol to referenceFunction(kotlinPackageFqn.child(Name.identifier("THROW_CCE"))),
|
||||
context.irBuiltIns.throwIseSymbol to referenceFunction(kotlinPackageFqn.child(Name.identifier("THROW_ISE"))),
|
||||
context.irBuiltIns.noWhenBranchMatchedExceptionSymbol to referenceFunction(kotlinPackageFqn.child(Name.identifier("noWhenBranchMatchedException")))
|
||||
|
||||
Reference in New Issue
Block a user