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

23 lines
412 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
interface Intf {
val str: String
}
class A : Intf {
override lateinit var str: String
fun getMyStr(): String {
try {
val a = str
} catch (e: RuntimeException) {
return "OK"
}
return "FAIL"
}
}
fun box(): String {
val a = A()
return a.getMyStr()
}