Files
kotlin-fork/backend.native/tests/external/codegen/box/arrays/indices.kt
T
2017-03-13 15:31:46 +03:00

12 lines
225 B
Kotlin

// 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"
}