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

11 lines
317 B
Kotlin
Vendored

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