Files
kotlin/compiler/testData/codegen/box/arrays/arrayGetAssignMultiIndex.kt
Alexander Udalov 20e36438e2 Move some tests from boxWithStdlib/ to box/
Move those tests which do not require neither stdlib nor reflect
2016-03-09 10:25:38 +03:00

12 lines
308 B
Kotlin
Vendored

operator fun Array<String>.get(index1: Int, index2: Int) = this[index1 + index2]
operator fun Array<String>.set(index1: Int, index2: Int, elem: String) {
this[index1 + index2] = elem
}
fun box(): String {
val s = Array<String>(1, { "" })
s[1, -1] = "O"
s[2, -2] += "K"
return s[-3, 3]
}