mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
32 lines
539 B
Kotlin
Vendored
32 lines
539 B
Kotlin
Vendored
// !LANGUAGE: +StrictJavaNullabilityAssertions
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
|
|
// FILE: box.kt
|
|
fun box(): String {
|
|
try {
|
|
J().test()
|
|
return "Fail: should throw"
|
|
}
|
|
catch (e: Throwable) {
|
|
return "OK"
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
class C {
|
|
val withAssertion = J().nullString()
|
|
}
|
|
|
|
// FILE: J.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class J {
|
|
public @NotNull String nullString() {
|
|
return null;
|
|
}
|
|
|
|
public Object test() {
|
|
return new C();
|
|
}
|
|
} |