Files
kotlin/compiler/testData/codegen/box/javaInterop/notNullAssertions/errorMessage.kt
Mikhail Zarechenskiy 5c5635ce20 Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
2020-01-20 16:36:03 +03:00

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