[FIR] Desugar increment/decrement in body resolve phase
The expression needs to be resolved first to determine if there is a receiver that needs to be extracted to a temporary variable. Also, the special case for prefix increment/decrement on local variable without delegates requires resolution to check if the variable is local. ^KT-56771 Fixed ^KT-56659 Fixed
This commit is contained in:
committed by
Space Team
parent
5ecf9cce25
commit
3b9724d20e
+15
-12
@@ -54,18 +54,21 @@ fun test1(a: IntArray) {
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
val <receiver>: X1 = X1
|
||||
val <unary>: Int = <receiver>.<get-x1>()
|
||||
<receiver>.<set-x1>(<set-?> = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
val <receiver>: X2 = X2
|
||||
val <unary>: Int = <receiver>.<get-x2>()
|
||||
<receiver>.<set-x2>(<set-?> = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
val <receiver>: X3 = X3
|
||||
val <unary>: Int = <receiver>.<get-x3>()
|
||||
<receiver>.<set-x3>(<set-?> = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <unary>: Int = X1.<get-x1>()
|
||||
X1.<set-x1>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <unary>: Int = X2.<get-x2>()
|
||||
X2.<set-x2>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <unary>: Int = X3.<get-x3>()
|
||||
X3.<set-x3>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
}
|
||||
|
||||
class B {
|
||||
|
||||
Reference in New Issue
Block a user