mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
17 lines
220 B
Kotlin
Vendored
17 lines
220 B
Kotlin
Vendored
fun a(): IntArray? = null
|
|
|
|
fun b(): Nothing = throw Exception()
|
|
|
|
fun foo(): IntArray = a() ?: b()
|
|
|
|
|
|
fun box(): String {
|
|
try {
|
|
foo()
|
|
} catch (e: Exception) {
|
|
return "OK"
|
|
}
|
|
|
|
return "Fail"
|
|
}
|