[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
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
|
||||
public var inc: Int = 0
|
||||
|
||||
public var propInc: Int = 0
|
||||
@@ -26,4 +29,4 @@ fun box(): String {
|
||||
if (propDec != -1) return "fail in prefix decrement: ${propDec} != -1"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
// IGNORE_BACKEND: WASM
|
||||
// SKIP_NODE_JS
|
||||
|
||||
public var inc: Int = 0
|
||||
|
||||
public var propInc: Int = 0
|
||||
get() {++inc; return field}
|
||||
set(a: Int) {
|
||||
++inc
|
||||
field = a
|
||||
}
|
||||
|
||||
public var dec: Int = 0
|
||||
|
||||
public var propDec: Int = 0
|
||||
get() { --dec; return field}
|
||||
set(a: Int) {
|
||||
--dec
|
||||
field = a
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
++propInc
|
||||
if (inc != 2) return "fail in prefix increment: ${inc} != 2"
|
||||
if (propInc != 1) return "fail in prefix increment: ${propInc} != 1"
|
||||
|
||||
--propDec
|
||||
if (dec != -2) return "fail in prefix decrement: ${dec} != -2"
|
||||
if (propDec != -1) return "fail in prefix decrement: ${propDec} != -1"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
private var r: Int = 1;
|
||||
@@ -70,4 +73,4 @@ fun box() : String {
|
||||
if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4getR4") return "fail 4: $p4 ${A.holder}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
// IGNORE_BACKEND: WASM
|
||||
// SKIP_NODE_JS
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
private var r: Int = 1;
|
||||
|
||||
fun test(): Int {
|
||||
r++
|
||||
++r
|
||||
return r
|
||||
}
|
||||
|
||||
var holder: String = ""
|
||||
|
||||
var r2: Int = 1
|
||||
get() {
|
||||
holder += "getR2"
|
||||
return field
|
||||
}
|
||||
|
||||
fun test2() : Int {
|
||||
r2++
|
||||
++r2
|
||||
return r2
|
||||
}
|
||||
|
||||
var r3: Int = 1
|
||||
set(p: Int) {
|
||||
holder += "setR3"
|
||||
field = p
|
||||
}
|
||||
|
||||
fun test3() : Int {
|
||||
r3++
|
||||
++r3
|
||||
return r3
|
||||
}
|
||||
|
||||
var r4: Int = 1
|
||||
get() {
|
||||
holder += "getR4"
|
||||
return field
|
||||
}
|
||||
set(p: Int) {
|
||||
holder += "setR4"
|
||||
field = p
|
||||
}
|
||||
|
||||
fun test4() : Int {
|
||||
r4++
|
||||
holder += ":"
|
||||
++r4
|
||||
return r4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val p = A.test()
|
||||
if (p != 3) return "fail 1: $p"
|
||||
|
||||
val p2 = A.test2()
|
||||
var holderValue = A.holder
|
||||
if (p2 != 3 || holderValue != "getR2getR2getR2") return "fail 2: $p2 ${holderValue}"
|
||||
|
||||
A.holder = ""
|
||||
val p3 = A.test3()
|
||||
if (p3 != 3 || A.holder != "setR3setR3") return "fail 3: $p3 ${A.holder}"
|
||||
|
||||
A.holder = ""
|
||||
val p4 = A.test4()
|
||||
if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4") return "fail 4: $p4 ${A.holder}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+4
-1
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
|
||||
object A {
|
||||
private var r: Int = 1;
|
||||
|
||||
@@ -68,4 +71,4 @@ fun box() : String {
|
||||
if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4getR4") return "fail 4: $p4 ${A.holder}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// Behavior changed in K2, see KT-42077
|
||||
// IGNORE_BACKEND: WASM
|
||||
// SKIP_NODE_JS
|
||||
|
||||
object A {
|
||||
private var r: Int = 1;
|
||||
|
||||
fun test() : Int {
|
||||
r++
|
||||
++r
|
||||
return r
|
||||
}
|
||||
|
||||
var holder: String = ""
|
||||
|
||||
var r2: Int = 1
|
||||
get() {
|
||||
holder += "getR2"
|
||||
return field
|
||||
}
|
||||
|
||||
fun test2() : Int {
|
||||
r2++
|
||||
++r2
|
||||
return r2
|
||||
}
|
||||
|
||||
var r3: Int = 1
|
||||
set(p: Int) {
|
||||
holder += "setR3"
|
||||
field = p
|
||||
}
|
||||
|
||||
fun test3() : Int {
|
||||
r3++
|
||||
++r3
|
||||
return r3
|
||||
}
|
||||
|
||||
var r4: Int = 1
|
||||
get() {
|
||||
holder += "getR4"
|
||||
return field
|
||||
}
|
||||
set(p: Int) {
|
||||
holder += "setR4"
|
||||
field = p
|
||||
}
|
||||
|
||||
fun test4() : Int {
|
||||
r4++
|
||||
holder += ":"
|
||||
++r4
|
||||
return r4
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val p = A.test()
|
||||
if (p != 3) return "fail 1: $p"
|
||||
|
||||
val p2 = A.test2()
|
||||
val holderValue = A.holder
|
||||
if (p2 != 3 || holderValue != "getR2getR2getR2") return "fail 2: $p2 ${holderValue}"
|
||||
|
||||
A.holder = ""
|
||||
val p3 = A.test3()
|
||||
if (p3 != 3 || A.holder != "setR3setR3") return "fail 3: $p3 ${A.holder}"
|
||||
|
||||
A.holder = ""
|
||||
val p4 = A.test4()
|
||||
if (p4 != 3 || A.holder != "getR4setR4:getR4setR4getR4") return "fail 4: $p4 ${A.holder}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+4
-4
@@ -22,9 +22,9 @@ class WrongIncDec() {
|
||||
|
||||
fun testWrongIncDec() {
|
||||
var x = WrongIncDec()
|
||||
<!RESULT_TYPE_MISMATCH!>x++<!>
|
||||
x<!RESULT_TYPE_MISMATCH!>++<!>
|
||||
<!RESULT_TYPE_MISMATCH!>++x<!>
|
||||
<!RESULT_TYPE_MISMATCH!>x--<!>
|
||||
x<!RESULT_TYPE_MISMATCH!>--<!>
|
||||
<!RESULT_TYPE_MISMATCH!>--x<!>
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ fun testUnitIncDec() {
|
||||
<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
x = x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>
|
||||
x = x<!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>x
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT, INC_DEC_SHOULD_NOT_RETURN_UNIT!>++<!>x
|
||||
x = <!INC_DEC_SHOULD_NOT_RETURN_UNIT, INC_DEC_SHOULD_NOT_RETURN_UNIT!>--<!>x
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class Test() {
|
||||
|
||||
fun testIncompleteSyntax() {
|
||||
val s = "s"
|
||||
<!UNRESOLVED_REFERENCE!>++<!>s.<!SYNTAX!><!>
|
||||
<!UNRESOLVED_REFERENCE!>++<!><!VARIABLE_EXPECTED!>s<!>.<!SYNTAX!><!>
|
||||
}
|
||||
|
||||
fun testVariables() {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// SKIP_TXT
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package foo.bar
|
||||
|
||||
var baz = 1
|
||||
|
||||
fun test() {
|
||||
foo.bar.baz++
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// SKIP_TXT
|
||||
// ISSUE: KT-56659
|
||||
|
||||
object AAA { operator fun inc(): AAA = this }
|
||||
|
||||
fun test1() {
|
||||
<!VARIABLE_EXPECTED!>AAA<!>++
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
++<!VARIABLE_EXPECTED!>AAA<!>
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
var x = AAA
|
||||
x = <!VARIABLE_EXPECTED!>AAA<!>++
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
var x = AAA
|
||||
x = ++<!VARIABLE_EXPECTED!>AAA<!>
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// SKIP_TXT
|
||||
// ISSUE: KT-56659
|
||||
|
||||
object AAA { operator fun inc(): AAA = this }
|
||||
|
||||
fun test1() {
|
||||
<!VAL_REASSIGNMENT!>AAA<!>++
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
++<!VAL_REASSIGNMENT!>AAA<!>
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>x<!> = AAA
|
||||
x = <!VAL_REASSIGNMENT!>AAA<!>++
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>x<!> = AAA
|
||||
x = ++<!VAL_REASSIGNMENT!>AAA<!>
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
// !LANGUAGE: +ForbidExtensionCallsOnInlineFunctionalParameters
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -VAL_REASSIGNMENT -UNUSED_CHANGED_VALUE -VARIABLE_EXPECTED
|
||||
|
||||
inline operator fun <T, V> Function1<T, V>.unaryPlus() = this
|
||||
operator fun <T, V> Function1<T, V>.unaryMinus() = this
|
||||
inline operator fun <T, V> Function1<T, V>.inc() = this
|
||||
operator fun <T, V> Function1<T, V>.dec() = this
|
||||
|
||||
inline operator fun <T, V> @ExtensionFunctionType Function2<T, T, V>.unaryPlus(){}
|
||||
operator fun <T, V> @ExtensionFunctionType Function2<T, T, V>.unaryMinus(){}
|
||||
inline operator fun <T, V> @ExtensionFunctionType Function2<T, T, V>.inc() = this
|
||||
operator fun <T, V> @ExtensionFunctionType Function2<T, T, V>.dec() = this
|
||||
|
||||
inline fun <T, V> inlineFunWithInvoke(s: (p: T) -> V, ext: T.(p: T) -> V) {
|
||||
+<!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
-<!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
<!USAGE_IS_NOT_INLINABLE!>s<!>++
|
||||
<!USAGE_IS_NOT_INLINABLE!>++<!><!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
<!USAGE_IS_NOT_INLINABLE!>s<!>--
|
||||
<!USAGE_IS_NOT_INLINABLE!>--<!><!USAGE_IS_NOT_INLINABLE!>s<!>
|
||||
+<!USAGE_IS_NOT_INLINABLE!>ext<!>
|
||||
-<!USAGE_IS_NOT_INLINABLE!>ext<!>
|
||||
<!USAGE_IS_NOT_INLINABLE!>ext<!>++
|
||||
<!USAGE_IS_NOT_INLINABLE!>++<!><!USAGE_IS_NOT_INLINABLE!>ext<!>
|
||||
<!USAGE_IS_NOT_INLINABLE!>ext<!>--
|
||||
<!USAGE_IS_NOT_INLINABLE!>--<!><!USAGE_IS_NOT_INLINABLE!>ext<!>
|
||||
}
|
||||
|
||||
inline fun <T, V> Function1<T, V>.inlineFunWithInvoke() {
|
||||
+this
|
||||
-this
|
||||
this++
|
||||
++this
|
||||
this--
|
||||
--this
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ForbidExtensionCallsOnInlineFunctionalParameters
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -VAL_REASSIGNMENT -UNUSED_CHANGED_VALUE -VARIABLE_EXPECTED
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ open class A {
|
||||
fun foo() {
|
||||
<!UNRESOLVED_REFERENCE!>topLevelFun<!>()
|
||||
<!UNRESOLVED_REFERENCE!>topLevelFun<!>(1)
|
||||
<!UNRESOLVED_REFERENCE!>topLevelProperty<!><!UNRESOLVED_REFERENCE!>++<!>
|
||||
<!UNRESOLVED_REFERENCE!>topLevelProperty<!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>++<!>
|
||||
"".<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
|
||||
1.<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
|
||||
"".<!UNRESOLVED_REFERENCE!>topLevelExtensionProperty<!>
|
||||
|
||||
Vendored
+12
-6
@@ -30,16 +30,22 @@ FILE: unsafeAssignmentExtra.fir.kt
|
||||
lval value: R|Foo<kotlin/Int>| = R|/myBuilder|<R|kotlin/Int|>(<L> = myBuilder@fun R|Foo<kotlin/Int>|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.b: R|kotlin/Array<Stub (chain inference): TypeVariable(T)>|>|.R|SubstitutionOverride<kotlin/Array.set: R|kotlin/Unit|>|(Int(0), Int(123))
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = Int(45)
|
||||
lval <unary>: R|kotlin/Int| = this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = R|<local>/<unary>|.<Ambiguity: inc, [kotlin/inc, kotlin/inc]>#()
|
||||
R|<local>/<unary>|
|
||||
{
|
||||
lval <unary>: R|kotlin/Int| = this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = R|<local>/<unary>|.<Ambiguity: inc, [kotlin/inc, kotlin/inc]>#()
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
|
||||
R|/bar|(::R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|)
|
||||
when () {
|
||||
(this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| is R|kotlin/Int|) -> {
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = Int(67)
|
||||
lval <unary>: R|kotlin/Int| = this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = R|<local>/<unary>|.<Ambiguity: dec, [kotlin/dec, kotlin/dec]>#()
|
||||
R|<local>/<unary>|
|
||||
{
|
||||
lval <unary>: R|kotlin/Int| = this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>| = R|<local>/<unary>|.<Ambiguity: dec, [kotlin/dec, kotlin/dec]>#()
|
||||
R|<local>/<unary>|
|
||||
}
|
||||
|
||||
R|/bar|(::R|SubstitutionOverride</Foo.a: R|Stub (chain inference): TypeVariable(T)|>|)
|
||||
}
|
||||
}
|
||||
|
||||
+24
-21
@@ -185,22 +185,24 @@ FILE fqName:<root> fileName:/unaryOperators.kt
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:<root>.Result
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
BLOCK type=<root>.Result origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
BLOCK type=<root>.Result origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun unaryMinus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
@@ -209,14 +211,15 @@ FILE fqName:<root> fileName:/unaryOperators.kt
|
||||
CALL 'public final fun unaryPlus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun dec (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Result declared in <root>.box'
|
||||
GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
BLOCK type=<root>.Result origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun dec (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
|
||||
+15
-9
@@ -72,17 +72,23 @@ operator fun Result.dec(_context_receiver_0: Int): Result {
|
||||
fun box(): String {
|
||||
var result: Result = Result(i = 0)
|
||||
with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary> /*~> Unit */
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary> /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
result.unaryMinus(_context_receiver_0 = $this$with) /*~> Unit */
|
||||
result.unaryPlus(_context_receiver_0 = $this$with) /*~> Unit */
|
||||
val <unary>: Result = result
|
||||
result = <unary>.dec(_context_receiver_0 = $this$with)
|
||||
return <unary>
|
||||
return { // BLOCK
|
||||
val <unary>: Result = result
|
||||
result = <unary>.dec(_context_receiver_0 = $this$with)
|
||||
<unary>
|
||||
}
|
||||
}
|
||||
) /*~> Unit */
|
||||
return when {
|
||||
|
||||
+6
-5
@@ -104,16 +104,17 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
|
||||
WHILE label=Outer origin=WHILE_LOOP
|
||||
condition: CONST Boolean type=kotlin.Boolean value=true
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
SET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
SET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
VAR name:j type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=Inner origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=null
|
||||
SET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
|
||||
|
||||
+8
-6
@@ -65,14 +65,16 @@ fun test4(ss: List<String>?) {
|
||||
fun test5() {
|
||||
var i: Int = 0
|
||||
Outer@ while (true) { // BLOCK
|
||||
i = i.inc()
|
||||
i /*~> Unit */
|
||||
{ // BLOCK
|
||||
i = i.inc()
|
||||
i
|
||||
} /*~> Unit */
|
||||
var j: Int = 0
|
||||
{ // BLOCK
|
||||
Inner@ do// COMPOSITE {
|
||||
j = j.inc()
|
||||
j
|
||||
// } while (when {
|
||||
Inner@ do{ // BLOCK
|
||||
j = j.inc()
|
||||
j
|
||||
} while (when {
|
||||
greaterOrEqual(arg0 = j, arg1 = 3) -> false
|
||||
else -> break@Inner
|
||||
})
|
||||
|
||||
@@ -111,11 +111,12 @@ FILE fqName:<root> fileName:/breakContinueInWhen.kt
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
|
||||
@@ -60,8 +60,10 @@ fun testContinueDoWhile() {
|
||||
var s: String = ""
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
k = k.inc()
|
||||
k /*~> Unit */
|
||||
{ // BLOCK
|
||||
k = k.inc()
|
||||
k
|
||||
} /*~> Unit */
|
||||
when {
|
||||
greater(arg0 = k, arg1 = 2) -> continue
|
||||
}
|
||||
|
||||
+27
-30
@@ -141,39 +141,36 @@ FILE fqName:<root> fileName:/complexAugmentedAssignment.kt
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
|
||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:<root>.X1 [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x1> (): kotlin.Int declared in <root>.X1' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_4: <root>.X1 [val] declared in <root>.test2' type=<root>.X1 origin=null
|
||||
CALL 'public final fun <set-x1> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_4: <root>.X1 [val] declared in <root>.test2' type=<root>.X1 origin=null
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:<root>.X1.X2 [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x2> (): kotlin.Int declared in <root>.X1.X2' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_6: <root>.X1.X2 [val] declared in <root>.test2' type=<root>.X1.X2 origin=null
|
||||
CALL 'public final fun <set-x2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1.X2' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_6: <root>.X1.X2 [val] declared in <root>.test2' type=<root>.X1.X2 origin=null
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_7: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x1> (): kotlin.Int declared in <root>.X1' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1
|
||||
CALL 'public final fun <set-x1> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1' type=kotlin.Unit origin=EQ
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_7: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:<root>.X1.X2.X3 [val]
|
||||
GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2.X3
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x3> (): kotlin.Int declared in <root>.X1.X2.X3' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_8: <root>.X1.X2.X3 [val] declared in <root>.test2' type=<root>.X1.X2.X3 origin=null
|
||||
CALL 'public final fun <set-x3> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1.X2.X3' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_8: <root>.X1.X2.X3 [val] declared in <root>.test2' type=<root>.X1.X2.X3 origin=null
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_9: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x2> (): kotlin.Int declared in <root>.X1.X2' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2
|
||||
CALL 'public final fun <set-x2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1.X2' type=kotlin.Unit origin=EQ
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_9: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-x3> (): kotlin.Int declared in <root>.X1.X2.X3' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2.X3
|
||||
CALL 'public final fun <set-x3> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.X1.X2.X3' type=kotlin.Unit origin=EQ
|
||||
$this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.X1.X2.X3
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_6: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_6: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
|
||||
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:<root>.B [primary]
|
||||
|
||||
+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 {
|
||||
|
||||
@@ -67,58 +67,48 @@ FILE fqName:<root> fileName:/incrementDecrement.kt
|
||||
BLOCK_BODY
|
||||
VAR name:p1 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPropPrefix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPropPrefix' type=kotlin.Int origin=null
|
||||
VAR name:p2 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.testPropPrefix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.testPropPrefix' type=kotlin.Int origin=null
|
||||
FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:p1 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
VAR name:p2 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
CALL 'public final fun <set-p> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.testPropPostfix' type=kotlin.Int origin=null
|
||||
FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:a1 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.IntArray [val]
|
||||
CALL 'public final fun <get-arr> (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=GET_PROPERTY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.IntArray [val] declared in <root>.testArrayPrefix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.IntArray [val] declared in <root>.testArrayPrefix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_4: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
value: GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_5: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
VAR name:a2 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.IntArray [val]
|
||||
CALL 'public final fun <get-arr> (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=GET_PROPERTY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val]
|
||||
CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_6: kotlin.IntArray [val] declared in <root>.testArrayPrefix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
@@ -127,25 +117,25 @@ FILE fqName:<root> fileName:/incrementDecrement.kt
|
||||
index: GET_VAR 'val tmp_7: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
value: GET_VAR 'val tmp_8: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_8: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:a1 type:kotlin.Int [val]
|
||||
VAR name:a2 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.IntArray [val]
|
||||
CALL 'public final fun <get-arr> (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=GET_PROPERTY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Int [val]
|
||||
CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in <root>.testArrayPostfix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in <root>.testArrayPrefix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
|
||||
$this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in <root>.testArrayPostfix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_11: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_11: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
VAR name:a2 type:kotlin.Int [val]
|
||||
$this: GET_VAR 'val tmp_9: kotlin.IntArray [val] declared in <root>.testArrayPrefix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_10: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
value: GET_VAR 'val tmp_11: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_11: kotlin.Int [val] declared in <root>.testArrayPrefix' type=kotlin.Int origin=null
|
||||
FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:a1 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.IntArray [val]
|
||||
CALL 'public final fun <get-arr> (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=GET_PROPERTY
|
||||
@@ -158,6 +148,22 @@ FILE fqName:<root> fileName:/incrementDecrement.kt
|
||||
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
|
||||
$this: GET_VAR 'val tmp_12: kotlin.IntArray [val] declared in <root>.testArrayPostfix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_13: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_14: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_14: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
VAR name:a2 type:kotlin.Int [val]
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.IntArray [val]
|
||||
CALL 'public final fun <get-arr> (): kotlin.IntArray declared in <root>' type=kotlin.IntArray origin=GET_PROPERTY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:kotlin.Int [val]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlin.Int [val]
|
||||
CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in kotlin.IntArray' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_15: kotlin.IntArray [val] declared in <root>.testArrayPostfix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_16: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null
|
||||
$this: GET_VAR 'val tmp_15: kotlin.IntArray [val] declared in <root>.testArrayPostfix' type=kotlin.IntArray origin=null
|
||||
index: GET_VAR 'val tmp_16: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_17: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_17: kotlin.Int [val] declared in <root>.testArrayPostfix' type=kotlin.Int origin=null
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -9,17 +9,18 @@ FILE fqName:<root> fileName:/javaSyntheticGenericPropertyAccess.kt
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
x: CONST Int type=kotlin.Int value=1
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.J<F of <root>.test> [val]
|
||||
GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public open fun getFoo (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_0: <root>.J<F of <root>.test> [val] declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_0: <root>.J<F of <root>.test> [val] declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
x: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.J<F of <root>.test> [val]
|
||||
GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public open fun getFoo (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_0: <root>.J<F of <root>.test> [val] declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_0: <root>.J<F of <root>.test> [val] declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
x: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'j: <root>.J<F of <root>.test> declared in <root>.test' type=<root>.J<F of <root>.test> origin=null
|
||||
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
|
||||
+6
-4
@@ -1,9 +1,11 @@
|
||||
fun <F : Any?> test(j: J<F>) {
|
||||
j.getFoo() /*~> Unit */
|
||||
j.setFoo(x = 1)
|
||||
val <receiver>: J<F> = j
|
||||
val <unary>: Int = <receiver>.getFoo()
|
||||
<receiver>.setFoo(x = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <receiver>: J<F> = j
|
||||
val <unary>: Int = <receiver>.getFoo()
|
||||
<receiver>.setFoo(x = <unary>.inc())
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
j.setFoo(x = j.getFoo().plus(other = 1))
|
||||
}
|
||||
|
||||
+11
-10
@@ -8,17 +8,18 @@ FILE fqName:<root> fileName:/javaSyntheticPropertyAccess.kt
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||
x: CONST Int type=kotlin.Int value=1
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.J [val]
|
||||
GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public open fun getFoo (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_0: <root>.J [val] declared in <root>.test' type=<root>.J origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_0: <root>.J [val] declared in <root>.test' type=<root>.J origin=null
|
||||
x: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.J [val]
|
||||
GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public open fun getFoo (): kotlin.Int declared in <root>.J' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_0: <root>.J [val] declared in <root>.test' type=<root>.J origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_0: <root>.J [val] declared in <root>.test' type=<root>.J origin=null
|
||||
x: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
|
||||
CALL 'public open fun setFoo (x: kotlin.Int): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'j: <root>.J declared in <root>.test' type=<root>.J origin=null
|
||||
x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
|
||||
+6
-4
@@ -1,9 +1,11 @@
|
||||
fun test(j: J) {
|
||||
j.getFoo() /*~> Unit */
|
||||
j.setFoo(x = 1)
|
||||
val <receiver>: J = j
|
||||
val <unary>: Int = <receiver>.getFoo()
|
||||
<receiver>.setFoo(x = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
{ // BLOCK
|
||||
val <receiver>: J = j
|
||||
val <unary>: Int = <receiver>.getFoo()
|
||||
<receiver>.setFoo(x = <unary>.inc())
|
||||
<unary>
|
||||
} /*~> Unit */
|
||||
j.setFoo(x = j.getFoo().plus(other = 1))
|
||||
}
|
||||
|
||||
+17
-19
@@ -74,44 +74,42 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:test.C [val]
|
||||
GET_VAR 'val tmp_1: test.C? [val] declared in test.testProperty' type=test.C? origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY
|
||||
$receiver: GET_VAR 'val tmp_2: test.C [val] declared in test.testProperty' type=test.C origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: test.C? [val] declared in test.testProperty' type=test.C? origin=null
|
||||
CALL 'public final fun <set-p> (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ
|
||||
$receiver: GET_VAR 'val tmp_2: test.C [val] declared in test.testProperty' type=test.C origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: test.C? [val] declared in test.testProperty' type=test.C? origin=null
|
||||
value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in test.testProperty' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in test.testProperty' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in test.testProperty' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_2: kotlin.Int [val] declared in test.testProperty' type=kotlin.Int origin=null
|
||||
FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:nc index:0 type:test.C?
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
BLOCK type=kotlin.Int? origin=SAFE_CALL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:test.C? [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val]
|
||||
GET_VAR 'nc: test.C? declared in test.testArrayAccess' type=test.C? origin=null
|
||||
WHEN type=kotlin.Int? origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'val tmp_4: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
|
||||
arg0: GET_VAR 'val tmp_3: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Null type=kotlin.Nothing? value=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-p> (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY
|
||||
$receiver: GET_VAR 'val tmp_4: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val]
|
||||
$receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val]
|
||||
CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in test' type=kotlin.Int origin=null
|
||||
$receiver: GET_VAR 'val tmp_5: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
index: GET_VAR 'val tmp_6: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
$receiver: GET_VAR 'val tmp_4: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in test' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val tmp_5: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
index: GET_VAR 'val tmp_6: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
$receiver: GET_VAR 'val tmp_4: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
index: GET_VAR 'val tmp_5: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_7: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_7: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_6: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_6: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null
|
||||
|
||||
+2
-3
@@ -39,9 +39,8 @@ fun testProperty(nc: C?) {
|
||||
when {
|
||||
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
|
||||
else -> { // BLOCK
|
||||
val <receiver>: C = tmp1_safe_receiver
|
||||
val <unary>: Int = <receiver>.<get-p>()
|
||||
<receiver>.<set-p>(value = <unary>.inc())
|
||||
val <unary>: Int = tmp1_safe_receiver.<get-p>()
|
||||
tmp1_safe_receiver.<set-p>(value = <unary>.inc())
|
||||
<unary>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ FILE fqName:<root> fileName:/whileDoWhile.kt
|
||||
arg1: CONST Int type=kotlin.Int value=15
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
GET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Int origin=null
|
||||
SET_VAR 'var x: kotlin.Int [var] declared in <root>.test' type=kotlin.Unit origin=POSTFIX_INCR
|
||||
|
||||
@@ -24,11 +24,11 @@ fun test() {
|
||||
} while (less(arg0 = x, arg1 = 15))
|
||||
}
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
// } while (less(arg0 = x, arg1 = 20))
|
||||
do{ // BLOCK
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
} while (less(arg0 = x, arg1 = 20))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -543,7 +543,7 @@ FILE fqName:<root> fileName:/ArrayMap.kt
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
|
||||
|
||||
@@ -224,11 +224,11 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
|
||||
|
||||
protected override fun computeNext() {
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
// } while (when {
|
||||
do{ // BLOCK
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
} while (when {
|
||||
less(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> EQEQ(arg0 = <this>.<get-data>().get(index = <this>.<get-index>()), arg1 = null)
|
||||
else -> false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user