Files
kotlin/compiler/testData/codegen/box/functions/coerceVoidToArray.kt
Alexander Udalov ace7bd9bc8 Fix StackValue.coerce void to Object
We can only put Unit.VALUE on stack if we're requested an instance of Object or
Unit. In other cases (arbitrary objects / arrays) we put null instead
2013-04-22 17:59:32 +04:00

17 lines
211 B
Kotlin

fun a(): IntArray? = null
fun b() = throw Exception()
fun foo(): IntArray = a() ?: b()
fun box(): String {
try {
foo()
} catch (e: Exception) {
return "OK"
}
return "Fail"
}