Files
kotlin/compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrrayWithIndexNoIndexVar.kt
2018-06-09 19:15:38 +03:00

15 lines
283 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
val s = StringBuilder()
for ((_, x) in arr.withIndex()) {
s.append("$x;")
}
val ss = s.toString()
return if (ss == "a;b;c;d;") "OK" else "fail: '$ss'"
}