c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
36 lines
756 B
Kotlin
Vendored
36 lines
756 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// WITH_STDLIB
|
|
// FILE: kt18911.kt
|
|
fun testNullString() {
|
|
try {
|
|
val t1 = J.nullString()::capitalize
|
|
throw Exception("'J.nullString()::capitalize' should throw")
|
|
} catch (e: NullPointerException) {}
|
|
}
|
|
|
|
fun testNotNullString() {
|
|
try {
|
|
val t1 = J.notNullString()::capitalize
|
|
throw Exception("'J.notNullString()::capitalize' should throw")
|
|
} catch (e: NullPointerException) {}
|
|
}
|
|
|
|
fun box(): String {
|
|
testNullString()
|
|
testNotNullString()
|
|
return "OK"
|
|
}
|
|
|
|
// FILE: J.java
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class J {
|
|
public static String nullString() {
|
|
return null;
|
|
}
|
|
|
|
public static @NotNull String notNullString() {
|
|
return null;
|
|
}
|
|
}
|