Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/properties/lateinit/exceptionField.kt
T

21 lines
393 B
Kotlin

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
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()
}