diff --git a/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt b/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt index d38673fe968..8cc65436d7c 100644 --- a/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt +++ b/compiler/fir/lightTree/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt @@ -828,14 +828,11 @@ class ExpressionsConverter( return buildBlock { source = forLoop.toFirSourceElement() - val rangeVal = - generateTemporaryVariable(this@ExpressionsConverter.baseSession, null, Name.special(""), rangeExpression) - statements += rangeVal val iteratorVal = generateTemporaryVariable( this@ExpressionsConverter.baseSession, null, Name.special(""), buildFunctionCall { calleeReference = buildSimpleNamedReference { name = Name.identifier("iterator") } - explicitReceiver = generateResolvedAccessExpression(null, rangeVal) + explicitReceiver = rangeExpression } ) statements += iteratorVal diff --git a/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index 97200085a18..d96fa4fda5a 100644 --- a/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -1243,15 +1243,12 @@ class RawFirBuilder(session: FirSession, val baseScopeProvider: FirScopeProvider } override fun visitForExpression(expression: KtForExpression, data: Unit?): FirElement { - val ktRangeExpression = expression.loopRange.toFirExpression("No range in for loop") + val rangeExpression = expression.loopRange.toFirExpression("No range in for loop") val ktParameter = expression.loopParameter val loopSource = expression.toFirSourceElement() return buildBlock { source = loopSource val rangeSource = expression.loopRange?.toFirSourceElement() - val rangeVal = - generateTemporaryVariable(baseSession, rangeSource, Name.special(""), ktRangeExpression) - statements += rangeVal val iteratorVal = generateTemporaryVariable( baseSession, rangeSource, Name.special(""), buildFunctionCall { @@ -1260,7 +1257,7 @@ class RawFirBuilder(session: FirSession, val baseScopeProvider: FirScopeProvider source = loopSource name = Name.identifier("iterator") } - explicitReceiver = generateResolvedAccessExpression(rangeSource, rangeVal) + explicitReceiver = rangeExpression }, ) statements += iteratorVal diff --git a/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.kt b/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.kt index a9505c4fe76..f9db77b0dd2 100644 --- a/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.kt +++ b/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.kt @@ -4,6 +4,15 @@ fun foo() { } } +fun fooLabeled() { + println("!!!") + label@ for (i in 1..10) { + if (i == 5) continue@label + println(i) + } + println("!!!") +} + fun bar(list: List) { for (element in list.subList(0, 10)) { println(element) diff --git a/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.txt b/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.txt index d943b736bc8..ec7ef778478 100644 --- a/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.txt +++ b/compiler/fir/psi2fir/testData/rawBuilder/expressions/for.txt @@ -1,23 +1,36 @@ FILE: for.kt public? final? fun foo(): R|kotlin/Unit| { - lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(10)) - lval : = R|/|.iterator#() + lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(10)).iterator#() while(R|/|.hasNext#()) { lval i: = R|/|.next#() println#(i#) } } + public? final? fun fooLabeled(): R|kotlin/Unit| { + println#(String(!!!)) + lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(10)).iterator#() + label@while(R|/|.hasNext#()) { + lval i: = R|/|.next#() + when () { + ==(i#, IntegerLiteral(5)) -> { + continue@@@[R|/|.hasNext#()] + } + } + + println#(i#) + } + + println#(String(!!!)) + } public? final? fun bar(list: List): R|kotlin/Unit| { - lval : = list#.subList#(IntegerLiteral(0), IntegerLiteral(10)) - lval : = R|/|.iterator#() + lval : = list#.subList#(IntegerLiteral(0), IntegerLiteral(10)).iterator#() while(R|/|.hasNext#()) { lval element: = R|/|.next#() println#(element#) } - lval : = list#.subList#(IntegerLiteral(10), IntegerLiteral(20)) - lval : = R|/|.iterator#() + lval : = list#.subList#(IntegerLiteral(10), IntegerLiteral(20)).iterator#() while(R|/|.hasNext#()) { lval element: = R|/|.next#() println#(element#) @@ -48,8 +61,7 @@ FILE: for.kt } public? final? fun baz(set: Set): R|kotlin/Unit| { - lval : = set# - lval : = R|/|.iterator#() + lval : = set#.iterator#() while(R|/|.hasNext#()) { lval : = R|/|.next#() lval x: = R|/|.component1() @@ -59,8 +71,7 @@ FILE: for.kt } public? final? fun withParameter(list: List): R|kotlin/Unit| { - lval : = list# - lval : = R|/|.iterator#() + lval : = list#.iterator#() while(R|/|.hasNext#()) { lval s: Some = R|/|.next#() println#(s#) diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.dot b/compiler/fir/resolve/testData/resolve/cfg/complex.dot index bbc1c8bbce6..b29a3b17c42 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.dot @@ -170,62 +170,60 @@ digraph complex_kt { color=red 49 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red]; 50 [label="Access variable this@R|/firstIsInstanceOrNull|"]; - 51 [label="Variable declaration: lval : R|kotlin/collections/List<*>|"]; - 52 [label="Access variable R|/|"]; - 53 [label="Function call: R|/|.R|FakeOverride|>|()"]; - 54 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; + 51 [label="Function call: this@R|/firstIsInstanceOrNull|.R|FakeOverride|>|()"]; + 52 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_16 { color=blue - 55 [label="Enter while loop"]; + 53 [label="Enter while loop"]; subgraph cluster_17 { color=blue - 56 [label="Enter loop condition"]; - 57 [label="Access variable R|/|"]; - 58 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 59 [label="Exit loop condition"]; + 54 [label="Enter loop condition"]; + 55 [label="Access variable R|/|"]; + 56 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 57 [label="Exit loop condition"]; } subgraph cluster_18 { color=blue - 60 [label="Enter loop block"]; + 58 [label="Enter loop block"]; subgraph cluster_19 { color=blue - 61 [label="Enter block"]; - 62 [label="Access variable R|/|"]; - 63 [label="Function call: R|/|.R|FakeOverride|()"]; - 64 [label="Variable declaration: lval element: R|kotlin/Any?|"]; + 59 [label="Enter block"]; + 60 [label="Access variable R|/|"]; + 61 [label="Function call: R|/|.R|FakeOverride|()"]; + 62 [label="Variable declaration: lval element: R|kotlin/Any?|"]; subgraph cluster_20 { color=blue - 65 [label="Enter when"]; + 63 [label="Enter when"]; subgraph cluster_21 { color=blue - 66 [label="Enter when branch condition "]; - 67 [label="Access variable R|/element|"]; - 68 [label="Type operator: (R|/element| is R|T|)"]; - 69 [label="Exit when branch condition"]; + 64 [label="Enter when branch condition "]; + 65 [label="Access variable R|/element|"]; + 66 [label="Type operator: (R|/element| is R|T|)"]; + 67 [label="Exit when branch condition"]; } - 70 [label="Synthetic else branch"]; - 71 [label="Enter when branch result"]; + 68 [label="Synthetic else branch"]; + 69 [label="Enter when branch result"]; subgraph cluster_22 { color=blue - 72 [label="Enter block"]; - 73 [label="Access variable R|/element|"]; - 74 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; - 75 [label="Stub" style="filled" fillcolor=gray]; - 76 [label="Exit block" style="filled" fillcolor=gray]; + 70 [label="Enter block"]; + 71 [label="Access variable R|/element|"]; + 72 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; + 73 [label="Stub" style="filled" fillcolor=gray]; + 74 [label="Exit block" style="filled" fillcolor=gray]; } - 77 [label="Exit when branch result" style="filled" fillcolor=gray]; - 78 [label="Exit when"]; + 75 [label="Exit when branch result" style="filled" fillcolor=gray]; + 76 [label="Exit when"]; } - 79 [label="Exit block"]; + 77 [label="Exit block"]; } - 80 [label="Exit loop block"]; + 78 [label="Exit loop block"]; } - 81 [label="Exit whileloop"]; + 79 [label="Exit whileloop"]; } - 82 [label="Const: Null(null)"]; - 83 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; - 84 [label="Stub" style="filled" fillcolor=gray]; - 85 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; + 80 [label="Const: Null(null)"]; + 81 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; + 82 [label="Stub" style="filled" fillcolor=gray]; + 83 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; } 49 -> {50}; @@ -236,9 +234,9 @@ digraph complex_kt { 54 -> {55}; 55 -> {56}; 56 -> {57}; - 57 -> {58}; + 57 -> {79 58}; 58 -> {59}; - 59 -> {81 60}; + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; @@ -246,25 +244,23 @@ digraph complex_kt { 64 -> {65}; 65 -> {66}; 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {71 70}; - 70 -> {78}; + 67 -> {69 68}; + 68 -> {76}; + 69 -> {70}; + 70 -> {71}; 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {85}; + 72 -> {83}; + 72 -> {73} [style=dotted]; + 73 -> {74} [style=dotted]; 74 -> {75} [style=dotted]; 75 -> {76} [style=dotted]; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79}; + 76 -> {77}; + 77 -> {78}; + 78 -> {54}; 79 -> {80}; - 80 -> {56}; - 81 -> {82}; - 82 -> {83}; - 83 -> {85}; - 83 -> {84} [style=dotted]; - 84 -> {85} [style=dotted]; + 80 -> {81}; + 81 -> {83}; + 81 -> {82} [style=dotted]; + 82 -> {83} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.txt b/compiler/fir/resolve/testData/resolve/cfg/complex.txt index ad2a6c2339a..b041f495df3 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.txt +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.txt @@ -25,8 +25,7 @@ FILE: complex.kt } public final inline fun R|kotlin/collections/List<*>|.firstIsInstanceOrNull(): R|T?| { - lval : R|kotlin/collections/List<*>| = this@R|/firstIsInstanceOrNull| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = this@R|/firstIsInstanceOrNull|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval element: R|kotlin/Any?| = R|/|.R|FakeOverride|() when () { diff --git a/compiler/fir/resolve/testData/resolve/cfg/loops.dot b/compiler/fir/resolve/testData/resolve/cfg/loops.dot index 1431ec026f6..30686d1b994 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/loops.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/loops.dot @@ -105,41 +105,39 @@ digraph loops_kt { 33 [label="Const: Int(0)"]; 34 [label="Const: Int(5)"]; 35 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5))"]; - 36 [label="Variable declaration: lval : R|kotlin/ranges/IntRange|"]; - 37 [label="Access variable R|/|"]; - 38 [label="Function call: R|/|.R|kotlin/ranges/IntProgression.iterator|()"]; - 39 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; + 36 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()"]; + 37 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; subgraph cluster_11 { color=blue - 40 [label="Enter while loop"]; + 38 [label="Enter while loop"]; subgraph cluster_12 { color=blue - 41 [label="Enter loop condition"]; - 42 [label="Access variable R|/|"]; - 43 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 44 [label="Exit loop condition"]; + 39 [label="Enter loop condition"]; + 40 [label="Access variable R|/|"]; + 41 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 42 [label="Exit loop condition"]; } subgraph cluster_13 { color=blue - 45 [label="Enter loop block"]; + 43 [label="Enter loop block"]; subgraph cluster_14 { color=blue - 46 [label="Enter block"]; - 47 [label="Access variable R|/|"]; - 48 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; - 49 [label="Variable declaration: lval i: R|kotlin/Int|"]; - 50 [label="Access variable R|/x|"]; - 51 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 52 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; - 53 [label="Exit block"]; + 44 [label="Enter block"]; + 45 [label="Access variable R|/|"]; + 46 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; + 47 [label="Variable declaration: lval i: R|kotlin/Int|"]; + 48 [label="Access variable R|/x|"]; + 49 [label="Type operator: (R|/x| is R|kotlin/String|)"]; + 50 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; + 51 [label="Exit block"]; } - 54 [label="Exit loop block"]; + 52 [label="Exit loop block"]; } - 55 [label="Exit whileloop"]; + 53 [label="Exit whileloop"]; } - 56 [label="Access variable R|/x|"]; - 57 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 58 [label="Exit function testFor" style="filled" fillcolor=red]; + 54 [label="Access variable R|/x|"]; + 55 [label="Type operator: (R|/x| is R|kotlin/String|)"]; + 56 [label="Exit function testFor" style="filled" fillcolor=red]; } 32 -> {33}; @@ -152,9 +150,9 @@ digraph loops_kt { 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; + 42 -> {53 43}; 43 -> {44}; - 44 -> {55 45}; + 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; @@ -162,203 +160,203 @@ digraph loops_kt { 49 -> {50}; 50 -> {51}; 51 -> {52}; - 52 -> {53}; + 52 -> {39}; 53 -> {54}; - 54 -> {41}; + 54 -> {55}; 55 -> {56}; - 56 -> {57}; - 57 -> {58}; subgraph cluster_15 { color=red - 59 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; + 57 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; subgraph cluster_16 { color=blue - 60 [label="Enter while loop"]; + 58 [label="Enter while loop"]; subgraph cluster_17 { color=blue - 61 [label="Enter loop condition"]; - 62 [label="Const: Boolean(true)"]; - 63 [label="Exit loop condition"]; + 59 [label="Enter loop condition"]; + 60 [label="Const: Boolean(true)"]; + 61 [label="Exit loop condition"]; } subgraph cluster_18 { color=blue - 64 [label="Enter loop block"]; + 62 [label="Enter loop block"]; subgraph cluster_19 { color=blue - 65 [label="Enter block"]; - 66 [label="Const: Int(1)"]; - 67 [label="Exit block"]; + 63 [label="Enter block"]; + 64 [label="Const: Int(1)"]; + 65 [label="Exit block"]; } - 68 [label="Exit loop block"]; + 66 [label="Exit loop block"]; } - 69 [label="Exit whileloop" style="filled" fillcolor=gray]; + 67 [label="Exit whileloop" style="filled" fillcolor=gray]; } - 70 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 71 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 68 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 69 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; } + 57 -> {58}; + 58 -> {59}; 59 -> {60}; 60 -> {61}; 61 -> {62}; + 61 -> {67} [style=dotted]; 62 -> {63}; 63 -> {64}; - 63 -> {69} [style=dotted]; 64 -> {65}; 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {61}; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; + 66 -> {59}; + 67 -> {68} [style=dotted]; + 68 -> {69} [style=dotted]; subgraph cluster_20 { color=red - 72 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; + 70 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 73 [label="Enter while loop"]; + 71 [label="Enter while loop"]; subgraph cluster_22 { color=blue - 74 [label="Enter loop condition"]; - 75 [label="Const: Boolean(true)"]; - 76 [label="Exit loop condition"]; + 72 [label="Enter loop condition"]; + 73 [label="Const: Boolean(true)"]; + 74 [label="Exit loop condition"]; } subgraph cluster_23 { color=blue - 77 [label="Enter loop block"]; + 75 [label="Enter loop block"]; subgraph cluster_24 { color=blue - 78 [label="Enter block"]; + 76 [label="Enter block"]; subgraph cluster_25 { color=blue - 79 [label="Enter when"]; + 77 [label="Enter when"]; subgraph cluster_26 { color=blue - 80 [label="Enter when branch condition "]; - 81 [label="Access variable R|/b|"]; - 82 [label="Exit when branch condition"]; + 78 [label="Enter when branch condition "]; + 79 [label="Access variable R|/b|"]; + 80 [label="Exit when branch condition"]; } - 83 [label="Synthetic else branch"]; - 84 [label="Enter when branch result"]; + 81 [label="Synthetic else branch"]; + 82 [label="Enter when branch result"]; subgraph cluster_27 { color=blue - 85 [label="Enter block"]; - 86 [label="Jump: break@@@[Boolean(true)] "]; - 87 [label="Stub" style="filled" fillcolor=gray]; - 88 [label="Exit block" style="filled" fillcolor=gray]; + 83 [label="Enter block"]; + 84 [label="Jump: break@@@[Boolean(true)] "]; + 85 [label="Stub" style="filled" fillcolor=gray]; + 86 [label="Exit block" style="filled" fillcolor=gray]; } - 89 [label="Exit when branch result" style="filled" fillcolor=gray]; - 90 [label="Exit when"]; + 87 [label="Exit when branch result" style="filled" fillcolor=gray]; + 88 [label="Exit when"]; } - 91 [label="Exit block"]; + 89 [label="Exit block"]; } - 92 [label="Exit loop block"]; + 90 [label="Exit loop block"]; } - 93 [label="Exit whileloop"]; + 91 [label="Exit whileloop"]; } - 94 [label="Const: Int(1)"]; - 95 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; + 92 [label="Const: Int(1)"]; + 93 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; } + 70 -> {71}; + 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; + 74 -> {91} [style=dotted]; 75 -> {76}; 76 -> {77}; - 76 -> {93} [style=dotted]; 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {84 83}; - 83 -> {90}; - 84 -> {85}; - 85 -> {86}; - 86 -> {93}; + 80 -> {82 81}; + 81 -> {88}; + 82 -> {83}; + 83 -> {84}; + 84 -> {91}; + 84 -> {85} [style=dotted]; + 85 -> {86} [style=dotted]; 86 -> {87} [style=dotted]; 87 -> {88} [style=dotted]; - 88 -> {89} [style=dotted]; - 89 -> {90} [style=dotted]; - 90 -> {91}; + 88 -> {89}; + 89 -> {90}; + 90 -> {72}; 91 -> {92}; - 92 -> {74}; - 93 -> {94}; - 94 -> {95}; + 92 -> {93}; subgraph cluster_28 { color=red - 96 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; + 94 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; subgraph cluster_29 { color=blue - 97 [label="Enter while loop"]; + 95 [label="Enter while loop"]; subgraph cluster_30 { color=blue - 98 [label="Enter loop condition"]; - 99 [label="Const: Boolean(false)"]; - 100 [label="Exit loop condition"]; + 96 [label="Enter loop condition"]; + 97 [label="Const: Boolean(false)"]; + 98 [label="Exit loop condition"]; } subgraph cluster_31 { color=blue - 101 [label="Enter loop block" style="filled" fillcolor=gray]; + 99 [label="Enter loop block" style="filled" fillcolor=gray]; subgraph cluster_32 { color=blue - 102 [label="Enter block" style="filled" fillcolor=gray]; - 103 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 104 [label="Exit block" style="filled" fillcolor=gray]; + 100 [label="Enter block" style="filled" fillcolor=gray]; + 101 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 102 [label="Exit block" style="filled" fillcolor=gray]; } - 105 [label="Exit loop block" style="filled" fillcolor=gray]; + 103 [label="Exit loop block" style="filled" fillcolor=gray]; } - 106 [label="Exit whileloop"]; + 104 [label="Exit whileloop"]; } - 107 [label="Const: Int(1)"]; - 108 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; + 105 [label="Const: Int(1)"]; + 106 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; } + 94 -> {95}; + 95 -> {96}; 96 -> {97}; 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {106}; + 98 -> {104}; + 98 -> {99} [style=dotted]; + 99 -> {100} [style=dotted]; 100 -> {101} [style=dotted]; 101 -> {102} [style=dotted]; 102 -> {103} [style=dotted]; - 103 -> {104} [style=dotted]; - 104 -> {105} [style=dotted]; - 105 -> {98} [style=dotted]; - 106 -> {107}; - 107 -> {108}; + 103 -> {96} [style=dotted]; + 104 -> {105}; + 105 -> {106}; subgraph cluster_33 { color=red - 109 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; + 107 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; subgraph cluster_34 { color=blue - 110 [label="Enter do-while loop"]; + 108 [label="Enter do-while loop"]; subgraph cluster_35 { color=blue - 111 [label="Enter loop block"]; + 109 [label="Enter loop block"]; subgraph cluster_36 { color=blue - 112 [label="Enter block"]; - 113 [label="Const: Int(1)"]; - 114 [label="Exit block"]; + 110 [label="Enter block"]; + 111 [label="Const: Int(1)"]; + 112 [label="Exit block"]; } - 115 [label="Exit loop block"]; + 113 [label="Exit loop block"]; } subgraph cluster_37 { color=blue - 116 [label="Enter loop condition"]; - 117 [label="Const: Boolean(true)"]; - 118 [label="Exit loop condition"]; + 114 [label="Enter loop condition"]; + 115 [label="Const: Boolean(true)"]; + 116 [label="Exit loop condition"]; } - 119 [label="Exit do-whileloop" style="filled" fillcolor=gray]; + 117 [label="Exit do-whileloop" style="filled" fillcolor=gray]; } - 120 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 121 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 118 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 119 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; } + 107 -> {108}; + 108 -> {109}; 109 -> {110}; 110 -> {111}; 111 -> {112}; @@ -366,117 +364,117 @@ digraph loops_kt { 113 -> {114}; 114 -> {115}; 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {111}; + 116 -> {109}; + 116 -> {117} [style=dotted]; + 117 -> {118} [style=dotted]; 118 -> {119} [style=dotted]; - 119 -> {120} [style=dotted]; - 120 -> {121} [style=dotted]; subgraph cluster_38 { color=red - 122 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + 120 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; subgraph cluster_39 { color=blue - 123 [label="Enter do-while loop"]; + 121 [label="Enter do-while loop"]; subgraph cluster_40 { color=blue - 124 [label="Enter loop block"]; + 122 [label="Enter loop block"]; subgraph cluster_41 { color=blue - 125 [label="Enter block"]; + 123 [label="Enter block"]; subgraph cluster_42 { color=blue - 126 [label="Enter when"]; + 124 [label="Enter when"]; subgraph cluster_43 { color=blue - 127 [label="Enter when branch condition "]; - 128 [label="Access variable R|/b|"]; - 129 [label="Exit when branch condition"]; + 125 [label="Enter when branch condition "]; + 126 [label="Access variable R|/b|"]; + 127 [label="Exit when branch condition"]; } - 130 [label="Synthetic else branch"]; - 131 [label="Enter when branch result"]; + 128 [label="Synthetic else branch"]; + 129 [label="Enter when branch result"]; subgraph cluster_44 { color=blue - 132 [label="Enter block"]; - 133 [label="Jump: break@@@[Boolean(true)] "]; - 134 [label="Stub" style="filled" fillcolor=gray]; - 135 [label="Exit block" style="filled" fillcolor=gray]; + 130 [label="Enter block"]; + 131 [label="Jump: break@@@[Boolean(true)] "]; + 132 [label="Stub" style="filled" fillcolor=gray]; + 133 [label="Exit block" style="filled" fillcolor=gray]; } - 136 [label="Exit when branch result" style="filled" fillcolor=gray]; - 137 [label="Exit when"]; + 134 [label="Exit when branch result" style="filled" fillcolor=gray]; + 135 [label="Exit when"]; } - 138 [label="Exit block"]; + 136 [label="Exit block"]; } - 139 [label="Exit loop block"]; + 137 [label="Exit loop block"]; } subgraph cluster_45 { color=blue - 140 [label="Enter loop condition"]; - 141 [label="Const: Boolean(true)"]; - 142 [label="Exit loop condition"]; + 138 [label="Enter loop condition"]; + 139 [label="Const: Boolean(true)"]; + 140 [label="Exit loop condition"]; } - 143 [label="Exit do-whileloop"]; + 141 [label="Exit do-whileloop"]; } - 144 [label="Const: Int(1)"]; - 145 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + 142 [label="Const: Int(1)"]; + 143 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; } + 120 -> {121}; + 121 -> {122}; 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; 126 -> {127}; - 127 -> {128}; - 128 -> {129}; - 129 -> {131 130}; - 130 -> {137}; - 131 -> {132}; - 132 -> {133}; - 133 -> {143}; + 127 -> {129 128}; + 128 -> {135}; + 129 -> {130}; + 130 -> {131}; + 131 -> {141}; + 131 -> {132} [style=dotted]; + 132 -> {133} [style=dotted]; 133 -> {134} [style=dotted]; 134 -> {135} [style=dotted]; - 135 -> {136} [style=dotted]; - 136 -> {137} [style=dotted]; + 135 -> {136}; + 136 -> {137}; 137 -> {138}; 138 -> {139}; 139 -> {140}; - 140 -> {141}; + 140 -> {122}; + 140 -> {141} [style=dotted]; 141 -> {142}; - 142 -> {124}; - 142 -> {143} [style=dotted]; - 143 -> {144}; - 144 -> {145}; + 142 -> {143}; subgraph cluster_46 { color=red - 146 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; + 144 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; subgraph cluster_47 { color=blue - 147 [label="Enter do-while loop"]; + 145 [label="Enter do-while loop"]; subgraph cluster_48 { color=blue - 148 [label="Enter loop block"]; + 146 [label="Enter loop block"]; subgraph cluster_49 { color=blue - 149 [label="Enter block"]; - 150 [label="Const: Int(1)"]; - 151 [label="Exit block"]; + 147 [label="Enter block"]; + 148 [label="Const: Int(1)"]; + 149 [label="Exit block"]; } - 152 [label="Exit loop block"]; + 150 [label="Exit loop block"]; } subgraph cluster_50 { color=blue - 153 [label="Enter loop condition"]; - 154 [label="Const: Boolean(false)"]; - 155 [label="Exit loop condition"]; + 151 [label="Enter loop condition"]; + 152 [label="Const: Boolean(false)"]; + 153 [label="Exit loop condition"]; } - 156 [label="Exit do-whileloop"]; + 154 [label="Exit do-whileloop"]; } - 157 [label="Const: Int(1)"]; - 158 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; + 155 [label="Const: Int(1)"]; + 156 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; } + 144 -> {145}; + 145 -> {146}; 146 -> {147}; 147 -> {148}; 148 -> {149}; @@ -485,10 +483,8 @@ digraph loops_kt { 151 -> {152}; 152 -> {153}; 153 -> {154}; + 153 -> {146} [style=dotted]; 154 -> {155}; 155 -> {156}; - 155 -> {148} [style=dotted]; - 156 -> {157}; - 157 -> {158}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/loops.txt b/compiler/fir/resolve/testData/resolve/cfg/loops.txt index bd89c08d468..a72a595e925 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/loops.txt +++ b/compiler/fir/resolve/testData/resolve/cfg/loops.txt @@ -14,8 +14,7 @@ FILE: loops.kt (R|/x| is R|kotlin/String|) } public final fun testFor(x: R|kotlin/Any?|): R|kotlin/Unit| { - lval : R|kotlin/ranges/IntRange| = Int(0).R|kotlin/Int.rangeTo|(Int(5)) - lval : R|kotlin/collections/IntIterator| = R|/|.R|kotlin/ranges/IntProgression.iterator|() + lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() lval y: R|kotlin/Boolean| = (R|/x| is R|kotlin/String|) diff --git a/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt b/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt index d660e6f72bb..151384a9afa 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/enumValues.txt @@ -38,8 +38,7 @@ FILE: enumValues.kt } public final fun foo(): R|kotlin/Unit| { lval values: R|kotlin/Array| = Q|MyEnum|.R|/MyEnum.values|() - lval : R|kotlin/Array| = R|/values| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/values|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval value: R|MyEnum| = R|/|.R|FakeOverride|() R|/value|.R|/MyEnum.bar|() diff --git a/compiler/fir/resolve/testData/resolve/fib.txt b/compiler/fir/resolve/testData/resolve/fib.txt index 195acecb1d0..39745d8a2ad 100644 --- a/compiler/fir/resolve/testData/resolve/fib.txt +++ b/compiler/fir/resolve/testData/resolve/fib.txt @@ -8,8 +8,7 @@ FILE: fib.kt lvar current: R|kotlin/Int| = Int(1) lvar prev: R|kotlin/Int| = Int(1) - lval : R|kotlin/ranges/IntRange| = Int(2).R|kotlin/Int.rangeTo|(R|/n|) - lval : R|kotlin/collections/IntIterator| = R|/|.R|kotlin/ranges/IntProgression.iterator|() + lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|/n|).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() lval temp: R|kotlin/Int| = R|/current| diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index 53bdc59a1e2..9b6fbebf5f7 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -35,63 +35,61 @@ digraph boundSmartcastsInBranches_kt { 8 [label="Const: Null(null)"]; 9 [label="Variable declaration: lvar goodA: R|A?|"]; 10 [label="Access variable R|/list|"]; - 11 [label="Variable declaration: lval : R|kotlin/collections/List|"]; - 12 [label="Access variable R|/|"]; - 13 [label="Function call: R|/|.R|FakeOverride|>|()"]; - 14 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; + 11 [label="Function call: R|/list|.R|FakeOverride|>|()"]; + 12 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_4 { color=blue - 15 [label="Enter while loop"]; + 13 [label="Enter while loop"]; subgraph cluster_5 { color=blue - 16 [label="Enter loop condition"]; - 17 [label="Access variable R|/|"]; - 18 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 19 [label="Exit loop condition"]; + 14 [label="Enter loop condition"]; + 15 [label="Access variable R|/|"]; + 16 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 17 [label="Exit loop condition"]; } subgraph cluster_6 { color=blue - 20 [label="Enter loop block"]; + 18 [label="Enter loop block"]; subgraph cluster_7 { color=blue - 21 [label="Enter block"]; - 22 [label="Access variable R|/|"]; - 23 [label="Function call: R|/|.R|FakeOverride|()"]; - 24 [label="Variable declaration: lval a: R|A|"]; + 19 [label="Enter block"]; + 20 [label="Access variable R|/|"]; + 21 [label="Function call: R|/|.R|FakeOverride|()"]; + 22 [label="Variable declaration: lval a: R|A|"]; subgraph cluster_8 { color=blue - 25 [label="Enter when"]; + 23 [label="Enter when"]; subgraph cluster_9 { color=blue - 26 [label="Enter when branch condition "]; - 27 [label="Access variable R|/goodA|"]; - 28 [label="Const: Null(null)"]; - 29 [label="Operator =="]; - 30 [label="Exit when branch condition"]; + 24 [label="Enter when branch condition "]; + 25 [label="Access variable R|/goodA|"]; + 26 [label="Const: Null(null)"]; + 27 [label="Operator =="]; + 28 [label="Exit when branch condition"]; } - 31 [label="Synthetic else branch"]; - 32 [label="Enter when branch result"]; + 29 [label="Synthetic else branch"]; + 30 [label="Enter when branch result"]; subgraph cluster_10 { color=blue - 33 [label="Enter block"]; - 34 [label="Access variable R|/a|"]; - 35 [label="Assignmenet: R|/goodA|"]; - 36 [label="Jump: continue@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] "]; - 37 [label="Stub" style="filled" fillcolor=gray]; - 38 [label="Exit block" style="filled" fillcolor=gray]; + 31 [label="Enter block"]; + 32 [label="Access variable R|/a|"]; + 33 [label="Assignmenet: R|/goodA|"]; + 34 [label="Jump: continue@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] "]; + 35 [label="Stub" style="filled" fillcolor=gray]; + 36 [label="Exit block" style="filled" fillcolor=gray]; } - 39 [label="Exit when branch result" style="filled" fillcolor=gray]; - 40 [label="Exit when"]; + 37 [label="Exit when branch result" style="filled" fillcolor=gray]; + 38 [label="Exit when"]; } - 41 [label="Access variable R|/goodA|"]; - 42 [label="Access variable R|/A.s|"]; - 43 [label="Exit block"]; + 39 [label="Access variable R|/goodA|"]; + 40 [label="Access variable R|/A.s|"]; + 41 [label="Exit block"]; } - 44 [label="Exit loop block"]; + 42 [label="Exit loop block"]; } - 45 [label="Exit whileloop"]; + 43 [label="Exit whileloop"]; } - 46 [label="Exit function test_0" style="filled" fillcolor=red]; + 44 [label="Exit function test_0" style="filled" fillcolor=red]; } 7 -> {8}; @@ -104,9 +102,9 @@ digraph boundSmartcastsInBranches_kt { 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; + 17 -> {43 18}; 18 -> {19}; - 19 -> {45 20}; + 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; @@ -115,83 +113,83 @@ digraph boundSmartcastsInBranches_kt { 25 -> {26}; 26 -> {27}; 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {32 31}; - 31 -> {40}; + 28 -> {30 29}; + 29 -> {38}; + 30 -> {31}; + 31 -> {32}; 32 -> {33}; 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {15}; + 34 -> {13}; + 34 -> {35} [style=dotted]; + 35 -> {36} [style=dotted]; 36 -> {37} [style=dotted]; 37 -> {38} [style=dotted]; - 38 -> {39} [style=dotted]; - 39 -> {40} [style=dotted]; + 38 -> {39}; + 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; + 42 -> {14}; 43 -> {44}; - 44 -> {16}; - 45 -> {46}; subgraph cluster_11 { color=red - 47 [label="Enter function test_1" style="filled" fillcolor=red]; - 48 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 45 [label="Enter function test_1" style="filled" fillcolor=red]; + 46 [label="Variable declaration: lval x: R|kotlin/Any|"]; subgraph cluster_12 { color=blue - 49 [label="Enter when"]; + 47 [label="Enter when"]; subgraph cluster_13 { color=blue - 50 [label="Enter when branch condition "]; - 51 [label="Access variable R|/b|"]; - 52 [label="Exit when branch condition"]; + 48 [label="Enter when branch condition "]; + 49 [label="Access variable R|/b|"]; + 50 [label="Exit when branch condition"]; } subgraph cluster_14 { color=blue - 53 [label="Enter when branch condition else"]; - 54 [label="Exit when branch condition"]; + 51 [label="Enter when branch condition else"]; + 52 [label="Exit when branch condition"]; } - 55 [label="Enter when branch result"]; + 53 [label="Enter when branch result"]; subgraph cluster_15 { color=blue - 56 [label="Enter block"]; - 57 [label="Access variable R|/a|"]; - 58 [label="Assignmenet: R|/x|"]; - 59 [label="Exit block"]; + 54 [label="Enter block"]; + 55 [label="Access variable R|/a|"]; + 56 [label="Assignmenet: R|/x|"]; + 57 [label="Exit block"]; } - 60 [label="Exit when branch result"]; - 61 [label="Enter when branch result"]; + 58 [label="Exit when branch result"]; + 59 [label="Enter when branch result"]; subgraph cluster_16 { color=blue - 62 [label="Enter block"]; - 63 [label="Function call: R|/A.A|()"]; - 64 [label="Assignmenet: R|/x|"]; - 65 [label="Exit block"]; + 60 [label="Enter block"]; + 61 [label="Function call: R|/A.A|()"]; + 62 [label="Assignmenet: R|/x|"]; + 63 [label="Exit block"]; } - 66 [label="Exit when branch result"]; - 67 [label="Exit when"]; + 64 [label="Exit when branch result"]; + 65 [label="Exit when"]; } - 68 [label="Access variable R|/x|"]; - 69 [label="Access variable R|/A.s|"]; - 70 [label="Exit function test_1" style="filled" fillcolor=red]; + 66 [label="Access variable R|/x|"]; + 67 [label="Access variable R|/A.s|"]; + 68 [label="Exit function test_1" style="filled" fillcolor=red]; } + 45 -> {46}; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {51}; + 50 -> {59 51}; 51 -> {52}; - 52 -> {61 53}; + 52 -> {53}; 53 -> {54}; 54 -> {55}; 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {59}; + 58 -> {65}; 59 -> {60}; - 60 -> {67}; + 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; @@ -199,60 +197,60 @@ digraph boundSmartcastsInBranches_kt { 65 -> {66}; 66 -> {67}; 67 -> {68}; - 68 -> {69}; - 69 -> {70}; subgraph cluster_17 { color=red - 71 [label="Enter function test_2" style="filled" fillcolor=red]; - 72 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 69 [label="Enter function test_2" style="filled" fillcolor=red]; + 70 [label="Variable declaration: lval x: R|kotlin/Any|"]; subgraph cluster_18 { color=blue - 73 [label="Enter when"]; + 71 [label="Enter when"]; subgraph cluster_19 { color=blue - 74 [label="Enter when branch condition "]; - 75 [label="Access variable R|/b|"]; - 76 [label="Exit when branch condition"]; + 72 [label="Enter when branch condition "]; + 73 [label="Access variable R|/b|"]; + 74 [label="Exit when branch condition"]; } subgraph cluster_20 { color=blue - 77 [label="Enter when branch condition else"]; - 78 [label="Exit when branch condition"]; + 75 [label="Enter when branch condition else"]; + 76 [label="Exit when branch condition"]; } - 79 [label="Enter when branch result"]; + 77 [label="Enter when branch result"]; subgraph cluster_21 { color=blue - 80 [label="Enter block"]; + 78 [label="Enter block"]; + 79 [label="Access variable R|/a|"]; + 80 [label="Assignmenet: R|/x|"]; 81 [label="Access variable R|/a|"]; - 82 [label="Assignmenet: R|/x|"]; - 83 [label="Access variable R|/a|"]; - 84 [label="Type operator: (R|/a| as R|A|)"]; - 85 [label="Exit block"]; + 82 [label="Type operator: (R|/a| as R|A|)"]; + 83 [label="Exit block"]; } - 86 [label="Exit when branch result"]; - 87 [label="Enter when branch result"]; + 84 [label="Exit when branch result"]; + 85 [label="Enter when branch result"]; subgraph cluster_22 { color=blue - 88 [label="Enter block"]; - 89 [label="Function call: R|/A.A|()"]; - 90 [label="Assignmenet: R|/x|"]; - 91 [label="Exit block"]; + 86 [label="Enter block"]; + 87 [label="Function call: R|/A.A|()"]; + 88 [label="Assignmenet: R|/x|"]; + 89 [label="Exit block"]; } - 92 [label="Exit when branch result"]; - 93 [label="Exit when"]; + 90 [label="Exit when branch result"]; + 91 [label="Exit when"]; } - 94 [label="Access variable R|/x|"]; - 95 [label="Access variable R|/A.s|"]; - 96 [label="Exit function test_2" style="filled" fillcolor=red]; + 92 [label="Access variable R|/x|"]; + 93 [label="Access variable R|/A.s|"]; + 94 [label="Exit function test_2" style="filled" fillcolor=red]; } + 69 -> {70}; + 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; - 74 -> {75}; + 74 -> {85 75}; 75 -> {76}; - 76 -> {87 77}; + 76 -> {77}; 77 -> {78}; 78 -> {79}; 79 -> {80}; @@ -260,9 +258,9 @@ digraph boundSmartcastsInBranches_kt { 81 -> {82}; 82 -> {83}; 83 -> {84}; - 84 -> {85}; + 84 -> {91}; 85 -> {86}; - 86 -> {93}; + 86 -> {87}; 87 -> {88}; 88 -> {89}; 89 -> {90}; @@ -270,60 +268,60 @@ digraph boundSmartcastsInBranches_kt { 91 -> {92}; 92 -> {93}; 93 -> {94}; - 94 -> {95}; - 95 -> {96}; subgraph cluster_23 { color=red - 97 [label="Enter function test_3" style="filled" fillcolor=red]; - 98 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 95 [label="Enter function test_3" style="filled" fillcolor=red]; + 96 [label="Variable declaration: lval x: R|kotlin/Any|"]; subgraph cluster_24 { color=blue - 99 [label="Enter when"]; + 97 [label="Enter when"]; subgraph cluster_25 { color=blue - 100 [label="Enter when branch condition "]; - 101 [label="Access variable R|/b|"]; - 102 [label="Exit when branch condition"]; + 98 [label="Enter when branch condition "]; + 99 [label="Access variable R|/b|"]; + 100 [label="Exit when branch condition"]; } subgraph cluster_26 { color=blue - 103 [label="Enter when branch condition else"]; - 104 [label="Exit when branch condition"]; + 101 [label="Enter when branch condition else"]; + 102 [label="Exit when branch condition"]; } - 105 [label="Enter when branch result"]; + 103 [label="Enter when branch result"]; subgraph cluster_27 { color=blue - 106 [label="Enter block"]; + 104 [label="Enter block"]; + 105 [label="Access variable R|/a|"]; + 106 [label="Type operator: (R|/a| as R|A|)"]; 107 [label="Access variable R|/a|"]; - 108 [label="Type operator: (R|/a| as R|A|)"]; - 109 [label="Access variable R|/a|"]; - 110 [label="Assignmenet: R|/x|"]; - 111 [label="Exit block"]; + 108 [label="Assignmenet: R|/x|"]; + 109 [label="Exit block"]; } - 112 [label="Exit when branch result"]; - 113 [label="Enter when branch result"]; + 110 [label="Exit when branch result"]; + 111 [label="Enter when branch result"]; subgraph cluster_28 { color=blue - 114 [label="Enter block"]; - 115 [label="Function call: R|/A.A|()"]; - 116 [label="Assignmenet: R|/x|"]; - 117 [label="Exit block"]; + 112 [label="Enter block"]; + 113 [label="Function call: R|/A.A|()"]; + 114 [label="Assignmenet: R|/x|"]; + 115 [label="Exit block"]; } - 118 [label="Exit when branch result"]; - 119 [label="Exit when"]; + 116 [label="Exit when branch result"]; + 117 [label="Exit when"]; } - 120 [label="Access variable R|/x|"]; - 121 [label="Access variable R|/A.s|"]; - 122 [label="Exit function test_3" style="filled" fillcolor=red]; + 118 [label="Access variable R|/x|"]; + 119 [label="Access variable R|/A.s|"]; + 120 [label="Exit function test_3" style="filled" fillcolor=red]; } + 95 -> {96}; + 96 -> {97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; - 100 -> {101}; + 100 -> {111 101}; 101 -> {102}; - 102 -> {113 103}; + 102 -> {103}; 103 -> {104}; 104 -> {105}; 105 -> {106}; @@ -331,9 +329,9 @@ digraph boundSmartcastsInBranches_kt { 107 -> {108}; 108 -> {109}; 109 -> {110}; - 110 -> {111}; + 110 -> {117}; 111 -> {112}; - 112 -> {119}; + 112 -> {113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; @@ -341,70 +339,70 @@ digraph boundSmartcastsInBranches_kt { 117 -> {118}; 118 -> {119}; 119 -> {120}; - 120 -> {121}; - 121 -> {122}; subgraph cluster_29 { color=red - 123 [label="Enter function test_4" style="filled" fillcolor=red]; - 124 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 121 [label="Enter function test_4" style="filled" fillcolor=red]; + 122 [label="Variable declaration: lval x: R|kotlin/Any|"]; subgraph cluster_30 { color=blue - 125 [label="Enter when"]; + 123 [label="Enter when"]; subgraph cluster_31 { color=blue - 126 [label="Enter when branch condition "]; - 127 [label="Access variable R|/b|"]; - 128 [label="Exit when branch condition"]; + 124 [label="Enter when branch condition "]; + 125 [label="Access variable R|/b|"]; + 126 [label="Exit when branch condition"]; } subgraph cluster_32 { color=blue - 129 [label="Enter when branch condition else"]; - 130 [label="Exit when branch condition"]; + 127 [label="Enter when branch condition else"]; + 128 [label="Exit when branch condition"]; } - 131 [label="Enter when branch result"]; + 129 [label="Enter when branch result"]; subgraph cluster_33 { color=blue - 132 [label="Enter block"]; - 133 [label="Access variable R|/a|"]; - 134 [label="Assignmenet: R|/x|"]; - 135 [label="Exit block"]; + 130 [label="Enter block"]; + 131 [label="Access variable R|/a|"]; + 132 [label="Assignmenet: R|/x|"]; + 133 [label="Exit block"]; } - 136 [label="Exit when branch result"]; - 137 [label="Enter when branch result"]; + 134 [label="Exit when branch result"]; + 135 [label="Enter when branch result"]; subgraph cluster_34 { color=blue - 138 [label="Enter block"]; - 139 [label="Access variable R|/a|"]; - 140 [label="Assignmenet: R|/x|"]; - 141 [label="Exit block"]; + 136 [label="Enter block"]; + 137 [label="Access variable R|/a|"]; + 138 [label="Assignmenet: R|/x|"]; + 139 [label="Exit block"]; } - 142 [label="Exit when branch result"]; - 143 [label="Exit when"]; + 140 [label="Exit when branch result"]; + 141 [label="Exit when"]; } + 142 [label="Access variable R|/x|"]; + 143 [label="Type operator: (R|/x| as R|A|)"]; 144 [label="Access variable R|/x|"]; - 145 [label="Type operator: (R|/x| as R|A|)"]; - 146 [label="Access variable R|/x|"]; + 145 [label="Access variable R|/A.s|"]; + 146 [label="Access variable R|/a|"]; 147 [label="Access variable R|/A.s|"]; - 148 [label="Access variable R|/a|"]; - 149 [label="Access variable R|/A.s|"]; - 150 [label="Exit function test_4" style="filled" fillcolor=red]; + 148 [label="Exit function test_4" style="filled" fillcolor=red]; } + 121 -> {122}; + 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; - 126 -> {127}; + 126 -> {135 127}; 127 -> {128}; - 128 -> {137 129}; + 128 -> {129}; 129 -> {130}; 130 -> {131}; 131 -> {132}; 132 -> {133}; 133 -> {134}; - 134 -> {135}; + 134 -> {141}; 135 -> {136}; - 136 -> {143}; + 136 -> {137}; 137 -> {138}; 138 -> {139}; 139 -> {140}; @@ -416,70 +414,70 @@ digraph boundSmartcastsInBranches_kt { 145 -> {146}; 146 -> {147}; 147 -> {148}; - 148 -> {149}; - 149 -> {150}; subgraph cluster_35 { color=red - 151 [label="Enter function test_5" style="filled" fillcolor=red]; - 152 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 149 [label="Enter function test_5" style="filled" fillcolor=red]; + 150 [label="Variable declaration: lval x: R|kotlin/Any|"]; subgraph cluster_36 { color=blue - 153 [label="Enter when"]; + 151 [label="Enter when"]; subgraph cluster_37 { color=blue - 154 [label="Enter when branch condition "]; - 155 [label="Access variable R|/b|"]; - 156 [label="Exit when branch condition"]; + 152 [label="Enter when branch condition "]; + 153 [label="Access variable R|/b|"]; + 154 [label="Exit when branch condition"]; } subgraph cluster_38 { color=blue - 157 [label="Enter when branch condition else"]; - 158 [label="Exit when branch condition"]; + 155 [label="Enter when branch condition else"]; + 156 [label="Exit when branch condition"]; } - 159 [label="Enter when branch result"]; + 157 [label="Enter when branch result"]; subgraph cluster_39 { color=blue - 160 [label="Enter block"]; - 161 [label="Access variable R|/a|"]; - 162 [label="Assignmenet: R|/x|"]; - 163 [label="Exit block"]; + 158 [label="Enter block"]; + 159 [label="Access variable R|/a|"]; + 160 [label="Assignmenet: R|/x|"]; + 161 [label="Exit block"]; } - 164 [label="Exit when branch result"]; - 165 [label="Enter when branch result"]; + 162 [label="Exit when branch result"]; + 163 [label="Enter when branch result"]; subgraph cluster_40 { color=blue - 166 [label="Enter block"]; - 167 [label="Access variable R|/a|"]; - 168 [label="Assignmenet: R|/x|"]; - 169 [label="Exit block"]; + 164 [label="Enter block"]; + 165 [label="Access variable R|/a|"]; + 166 [label="Assignmenet: R|/x|"]; + 167 [label="Exit block"]; } - 170 [label="Exit when branch result"]; - 171 [label="Exit when"]; + 168 [label="Exit when branch result"]; + 169 [label="Exit when"]; } - 172 [label="Access variable R|/a|"]; - 173 [label="Type operator: (R|/a| as R|A|)"]; - 174 [label="Access variable R|/x|"]; + 170 [label="Access variable R|/a|"]; + 171 [label="Type operator: (R|/a| as R|A|)"]; + 172 [label="Access variable R|/x|"]; + 173 [label="Access variable R|/A.s|"]; + 174 [label="Access variable R|/a|"]; 175 [label="Access variable R|/A.s|"]; - 176 [label="Access variable R|/a|"]; - 177 [label="Access variable R|/A.s|"]; - 178 [label="Exit function test_5" style="filled" fillcolor=red]; + 176 [label="Exit function test_5" style="filled" fillcolor=red]; } + 149 -> {150}; + 150 -> {151}; 151 -> {152}; 152 -> {153}; 153 -> {154}; - 154 -> {155}; + 154 -> {163 155}; 155 -> {156}; - 156 -> {165 157}; + 156 -> {157}; 157 -> {158}; 158 -> {159}; 159 -> {160}; 160 -> {161}; 161 -> {162}; - 162 -> {163}; + 162 -> {169}; 163 -> {164}; - 164 -> {171}; + 164 -> {165}; 165 -> {166}; 166 -> {167}; 167 -> {168}; @@ -491,203 +489,203 @@ digraph boundSmartcastsInBranches_kt { 173 -> {174}; 174 -> {175}; 175 -> {176}; - 176 -> {177}; - 177 -> {178}; subgraph cluster_41 { color=red - 179 [label="Enter function test_6" style="filled" fillcolor=red]; - 180 [label="Variable declaration: lval x: R|kotlin/Any|"]; - 181 [label="Access variable R|/a|"]; - 182 [label="Assignmenet: R|/x|"]; - 183 [label="Access variable R|/x|"]; - 184 [label="Access variable R|/A.s|"]; - 185 [label="Exit function test_6" style="filled" fillcolor=red]; + 177 [label="Enter function test_6" style="filled" fillcolor=red]; + 178 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 179 [label="Access variable R|/a|"]; + 180 [label="Assignmenet: R|/x|"]; + 181 [label="Access variable R|/x|"]; + 182 [label="Access variable R|/A.s|"]; + 183 [label="Exit function test_6" style="filled" fillcolor=red]; } + 177 -> {178}; + 178 -> {179}; 179 -> {180}; 180 -> {181}; 181 -> {182}; 182 -> {183}; - 183 -> {184}; - 184 -> {185}; subgraph cluster_42 { color=red - 186 [label="Enter function test_7" style="filled" fillcolor=red]; - 187 [label="Const: Null(null)"]; - 188 [label="Variable declaration: lval z: R|kotlin/String?|"]; - 189 [label="Access variable R|/z|"]; - 190 [label="Variable declaration: lvar y: R|kotlin/String?|"]; - 191 [label="Access variable R|/y|"]; - 192 [label="Variable declaration: lval x: R|kotlin/String?|"]; + 184 [label="Enter function test_7" style="filled" fillcolor=red]; + 185 [label="Const: Null(null)"]; + 186 [label="Variable declaration: lval z: R|kotlin/String?|"]; + 187 [label="Access variable R|/z|"]; + 188 [label="Variable declaration: lvar y: R|kotlin/String?|"]; + 189 [label="Access variable R|/y|"]; + 190 [label="Variable declaration: lval x: R|kotlin/String?|"]; subgraph cluster_43 { color=blue - 193 [label="Enter when"]; + 191 [label="Enter when"]; subgraph cluster_44 { color=blue - 194 [label="Enter when branch condition "]; - 195 [label="Access variable R|/x|"]; - 196 [label="Const: Null(null)"]; - 197 [label="Operator !="]; - 198 [label="Exit when branch condition"]; + 192 [label="Enter when branch condition "]; + 193 [label="Access variable R|/x|"]; + 194 [label="Const: Null(null)"]; + 195 [label="Operator !="]; + 196 [label="Exit when branch condition"]; } - 199 [label="Synthetic else branch"]; - 200 [label="Enter when branch result"]; + 197 [label="Synthetic else branch"]; + 198 [label="Enter when branch result"]; subgraph cluster_45 { color=blue - 201 [label="Enter block"]; - 202 [label="Access variable R|/x|"]; + 199 [label="Enter block"]; + 200 [label="Access variable R|/x|"]; + 201 [label="Access variable R|kotlin/String.length|"]; + 202 [label="Access variable R|/y|"]; 203 [label="Access variable R|kotlin/String.length|"]; - 204 [label="Access variable R|/y|"]; + 204 [label="Access variable R|/z|"]; 205 [label="Access variable R|kotlin/String.length|"]; - 206 [label="Access variable R|/z|"]; - 207 [label="Access variable R|kotlin/String.length|"]; - 208 [label="Exit block"]; + 206 [label="Exit block"]; } - 209 [label="Exit when branch result"]; - 210 [label="Exit when"]; + 207 [label="Exit when branch result"]; + 208 [label="Exit when"]; } subgraph cluster_46 { color=blue - 211 [label="Enter when"]; + 209 [label="Enter when"]; subgraph cluster_47 { color=blue - 212 [label="Enter when branch condition "]; - 213 [label="Access variable R|/y|"]; - 214 [label="Const: Null(null)"]; - 215 [label="Operator !="]; - 216 [label="Exit when branch condition"]; + 210 [label="Enter when branch condition "]; + 211 [label="Access variable R|/y|"]; + 212 [label="Const: Null(null)"]; + 213 [label="Operator !="]; + 214 [label="Exit when branch condition"]; } - 217 [label="Synthetic else branch"]; - 218 [label="Enter when branch result"]; + 215 [label="Synthetic else branch"]; + 216 [label="Enter when branch result"]; subgraph cluster_48 { color=blue - 219 [label="Enter block"]; - 220 [label="Access variable R|/x|"]; + 217 [label="Enter block"]; + 218 [label="Access variable R|/x|"]; + 219 [label="Access variable R|kotlin/String.length|"]; + 220 [label="Access variable R|/y|"]; 221 [label="Access variable R|kotlin/String.length|"]; - 222 [label="Access variable R|/y|"]; + 222 [label="Access variable R|/z|"]; 223 [label="Access variable R|kotlin/String.length|"]; - 224 [label="Access variable R|/z|"]; - 225 [label="Access variable R|kotlin/String.length|"]; - 226 [label="Exit block"]; + 224 [label="Exit block"]; } - 227 [label="Exit when branch result"]; - 228 [label="Exit when"]; + 225 [label="Exit when branch result"]; + 226 [label="Exit when"]; } subgraph cluster_49 { color=blue - 229 [label="Enter when"]; + 227 [label="Enter when"]; subgraph cluster_50 { color=blue - 230 [label="Enter when branch condition "]; - 231 [label="Access variable R|/z|"]; - 232 [label="Const: Null(null)"]; - 233 [label="Operator !="]; - 234 [label="Exit when branch condition"]; + 228 [label="Enter when branch condition "]; + 229 [label="Access variable R|/z|"]; + 230 [label="Const: Null(null)"]; + 231 [label="Operator !="]; + 232 [label="Exit when branch condition"]; } - 235 [label="Synthetic else branch"]; - 236 [label="Enter when branch result"]; + 233 [label="Synthetic else branch"]; + 234 [label="Enter when branch result"]; subgraph cluster_51 { color=blue - 237 [label="Enter block"]; - 238 [label="Access variable R|/x|"]; + 235 [label="Enter block"]; + 236 [label="Access variable R|/x|"]; + 237 [label="Access variable R|kotlin/String.length|"]; + 238 [label="Access variable R|/y|"]; 239 [label="Access variable R|kotlin/String.length|"]; - 240 [label="Access variable R|/y|"]; + 240 [label="Access variable R|/z|"]; 241 [label="Access variable R|kotlin/String.length|"]; - 242 [label="Access variable R|/z|"]; - 243 [label="Access variable R|kotlin/String.length|"]; - 244 [label="Exit block"]; + 242 [label="Exit block"]; } - 245 [label="Exit when branch result"]; - 246 [label="Exit when"]; + 243 [label="Exit when branch result"]; + 244 [label="Exit when"]; } - 247 [label="Const: Null(null)"]; - 248 [label="Assignmenet: R|/y|"]; + 245 [label="Const: Null(null)"]; + 246 [label="Assignmenet: R|/y|"]; subgraph cluster_52 { color=blue - 249 [label="Enter when"]; + 247 [label="Enter when"]; subgraph cluster_53 { color=blue - 250 [label="Enter when branch condition "]; - 251 [label="Access variable R|/x|"]; - 252 [label="Const: Null(null)"]; - 253 [label="Operator !="]; - 254 [label="Exit when branch condition"]; + 248 [label="Enter when branch condition "]; + 249 [label="Access variable R|/x|"]; + 250 [label="Const: Null(null)"]; + 251 [label="Operator !="]; + 252 [label="Exit when branch condition"]; } - 255 [label="Synthetic else branch"]; - 256 [label="Enter when branch result"]; + 253 [label="Synthetic else branch"]; + 254 [label="Enter when branch result"]; subgraph cluster_54 { color=blue - 257 [label="Enter block"]; - 258 [label="Access variable R|/x|"]; - 259 [label="Access variable R|kotlin/String.length|"]; - 260 [label="Access variable R|/y|"]; - 261 [label="Access variable #"]; - 262 [label="Access variable R|/z|"]; - 263 [label="Access variable R|kotlin/String.length|"]; - 264 [label="Exit block"]; + 255 [label="Enter block"]; + 256 [label="Access variable R|/x|"]; + 257 [label="Access variable R|kotlin/String.length|"]; + 258 [label="Access variable R|/y|"]; + 259 [label="Access variable #"]; + 260 [label="Access variable R|/z|"]; + 261 [label="Access variable R|kotlin/String.length|"]; + 262 [label="Exit block"]; } - 265 [label="Exit when branch result"]; - 266 [label="Exit when"]; + 263 [label="Exit when branch result"]; + 264 [label="Exit when"]; } subgraph cluster_55 { color=blue - 267 [label="Enter when"]; + 265 [label="Enter when"]; subgraph cluster_56 { color=blue - 268 [label="Enter when branch condition "]; - 269 [label="Access variable R|/y|"]; - 270 [label="Const: Null(null)"]; - 271 [label="Operator !="]; - 272 [label="Exit when branch condition"]; + 266 [label="Enter when branch condition "]; + 267 [label="Access variable R|/y|"]; + 268 [label="Const: Null(null)"]; + 269 [label="Operator !="]; + 270 [label="Exit when branch condition"]; } - 273 [label="Synthetic else branch"]; - 274 [label="Enter when branch result"]; + 271 [label="Synthetic else branch"]; + 272 [label="Enter when branch result"]; subgraph cluster_57 { color=blue - 275 [label="Enter block"]; - 276 [label="Access variable R|/x|"]; - 277 [label="Access variable #"]; - 278 [label="Access variable R|/y|"]; - 279 [label="Access variable R|kotlin/String.length|"]; - 280 [label="Access variable R|/z|"]; - 281 [label="Access variable #"]; - 282 [label="Exit block"]; + 273 [label="Enter block"]; + 274 [label="Access variable R|/x|"]; + 275 [label="Access variable #"]; + 276 [label="Access variable R|/y|"]; + 277 [label="Access variable R|kotlin/String.length|"]; + 278 [label="Access variable R|/z|"]; + 279 [label="Access variable #"]; + 280 [label="Exit block"]; } - 283 [label="Exit when branch result"]; - 284 [label="Exit when"]; + 281 [label="Exit when branch result"]; + 282 [label="Exit when"]; } subgraph cluster_58 { color=blue - 285 [label="Enter when"]; + 283 [label="Enter when"]; subgraph cluster_59 { color=blue - 286 [label="Enter when branch condition "]; - 287 [label="Access variable R|/z|"]; - 288 [label="Const: Null(null)"]; - 289 [label="Operator !="]; - 290 [label="Exit when branch condition"]; + 284 [label="Enter when branch condition "]; + 285 [label="Access variable R|/z|"]; + 286 [label="Const: Null(null)"]; + 287 [label="Operator !="]; + 288 [label="Exit when branch condition"]; } - 291 [label="Synthetic else branch"]; - 292 [label="Enter when branch result"]; + 289 [label="Synthetic else branch"]; + 290 [label="Enter when branch result"]; subgraph cluster_60 { color=blue - 293 [label="Enter block"]; - 294 [label="Access variable R|/x|"]; - 295 [label="Access variable R|kotlin/String.length|"]; - 296 [label="Access variable R|/y|"]; - 297 [label="Access variable #"]; - 298 [label="Access variable R|/z|"]; - 299 [label="Access variable R|kotlin/String.length|"]; - 300 [label="Exit block"]; + 291 [label="Enter block"]; + 292 [label="Access variable R|/x|"]; + 293 [label="Access variable R|kotlin/String.length|"]; + 294 [label="Access variable R|/y|"]; + 295 [label="Access variable #"]; + 296 [label="Access variable R|/z|"]; + 297 [label="Access variable R|kotlin/String.length|"]; + 298 [label="Exit block"]; } - 301 [label="Exit when branch result"]; - 302 [label="Exit when"]; + 299 [label="Exit when branch result"]; + 300 [label="Exit when"]; } - 303 [label="Exit function test_7" style="filled" fillcolor=red]; + 301 [label="Exit function test_7" style="filled" fillcolor=red]; } + 184 -> {185}; + 185 -> {186}; 186 -> {187}; 187 -> {188}; 188 -> {189}; @@ -698,10 +696,10 @@ digraph boundSmartcastsInBranches_kt { 193 -> {194}; 194 -> {195}; 195 -> {196}; - 196 -> {197}; - 197 -> {198}; - 198 -> {200 199}; - 199 -> {210}; + 196 -> {198 197}; + 197 -> {208}; + 198 -> {199}; + 199 -> {200}; 200 -> {201}; 201 -> {202}; 202 -> {203}; @@ -716,10 +714,10 @@ digraph boundSmartcastsInBranches_kt { 211 -> {212}; 212 -> {213}; 213 -> {214}; - 214 -> {215}; - 215 -> {216}; - 216 -> {218 217}; - 217 -> {228}; + 214 -> {216 215}; + 215 -> {226}; + 216 -> {217}; + 217 -> {218}; 218 -> {219}; 219 -> {220}; 220 -> {221}; @@ -734,10 +732,10 @@ digraph boundSmartcastsInBranches_kt { 229 -> {230}; 230 -> {231}; 231 -> {232}; - 232 -> {233}; - 233 -> {234}; - 234 -> {236 235}; - 235 -> {246}; + 232 -> {234 233}; + 233 -> {244}; + 234 -> {235}; + 235 -> {236}; 236 -> {237}; 237 -> {238}; 238 -> {239}; @@ -754,10 +752,10 @@ digraph boundSmartcastsInBranches_kt { 249 -> {250}; 250 -> {251}; 251 -> {252}; - 252 -> {253}; - 253 -> {254}; - 254 -> {256 255}; - 255 -> {266}; + 252 -> {254 253}; + 253 -> {264}; + 254 -> {255}; + 255 -> {256}; 256 -> {257}; 257 -> {258}; 258 -> {259}; @@ -772,10 +770,10 @@ digraph boundSmartcastsInBranches_kt { 267 -> {268}; 268 -> {269}; 269 -> {270}; - 270 -> {271}; - 271 -> {272}; - 272 -> {274 273}; - 273 -> {284}; + 270 -> {272 271}; + 271 -> {282}; + 272 -> {273}; + 273 -> {274}; 274 -> {275}; 275 -> {276}; 276 -> {277}; @@ -790,10 +788,10 @@ digraph boundSmartcastsInBranches_kt { 285 -> {286}; 286 -> {287}; 287 -> {288}; - 288 -> {289}; - 289 -> {290}; - 290 -> {292 291}; - 291 -> {302}; + 288 -> {290 289}; + 289 -> {300}; + 290 -> {291}; + 291 -> {292}; 292 -> {293}; 293 -> {294}; 294 -> {295}; @@ -803,7 +801,5 @@ digraph boundSmartcastsInBranches_kt { 298 -> {299}; 299 -> {300}; 300 -> {301}; - 301 -> {302}; - 302 -> {303}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt index 306574becce..d13aca2ae60 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt @@ -10,8 +10,7 @@ FILE: boundSmartcastsInBranches.kt } public final fun test_0(list: R|kotlin/collections/List|): R|kotlin/Unit| { lvar goodA: R|A?| = Null(null) - lval : R|kotlin/collections/List| = R|/list| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/list|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval a: R|A| = R|/|.R|FakeOverride|() when () { diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.dot index bc4de38bc15..22a49c71ac6 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.dot @@ -150,76 +150,74 @@ digraph smartcastToNothing_kt { 45 [label="Const: Null(null)"]; 46 [label="Variable declaration: lvar s: R|A?|"]; 47 [label="Access variable R|/results|"]; - 48 [label="Variable declaration: lval : R|kotlin/collections/List|"]; - 49 [label="Access variable R|/|"]; - 50 [label="Function call: R|/|.R|FakeOverride|>|()"]; - 51 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; + 48 [label="Function call: R|/results|.R|FakeOverride|>|()"]; + 49 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_13 { color=blue - 52 [label="Enter while loop"]; + 50 [label="Enter while loop"]; subgraph cluster_14 { color=blue - 53 [label="Enter loop condition"]; - 54 [label="Access variable R|/|"]; - 55 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 56 [label="Exit loop condition"]; + 51 [label="Enter loop condition"]; + 52 [label="Access variable R|/|"]; + 53 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 54 [label="Exit loop condition"]; } subgraph cluster_15 { color=blue - 57 [label="Enter loop block"]; + 55 [label="Enter loop block"]; subgraph cluster_16 { color=blue - 58 [label="Enter block"]; - 59 [label="Access variable R|/|"]; - 60 [label="Function call: R|/|.R|FakeOverride|()"]; - 61 [label="Stub" style="filled" fillcolor=gray]; - 62 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray]; - 63 [label="Access variable R|/result|" style="filled" fillcolor=gray]; - 64 [label="Stub" style="filled" fillcolor=gray]; - 65 [label="Assignmenet: R|/s|" style="filled" fillcolor=gray]; + 56 [label="Enter block"]; + 57 [label="Access variable R|/|"]; + 58 [label="Function call: R|/|.R|FakeOverride|()"]; + 59 [label="Stub" style="filled" fillcolor=gray]; + 60 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray]; + 61 [label="Access variable R|/result|" style="filled" fillcolor=gray]; + 62 [label="Stub" style="filled" fillcolor=gray]; + 63 [label="Assignmenet: R|/s|" style="filled" fillcolor=gray]; subgraph cluster_17 { color=blue - 66 [label="Enter when" style="filled" fillcolor=gray]; + 64 [label="Enter when" style="filled" fillcolor=gray]; subgraph cluster_18 { color=blue - 67 [label="Enter when branch condition " style="filled" fillcolor=gray]; - 68 [label="Access variable R|/result|" style="filled" fillcolor=gray]; - 69 [label="Stub" style="filled" fillcolor=gray]; - 70 [label="Access variable #" style="filled" fillcolor=gray]; - 71 [label="Exit when branch condition" style="filled" fillcolor=gray]; + 65 [label="Enter when branch condition " style="filled" fillcolor=gray]; + 66 [label="Access variable R|/result|" style="filled" fillcolor=gray]; + 67 [label="Stub" style="filled" fillcolor=gray]; + 68 [label="Access variable #" style="filled" fillcolor=gray]; + 69 [label="Exit when branch condition" style="filled" fillcolor=gray]; } - 72 [label="Synthetic else branch" style="filled" fillcolor=gray]; - 73 [label="Enter when branch result" style="filled" fillcolor=gray]; + 70 [label="Synthetic else branch" style="filled" fillcolor=gray]; + 71 [label="Enter when branch result" style="filled" fillcolor=gray]; subgraph cluster_19 { color=blue - 74 [label="Enter block" style="filled" fillcolor=gray]; - 75 [label="Jump: break@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray]; - 76 [label="Stub" style="filled" fillcolor=gray]; - 77 [label="Exit block" style="filled" fillcolor=gray]; + 72 [label="Enter block" style="filled" fillcolor=gray]; + 73 [label="Jump: break@@@[R|/|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray]; + 74 [label="Stub" style="filled" fillcolor=gray]; + 75 [label="Exit block" style="filled" fillcolor=gray]; } - 78 [label="Exit when branch result" style="filled" fillcolor=gray]; - 79 [label="Exit when" style="filled" fillcolor=gray]; + 76 [label="Exit when branch result" style="filled" fillcolor=gray]; + 77 [label="Exit when" style="filled" fillcolor=gray]; } - 80 [label="Exit block" style="filled" fillcolor=gray]; + 78 [label="Exit block" style="filled" fillcolor=gray]; } - 81 [label="Exit loop block" style="filled" fillcolor=gray]; + 79 [label="Exit loop block" style="filled" fillcolor=gray]; } - 82 [label="Exit whileloop"]; + 80 [label="Exit whileloop"]; } - 83 [label="Access variable R|/s|"]; - 84 [label="Enter safe call"]; - 85 [label="Postponed enter to lambda"]; + 81 [label="Access variable R|/s|"]; + 82 [label="Enter safe call"]; + 83 [label="Postponed enter to lambda"]; subgraph cluster_20 { color=blue - 86 [label="Enter function anonymousFunction"]; - 87 [label="Access variable R|/it|"]; - 88 [label="Access variable R|/A.a|"]; - 89 [label="Exit function anonymousFunction"]; + 84 [label="Enter function anonymousFunction"]; + 85 [label="Access variable R|/it|"]; + 86 [label="Access variable R|/A.a|"]; + 87 [label="Exit function anonymousFunction"]; } - 90 [label="Postponed exit from lambda"]; - 91 [label="Function call: R|/s|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Int| )"]; - 92 [label="Exit safe call"]; - 93 [label="Exit function test_0" style="filled" fillcolor=red]; + 88 [label="Postponed exit from lambda"]; + 89 [label="Function call: R|/s|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Int| )"]; + 90 [label="Exit safe call"]; + 91 [label="Exit function test_0" style="filled" fillcolor=red]; } 44 -> {45}; @@ -232,46 +230,44 @@ digraph smartcastToNothing_kt { 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; + 54 -> {80 55}; 55 -> {56}; - 56 -> {82 57}; + 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {93}; + 58 -> {91}; + 58 -> {59} [style=dotted]; + 59 -> {60} [style=dotted]; 60 -> {61} [style=dotted]; - 61 -> {62} [style=dotted]; + 61 -> {91 62} [style=dotted]; 62 -> {63} [style=dotted]; - 63 -> {93 64} [style=dotted]; + 63 -> {64} [style=dotted]; 64 -> {65} [style=dotted]; 65 -> {66} [style=dotted]; - 66 -> {67} [style=dotted]; + 66 -> {91 67} [style=dotted]; 67 -> {68} [style=dotted]; - 68 -> {93 69} [style=dotted]; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; - 71 -> {73 72} [style=dotted]; - 72 -> {79} [style=dotted]; - 73 -> {74} [style=dotted]; + 68 -> {69} [style=dotted]; + 69 -> {71 70} [style=dotted]; + 70 -> {77} [style=dotted]; + 71 -> {72} [style=dotted]; + 72 -> {73} [style=dotted]; + 73 -> {80 74} [style=dotted]; 74 -> {75} [style=dotted]; - 75 -> {82 76} [style=dotted]; + 75 -> {76} [style=dotted]; 76 -> {77} [style=dotted]; 77 -> {78} [style=dotted]; 78 -> {79} [style=dotted]; - 79 -> {80} [style=dotted]; - 80 -> {81} [style=dotted]; - 81 -> {53} [style=dotted]; + 79 -> {51} [style=dotted]; + 80 -> {81}; + 81 -> {82 90}; 82 -> {83}; - 83 -> {84 92}; + 83 -> {84}; + 83 -> {88} [color=red]; 84 -> {85}; 85 -> {86}; - 85 -> {90} [color=red]; 86 -> {87}; - 87 -> {88}; + 87 -> {88} [color=green]; 88 -> {89}; - 89 -> {90} [color=green]; - 90 -> {91}; - 91 -> {92}; - 92 -> {93} [style=dotted]; + 89 -> {90}; + 90 -> {91} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.txt b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.txt index e5b073fd93c..d10c2d52df9 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.txt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastToNothing.txt @@ -30,8 +30,7 @@ FILE: smartcastToNothing.kt } public final fun test_0(results: R|kotlin/collections/List|): R|kotlin/Unit| { lvar s: R|A?| = Null(null) - lval : R|kotlin/collections/List| = R|/results| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/results|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval result: R|kotlin/Nothing| = R|/|.R|FakeOverride|() R|/s| = R|/result| diff --git a/compiler/fir/resolve/testData/resolve/varargInPrimaryConstructor.txt b/compiler/fir/resolve/testData/resolve/varargInPrimaryConstructor.txt index 1c718132b6c..cff64c7dd54 100644 --- a/compiler/fir/resolve/testData/resolve/varargInPrimaryConstructor.txt +++ b/compiler/fir/resolve/testData/resolve/varargInPrimaryConstructor.txt @@ -9,8 +9,7 @@ FILE: varargInPrimaryConstructor.kt } public final fun test_1(foo: R|Foo|): R|kotlin/Unit| { - lval : R|kotlin/Array| = R|/foo|.R|/Foo.strings| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/foo|.R|/Foo.strings|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval s: R|kotlin/String| = R|/|.R|FakeOverride|() R|/s|.R|kotlin/String.length| @@ -18,8 +17,7 @@ FILE: varargInPrimaryConstructor.kt } public final fun test_2(vararg strings: R|kotlin/Array|): R|kotlin/Unit| { - lval : R|kotlin/Array| = R|/strings| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/strings|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval s: R|kotlin/String| = R|/|.R|FakeOverride|() R|/s|.R|kotlin/String.length| diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/components.txt b/compiler/fir/resolve/testData/resolveWithStdlib/components.txt index 95719901e19..f33fdfeb76b 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/components.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/components.txt @@ -23,8 +23,7 @@ FILE: components.kt } public final fun foo(list: R|kotlin/collections/List|): R|kotlin/Unit| { - lval : R|kotlin/collections/List| = R|/list| - lval : R|kotlin/collections/Iterator| = R|/|.R|FakeOverride|>|() + lval : R|kotlin/collections/Iterator| = R|/list|.R|FakeOverride|>|() while(R|/|.R|kotlin/collections/Iterator.hasNext|()) { lval : R|D| = R|/|.R|FakeOverride|() lval x: R|kotlin/Int| = R|/|.R|/D.component1|() diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt index dffe830ef9a..5c7459bbe9f 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -47,60 +47,56 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List [val] - BLOCK type=kotlin.collections.List origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.List? [val] - GET_VAR 'ss: kotlin.collections.List? declared in .test3' type=kotlin.collections.List? origin=null - WHEN type=kotlin.collections.List origin=ELVIS - 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_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONTINUE label=L loop.label=L - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_2: kotlin.collections.List [val] declared in .test3' type=kotlin.collections.List origin=null + $this: BLOCK type=kotlin.collections.List origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test3' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=ELVIS + 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_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=L loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null WHILE label=L2 origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null FUN name:test4 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? BLOCK_BODY WHILE label=L origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.List [val] - BLOCK type=kotlin.collections.List origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.List? [val] - GET_VAR 'ss: kotlin.collections.List? declared in .test4' type=kotlin.collections.List? origin=null - WHEN type=kotlin.collections.List origin=ELVIS - 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_6: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: BREAK label=L loop.label=L - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_6: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_5: kotlin.collections.List [val] declared in .test4' type=kotlin.collections.List origin=null + $this: BLOCK type=kotlin.collections.List origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test4' type=kotlin.collections.List? origin=null + WHEN type=kotlin.collections.List origin=ELVIS + 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_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: BREAK label=L loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List + GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null WHILE label=L2 origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_7: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_7: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:i type:kotlin.Int [var] @@ -108,21 +104,21 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt WHILE label=Outer origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null SET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Unit origin=null CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_8: kotlin.Int [val] declared in .test5' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .test5' type=kotlin.Int origin=null GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null VAR name:j type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 DO_WHILE label=Inner origin=DO_WHILE_LOOP body: BLOCK type=kotlin.Int origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] GET_VAR 'var j: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null SET_VAR 'var j: kotlin.Int [var] declared in .test5' type=kotlin.Unit origin=null 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 .test5' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .test5' type=kotlin.Int origin=null GET_VAR 'var j: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null condition: WHEN type=kotlin.Boolean origin=IF BRANCH diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt index c1d51f9efbe..efc823eb4b2 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.fir.txt @@ -12,18 +12,16 @@ FILE fqName: fileName:/breakContinueInWhen.kt GET_VAR 'i: kotlin.Int declared in .testBreakFor.' type=kotlin.Int origin=null VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] - GET_VAR 'val xs: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.IntIterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.IntIterator [val] CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val tmp_0: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null + $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testBreakFor' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:kotlin.Int [val] CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .testBreakFor' type=kotlin.collections.IntIterator 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 @@ -71,18 +69,16 @@ FILE fqName: fileName:/breakContinueInWhen.kt GET_VAR 'i: kotlin.Int declared in .testContinueFor.' type=kotlin.Int origin=null VAR name:k type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.IntArray [val] - GET_VAR 'val xs: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.IntIterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.IntIterator [val] CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val tmp_2: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null + $this: GET_VAR 'val xs: kotlin.IntArray [val] declared in .testContinueFor' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:kotlin.Int [val] CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .testContinueFor' type=kotlin.collections.IntIterator 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 @@ -111,11 +107,11 @@ FILE fqName: fileName:/breakContinueInWhen.kt CONST String type=kotlin.String value="" DO_WHILE label=null origin=DO_WHILE_LOOP body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] GET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Int origin=null SET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Unit origin=null 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 .testContinueDoWhile' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testContinueDoWhile' type=kotlin.Int origin=null GET_VAR 'var k: kotlin.Int [var] declared in .testContinueDoWhile' type=kotlin.Int origin=null WHEN type=kotlin.Unit origin=WHEN BRANCH diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt index 3d1c6a14df7..c7f311e91fa 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt @@ -4,18 +4,16 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt BLOCK_BODY VAR name:result type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] - GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.IntIterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.IntIterator [val] CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val tmp_0: kotlin.IntArray [val] declared in .sum' type=kotlin.IntArray origin=null + $this: GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:arg type:kotlin.Int [val] CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .sum' type=kotlin.collections.IntIterator origin=null SET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Unit origin=null CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/for.fir.txt b/compiler/testData/ir/irText/expressions/for.fir.txt index bcd1d9402a1..4a4836f4a72 100644 --- a/compiler/testData/ir/irText/expressions/for.fir.txt +++ b/compiler/testData/ir/irText/expressions/for.fir.txt @@ -2,73 +2,65 @@ FILE fqName: fileName:/for.kt FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_0: kotlin.collections.List [val] declared in .testEmpty' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_2: kotlin.collections.List [val] declared in .testIterable' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val s: kotlin.String [val] declared in .testIterable' type=kotlin.String origin=null FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List>) returnType:kotlin.Unit VALUE_PARAMETER name:pp index:0 type:kotlin.collections.List> BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.List> [val] - GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.Iterator> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.Iterator> [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null - $this: GET_VAR 'val tmp_4: kotlin.collections.List> [val] declared in .testDestructuring' type=kotlin.collections.List> origin=null + $this: GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Pair [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Pair [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.Pair origin=null - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null VAR name:i type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.Pair' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_6: kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null + $this: GET_VAR 'val tmp_3: kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null VAR name:s type:kotlin.String [val] CALL 'public final fun component2 (): kotlin.String [operator] declared in kotlin.Pair' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_6: kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null + $this: GET_VAR 'val tmp_3: kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val i: kotlin.Int [val] declared in .testDestructuring' type=kotlin.Int origin=null CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val s: kotlin.String [val] declared in .testDestructuring' type=kotlin.String origin=null FUN name:testRange visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.ranges.IntRange [val] - CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null - $this: CONST Int type=kotlin.Int value=1 - other: CONST Int type=kotlin.Int value=10 - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.collections.IntIterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.IntIterator [val] CALL 'public open fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.ranges.IntProgression' type=kotlin.collections.IntIterator origin=null - $this: GET_VAR 'val tmp_7: kotlin.ranges.IntRange [val] declared in .testRange' type=kotlin.ranges.IntRange origin=null + $this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange [operator] declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null + $this: CONST Int type=kotlin.Int value=1 + other: CONST Int type=kotlin.Int value=10 WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_8: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:i type:kotlin.Int [val] CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_8: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.IntIterator [val] declared in .testRange' type=kotlin.collections.IntIterator origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt index 8e48cf5a717..581900ed60e 100644 --- a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt @@ -2,46 +2,40 @@ FILE fqName: fileName:/forWithBreakContinue.kt FUN name:testForBreak1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_0: kotlin.collections.List [val] declared in .testForBreak1' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null BREAK label=null loop.label=null FUN name:testForBreak2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_2: kotlin.collections.List [val] declared in .testForBreak2' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s1 type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.Iterator [val] + $this: GET_VAR 'val tmp_1: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_4: kotlin.collections.List [val] declared in .testForBreak2' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null WHILE label=INNER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s2 type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null BREAK label=OUTER loop.label=OUTER BREAK label=INNER loop.label=INNER BREAK label=INNER loop.label=INNER @@ -49,46 +43,40 @@ FILE fqName: fileName:/forWithBreakContinue.kt FUN name:testForContinue1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_6: kotlin.collections.List [val] declared in .testForContinue1' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_7: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_7: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null CONTINUE label=null loop.label=null FUN name:testForContinue2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.collections.Iterator [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_8: kotlin.collections.List [val] declared in .testForContinue2' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_9: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s1 type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_9: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.collections.List [val] - GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.collections.Iterator [val] + $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null - $this: GET_VAR 'val tmp_10: kotlin.collections.List [val] declared in .testForContinue2' type=kotlin.collections.List origin=null + $this: GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null WHILE label=INNER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_11: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s2 type:kotlin.String [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_11: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null CONTINUE label=OUTER loop.label=OUTER CONTINUE label=INNER loop.label=INNER CONTINUE label=INNER loop.label=INNER diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index f98705b442b..9eb3400bc04 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -105,9 +105,7 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt FUN name:test visibility:public modality:FINAL <> ($receiver:.IReceiver) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.IReceiver BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.FiveTimes [val] - GET_OBJECT 'CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.FiveTimes - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.IntCell [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.IntCell [val] CALL 'public open fun iterator (): .IntCell [operator] declared in .IReceiver' type=.IntCell origin=null $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt index 2cae9b3e75e..199a540b8a6 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt @@ -4,38 +4,34 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt BLOCK_BODY FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.List<.P>? [val] - CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.MutableIterator<.P> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.MutableIterator<.P> [val] CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=null - $this: GET_VAR 'val tmp_0: kotlin.collections.List<.P>? [val] declared in .testForInListUnused' type=kotlin.collections.List<.P>? origin=null + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:.P [val] CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=null - $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P> origin=null FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List<.P>? [val] - CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.MutableIterator<.P> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.MutableIterator<.P> [val] CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=null - $this: GET_VAR 'val tmp_2: kotlin.collections.List<.P>? [val] declared in .testForInListDestructured' type=kotlin.collections.List<.P>? origin=null + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null body: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.P [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.P [val] CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=null - $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P> origin=null VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_4: .P [val] declared in .testForInListDestructured' type=.P origin=null + $this: GET_VAR 'val tmp_2: .P [val] declared in .testForInListDestructured' type=.P origin=null VAR name:y type:kotlin.Int [val] CALL 'public final fun component2 (): kotlin.Int declared in .P' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_4: .P [val] declared in .testForInListDestructured' type=.P origin=null + $this: GET_VAR 'val tmp_2: .P [val] declared in .testForInListDestructured' type=.P origin=null FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:iterator type:kotlin.collections.MutableIterator<.P> [val] @@ -51,33 +47,29 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Array.P?>? [val] - CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.Iterator<.P?> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.Iterator<.P?> [val] CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null - $this: GET_VAR 'val tmp_5: kotlin.Array.P?>? [val] declared in .testForInArrayUnused' type=kotlin.Array.P?>? origin=null + $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUnused' type=.J origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_6: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:.P? [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=null - $this: GET_VAR 'val tmp_6: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null + $this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUnused' type=kotlin.collections.Iterator<.P?> origin=null FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.List<.P>? [val] - CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.collections.MutableIterator<.P> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.MutableIterator<.P> [val] CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P> origin=null - $this: GET_VAR 'val tmp_7: kotlin.collections.List<.P>? [val] declared in .testForInListUse' type=kotlin.collections.List<.P>? origin=null + $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P>? [operator] declared in .J' type=kotlin.collections.List<.P>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_8: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:.P [val] CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P origin=null - $this: GET_VAR 'val tmp_8: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null + $this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<.P> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P> origin=null CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'val x: .P [val] declared in .testForInListUse' type=.P origin=null CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null @@ -85,19 +77,17 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Array.P?>? [val] - CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null - $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.collections.Iterator<.P?> [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.Iterator<.P?> [val] CALL 'public final fun iterator (): kotlin.collections.Iterator<.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<.P?> origin=null - $this: GET_VAR 'val tmp_9: kotlin.Array.P?>? [val] declared in .testForInArrayUse' type=kotlin.Array.P?>? origin=null + $this: CALL 'public open fun arrayOfNotNull (): kotlin.Array.P?>? [operator] declared in .J' type=kotlin.Array.P?>? origin=null + $this: GET_VAR 'j: .J declared in .testForInArrayUse' type=.J origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_10: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null + $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:x type:.P? [val] CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=null - $this: GET_VAR 'val tmp_10: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null + $this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<.P?> [val] declared in .testForInArrayUse' type=kotlin.collections.Iterator<.P?> origin=null CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'val x: .P? [val] declared in .testForInArrayUse' type=.P? origin=null CALL 'public open fun use (s: .P): kotlin.Unit [operator] declared in .J' type=kotlin.Unit origin=null