40 lines
793 B
Plaintext
Vendored
40 lines
793 B
Plaintext
Vendored
class A {
|
|
constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
operator fun A.get(vararg xs: Int): Int {
|
|
return 0
|
|
}
|
|
|
|
operator fun A.set(i: Int, j: Int, v: Int) {
|
|
}
|
|
|
|
fun testSimpleAssignment(a: A) {
|
|
a.set(i = 1, j = 2, v = 0)
|
|
}
|
|
|
|
fun testPostfixIncrement(a: A): Int {
|
|
return { // BLOCK
|
|
val <array>: A = a
|
|
val <index0>: Int = 1
|
|
val <index1>: Int = 2
|
|
val <unary>: Int = <array>.get(xs = [<index0>, <index1>])
|
|
<array>.set(i = <index0>, j = <index1>, v = <unary>.inc())
|
|
<unary>
|
|
}
|
|
}
|
|
|
|
fun testCompoundAssignment(a: A) {
|
|
{ // BLOCK
|
|
val <<array>>: A = a
|
|
val <<index_0>>: Int = 1
|
|
val <<index_1>>: Int = 2
|
|
<<array>>.set(i = <<index_0>>, j = <<index_1>>, v = <<array>>.get(xs = [<<index_0>>, <<index_1>>]).plus(other = 10))
|
|
}
|
|
}
|