Files
kotlin-fork/compiler/testData/codegen/box/arrays/longAsIndex.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

10 lines
269 B
Kotlin

fun IntArray.set(index: Long, elem: Int) { this[index.toInt()] = elem }
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"
}