Files
kotlin-fork/compiler/testData/codegen/box/properties/lateinit/localClass.kt
T
2020-04-08 14:44:25 +03:00

15 lines
302 B
Kotlin
Vendored

// 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"
}
}