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

13 lines
279 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
fun box(): String {
try {
throw Throwable("OK", null)
} catch (t: Throwable) {
if (t.cause != null) return "fail 1"
return t.message!!
}
return "fail 2"
}