Files
kotlin-fork/compiler/testData/codegen/box/arrays/indices.kt
T
2019-11-19 11:00:09 +03:00

14 lines
280 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// 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"
}