JVM_IR: JvmArgumentNullabilityAssertionsLowering

This commit is contained in:
Dmitry Petrov
2019-11-25 17:34:20 +03:00
parent c676b58c14
commit fc7783c7dd
8 changed files with 286 additions and 1 deletions
@@ -0,0 +1,21 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: test.kt
import kotlin.test.*
fun box(): String {
assertFailsWith<NullPointerException> { J.j().method() }
assertFailsWith<NullPointerException> { J.j().field }
assertFailsWith<NullPointerException> { J.j().field = 42 }
return "OK"
}
// FILE: J.java
public class J {
public Object field;
public void method() {}
public static J j() { return null; }
}