Files
kotlin-fork/compiler/testData/codegen/box/properties/lateinit/exceptionField.kt
T
Anton Bannykh 8e347f9f39 [JS IR BE] lateinit support
* Functions with IrExpressionBody are lowered to IrBlockBody
* Implemented throwUninitializedPropertyAccessException function
2018-09-21 18:20:11 +03:00

18 lines
289 B
Kotlin
Vendored

class A {
private lateinit var str: String
public fun getMyStr(): String {
try {
val a = str
} catch (e: RuntimeException) {
return "OK"
}
return "FAIL"
}
}
fun box(): String {
val a = A()
return a.getMyStr()
}