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.
15 lines
360 B
Kotlin
Vendored
15 lines
360 B
Kotlin
Vendored
// NO_UNIFIED_NULL_CHECKS
|
|
// WITH_STDLIB
|
|
// TARGET_BACKEND: JVM
|
|
|
|
fun box(): String {
|
|
val s: String? = null
|
|
try {
|
|
s!!
|
|
return "Fail: KNPE should have been thrown"
|
|
} catch (e: Throwable) {
|
|
if (e::class != KotlinNullPointerException::class) return "Fail: exception class should be KNPE: ${e::class}"
|
|
return "OK"
|
|
}
|
|
}
|