Files
kotlin-fork/compiler/testData/codegen/box/arrays/indices.kt
T

13 lines
250 B
Kotlin
Vendored

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