Tests for issues fixed in JVM_IR

This commit is contained in:
Dmitry Petrov
2020-12-21 15:41:21 +03:00
parent 5e5b236ef8
commit 443cd0fc2c
19 changed files with 364 additions and 1 deletions
@@ -0,0 +1,35 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: kt18911.kt
fun testNullString() {
try {
val t1 = J.nullString()::capitalize
throw Exception("'J.nullString()::capitalize' should throw")
} catch (e: NullPointerException) {}
}
fun testNotNullString() {
try {
val t1 = J.notNullString()::capitalize
throw Exception("'J.notNullString()::capitalize' should throw")
} catch (e: NullPointerException) {}
}
fun box(): String {
testNullString()
testNotNullString()
return "OK"
}
// FILE: J.java
import org.jetbrains.annotations.NotNull;
public class J {
public static String nullString() {
return null;
}
public static @NotNull String notNullString() {
return null;
}
}