Files
kotlin-fork/compiler/testData/codegen/box/arrays/longAsIndex.kt
T
2018-06-09 19:15:38 +03:00

11 lines
312 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
operator fun IntArray.set(index: Long, elem: Int) { this[index.toInt()] = elem }
operator fun IntArray.get(index: Long) = this[index.toInt()]
fun box(): String {
var l = IntArray(1)
l[0.toLong()] = 4
l[0.toLong()] += 6
return if (l[0.toLong()] == 10) "OK" else "Fail"
}