Files
kotlin-fork/compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt
T
2021-09-08 19:56:38 +03:00

19 lines
393 B
Kotlin
Vendored

// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: REFLECTION
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}"
}
}