mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
26 lines
478 B
Kotlin
Vendored
26 lines
478 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// FILE: A.java
|
|
|
|
public class A {
|
|
public static void test() {
|
|
new B().foo(null);
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
class B {
|
|
fun foo(s: String) {}
|
|
}
|
|
|
|
fun box(): String {
|
|
try {
|
|
A.test()
|
|
return "Fail: NPE should have been thrown"
|
|
} catch (e: Throwable) {
|
|
if (e::class != NullPointerException::class) return "Fail: exception class should be NPE: ${e::class}"
|
|
return "OK"
|
|
}
|
|
}
|