Files
kotlin/compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfObjectArrayWithIndex.kt
Dmitry Petrov 1eca402332 Use correctElementType to determine array element type for withIndex
Rather unkind "gotcha" in ASM API.

 #KT-23900 Fixed Target versions 1.2.50
2018-04-23 18:00:12 +03:00

12 lines
251 B
Kotlin
Vendored

// WITH_RUNTIME
fun box(): String {
val arr = Array(4) { arrayOf("x$it") }
var s = ""
for ((i, sarr) in arr.withIndex()) {
s += "$i:${sarr.toList()}"
}
return if (s != "0:[x0]1:[x1]2:[x2]3:[x3]") "Fail: '$s'" else "OK"
}