Files
kotlin-fork/compiler/testData/codegen/box/functions/coerceVoidToArray.kt
T
2018-06-09 19:15:38 +03:00

18 lines
245 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
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"
}