Files
kotlin-fork/backend.native/tests/external/codegen/box/functions/coerceVoidToArray.kt
T
2017-03-13 15:31:46 +03:00

17 lines
220 B
Kotlin

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"
}