93696ff9bd
This is not something that needs to be intrinsified. Note that compiler optimizations are still possible and the fact whether 'indices' is a member or an extension is irrelevant to the optimizer
10 lines
208 B
Kotlin
Vendored
10 lines
208 B
Kotlin
Vendored
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"
|
|
}
|