Files
kotlin-fork/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt
T
2018-06-28 12:26:41 +02:00

17 lines
362 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
lateinit var str: String
try {
println(str)
return "Should throw an exception"
}
catch (e: UninitializedPropertyAccessException) {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class}"
}
}