Files
kotlin-fork/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt.txt
T
2024-02-16 10:19:38 +00:00

119 lines
1.8 KiB
Kotlin
Vendored

class B {
var s: Int
field = s
get
set
constructor(s: Int = 0) /* primary */ {
super/*Any*/()
/* <init>() */
}
}
object Host {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
operator fun B.plusAssign(b: B) {
{ // BLOCK
val tmp_0: B = <this>
tmp_0.<set-s>(<set-?> = tmp_0.<get-s>().plus(other = b.<get-s>()))
}
}
}
object X1 {
var x1: Int
field = 0
get
set
object X2 {
var x2: Int
field = 0
get
set
object X3 {
var x3: Int
field = 0
get
set
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
fun test1(a: IntArray) {
var i: Int = 0
{ // BLOCK
val tmp_1: IntArray = a
val tmp_2: Int = { // BLOCK
val tmp_3: Int = i
i = tmp_3.inc()
tmp_3
}
val tmp_4: Int = tmp_1.get(index = tmp_2)
tmp_1.set(index = tmp_2, value = tmp_4.inc())
tmp_4
} /*~> Unit */
}
fun test2() {
{ // BLOCK
val tmp_5: X1 = X1
{ // BLOCK
val tmp_6: Int = tmp_5.<get-x1>()
tmp_5.<set-x1>(<set-?> = tmp_6.inc())
tmp_6
}
} /*~> Unit */
{ // BLOCK
val tmp_7: X2 = X2
{ // BLOCK
val tmp_8: Int = tmp_7.<get-x2>()
tmp_7.<set-x2>(<set-?> = tmp_8.inc())
tmp_8
}
} /*~> Unit */
{ // BLOCK
val tmp_9: X3 = X3
{ // BLOCK
val tmp_10: Int = tmp_9.<get-x3>()
tmp_9.<set-x3>(<set-?> = tmp_10.inc())
tmp_10
}
} /*~> Unit */
}
fun Host.test3(v: B) {
(<this>, v).plusAssign(b = B(s = 1000))
}