mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
29 lines
499 B
Kotlin
Vendored
29 lines
499 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// STRICT_JAVA_NULLABILITY_ASSERTIONS
|
|
|
|
// FILE: box.kt
|
|
fun box(): String {
|
|
try {
|
|
J().test()
|
|
return "Fail: should throw"
|
|
}
|
|
catch (e: Throwable) {
|
|
return "OK"
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
val withAssertion get() = J().nullString()
|
|
|
|
// FILE: J.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class J {
|
|
public @NotNull String nullString() {
|
|
return null;
|
|
}
|
|
|
|
public void test() {
|
|
TestKt.getWithAssertion();
|
|
}
|
|
} |