mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
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).
11 lines
197 B
Kotlin
Vendored
11 lines
197 B
Kotlin
Vendored
fun box(): String {
|
|
val a = ByteArray(5)
|
|
val x = a.iterator()
|
|
var i = 0
|
|
while (x.hasNext()) {
|
|
if (a[i] != x.nextByte()) return "Fail $i"
|
|
i++
|
|
}
|
|
return "OK"
|
|
}
|