Files
kotlin/compiler/testData/codegen/box/controlStructures/kt772.kt
Juan Chen 3dc58bc995 [FIR2IR] Fix translating primitive array types
This commit fixes two issues in the existing implementation of translating primitive array types:

 * IrType.getArrayElementType throws an exception when the receiver is a primitive array type, because IR expects primitive array types use symbols defined in IrBuiltIns, but fir2ir translation doesn't;
 * IteratorNext.toCallable assumes all element types are boxed.

The first issue is fixed by changing the fir2ir type translation to use symbols in IrBuiltIns for primitive array types, and the second by not unboxing primitive types.
2019-12-27 15:32:18 +03:00

26 lines
419 B
Kotlin
Vendored

package demo2
fun print(o : Any?) {}
fun test(i : Int) {
var monthString : String? = "<empty>"
when (i) {
1 -> {
print(1)
print(2)
print(3)
print(4)
print(5)
}
else -> {
monthString = "Invalid month"
}
}
print(monthString)
}
fun box() : String {
for (i in 1..12) test(i)
return "OK"
}