Files
kotlin/compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexNoIndexOrElementVar.kt

15 lines
266 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
var count = 0
for ((_, _) in arr.withIndex()) {
count++
}
return if (count == 4) "OK" else "fail: '$count'"
}