[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:
Kirill Rakhman
2023-02-21 16:24:34 +01:00
committed by Space Team
parent 5ecf9cce25
commit 3b9724d20e
77 changed files with 1171 additions and 553 deletions
@@ -35,12 +35,14 @@ fun testVarPostfix() {
fun testPropPrefix() {
val p1: Int = { // BLOCK
<set-p>(<set-?> = <get-p>().inc())
<get-p>()
val <unary-result>: Int = <get-p>().inc()
<set-p>(<set-?> = <unary-result>)
<unary-result>
}
val p2: Int = { // BLOCK
<set-p>(<set-?> = <get-p>().dec())
<get-p>()
val <unary-result>: Int = <get-p>().dec()
<set-p>(<set-?> = <unary-result>)
<unary-result>
}
}
@@ -51,8 +53,9 @@ fun testPropPostfix() {
<unary>
}
val p2: Int = { // BLOCK
<set-p>(<set-?> = <get-p>().dec())
<get-p>()
val <unary-result>: Int = <get-p>().dec()
<set-p>(<set-?> = <unary-result>)
<unary-result>
}
}