Files
kotlin/compiler/testData/codegen/box/javaInterop/notNullAssertions/staticCallErrorMessage.kt
2019-12-06 11:03:06 +03:00

21 lines
398 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FILE: test.kt
fun f(x: String) = "Fail 1"
fun box(): String {
return try {
f(J.s())
} catch (e: IllegalStateException) {
if (e.message == "J.s() must not be null")
"OK"
else
"Fail: ${e.message}"
}
}
// FILE: J.java
public class J {
public static String s() { return null; }
}