Files
kotlin/compiler/testData/codegen/box/javaInterop/notNullAssertions/staticCallErrorMessage.kt
Dmitry Petrov 26782d7216 Fix exception message checking
Looks like there's no big difference between "J.s() must not be null"
and "s() must not be null".
2019-12-06 11:03:07 +03:00

21 lines
437 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" || e.message == "s() must not be null")
"OK"
else
"Fail: ${e.message}"
}
}
// FILE: J.java
public class J {
public static String s() { return null; }
}