Files
kotlin-fork/compiler/testData/codegen/box/properties/lateinit/localClass.kt
T
2020-11-09 16:04:43 +03:00

17 lines
385 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
// WITH_RUNTIME
import kotlin.UninitializedPropertyAccessException
fun box(): String {
val o = object {
lateinit var x: Any
}
try {
if (o.x == null) return "fail 1"
return "fail 2"
} catch (t: UninitializedPropertyAccessException) {
return "OK"
}
}