mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
23 lines
493 B
Kotlin
Vendored
23 lines
493 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// FILE: A.java
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class A {
|
|
@NotNull
|
|
public static String foo() { return null; }
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
fun box(): String {
|
|
try {
|
|
val s: String = A.foo()
|
|
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"
|
|
}
|
|
}
|