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

15 lines
429 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) =
fn(
try {
try {
zap(string)
}
catch (e: Exception) { "" }
} catch (e: Exception) { "" }
)
fun box(): String = tryZap("OK") { it }