Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt28456.fir.kt.txt
T
2022-06-01 00:11:17 +04:00

40 lines
781 B
Kotlin
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 <index_0>: Int = 1
val <index_1>: Int = 2
val <unary>: Int = <array>.get(xs = [<index_0>, <index_1>])
<array>.set(i = <index_0>, j = <index_1>, 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))
}
}