Files
kotlin-fork/compiler/testData/codegen/box/arrays/indices.kt
T
2018-06-09 19:15:38 +03:00

13 lines
250 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
val a = Array<Int>(5, {it})
val x = a.indices.iterator()
while (x.hasNext()) {
val i = x.next()
if (a[i] != i) return "Fail $i ${a[i]}"
}
return "OK"
}