16 lines
223 B
Kotlin
Vendored
16 lines
223 B
Kotlin
Vendored
// IGNORE_BACKEND: JS_IR
|
|
fun isZero(x: Int) = when(x) {
|
|
0 -> true
|
|
else -> throw Exception()
|
|
}
|
|
|
|
fun box(): String {
|
|
try {
|
|
isZero(1)
|
|
}
|
|
catch (e: Exception) {
|
|
return "OK"
|
|
}
|
|
return "Fail"
|
|
}
|