Files
kotlin/compiler/testData/codegen/box/arrays/iteratorLongArrayNextLong.kt
Anton Bannykh 9b34e21619 JS: fixed <Type>Array.iterator methods; added -Xtypedarray compiler key
The <Type>Array.iterator used to lack next<Type>() method (KT-16626).

The -Xtypedarray compiler key enables translation of primitive arrays
to TypedArrays, and primitive array`is`-checks (KT-15358, KT-14007,
KT-14614, KT-16056).
2017-03-27 23:09:34 +03:00

11 lines
197 B
Kotlin
Vendored

fun box(): String {
val a = LongArray(5)
val x = a.iterator()
var i = 0
while (x.hasNext()) {
if (a[i] != x.nextLong()) return "Fail $i"
i++
}
return "OK"
}