diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt index dfa234c3a00..d2e155b8264 100644 --- a/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/expressions/forExpression.txt @@ -5,4 +5,7 @@ FIR source kind: KtRealSourceElementKind FIR element rendered: while(R|/|.R|SubstitutionOverride|()) { lval x: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot index f9f8dd7cd9e..e68bd6e6ab2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot @@ -208,42 +208,47 @@ digraph complex_kt { 68 [label="Variable declaration: lval element: R|kotlin/Any?|"]; subgraph cluster_23 { color=blue - 69 [label="Enter when"]; + 69 [label="Enter block"]; subgraph cluster_24 { color=blue - 70 [label="Enter when branch condition "]; - 71 [label="Access variable R|/element|"]; - 72 [label="Type operator: (R|/element| is R|T|)"]; - 73 [label="Exit when branch condition"]; + 70 [label="Enter when"]; + subgraph cluster_25 { + color=blue + 71 [label="Enter when branch condition "]; + 72 [label="Access variable R|/element|"]; + 73 [label="Type operator: (R|/element| is R|T|)"]; + 74 [label="Exit when branch condition"]; + } + 75 [label="Synthetic else branch"]; + 76 [label="Enter when branch result"]; + subgraph cluster_26 { + color=blue + 77 [label="Enter block"]; + 78 [label="Access variable R|/element|"]; + 79 [label="Smart cast: R|/element|"]; + 80 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; + 81 [label="Stub" style="filled" fillcolor=gray]; + 82 [label="Exit block" style="filled" fillcolor=gray]; + } + 83 [label="Exit when branch result" style="filled" fillcolor=gray]; + 84 [label="Exit when"]; } - 74 [label="Synthetic else branch"]; - 75 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 76 [label="Enter block"]; - 77 [label="Access variable R|/element|"]; - 78 [label="Smart cast: R|/element|"]; - 79 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; - 80 [label="Stub" style="filled" fillcolor=gray]; - 81 [label="Exit block" style="filled" fillcolor=gray]; - } - 82 [label="Exit when branch result" style="filled" fillcolor=gray]; - 83 [label="Exit when"]; + 85 [label="Exit block"]; } - 84 [label="Exit block"]; + 86 [label="Exit block"]; } - 85 [label="Exit loop block"]; + 87 [label="Exit loop block"]; } - 86 [label="Exit while loop"]; + 88 [label="Exit while loop"]; } - 87 [label="Exit block"]; + 89 [label="Exit block"]; } - 88 [label="Const: Null(null)"]; - 89 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; - 90 [label="Stub" style="filled" fillcolor=gray]; - 91 [label="Exit block" style="filled" fillcolor=gray]; + 90 [label="Const: Null(null)"]; + 91 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; + 92 [label="Stub" style="filled" fillcolor=gray]; + 93 [label="Exit block" style="filled" fillcolor=gray]; } - 92 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; + 94 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; } 53 -> {54}; 54 -> {55}; @@ -255,7 +260,7 @@ digraph complex_kt { 60 -> {61}; 61 -> {62}; 62 -> {63}; - 63 -> {64 86}; + 63 -> {64 88}; 64 -> {65}; 65 -> {66}; 66 -> {67}; @@ -265,26 +270,28 @@ digraph complex_kt { 70 -> {71}; 71 -> {72}; 72 -> {73}; - 73 -> {74 75}; - 74 -> {83}; - 75 -> {76}; + 73 -> {74}; + 74 -> {75 76}; + 75 -> {84}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - 79 -> {92}; - 79 -> {80} [style=dotted]; + 79 -> {80}; + 80 -> {94}; 80 -> {81} [style=dotted]; 81 -> {82} [style=dotted]; 82 -> {83} [style=dotted]; - 83 -> {84}; + 83 -> {84} [style=dotted]; 84 -> {85}; - 85 -> {60} [color=green style=dashed]; + 85 -> {86}; 86 -> {87}; - 87 -> {88}; + 87 -> {60} [color=green style=dashed]; 88 -> {89}; - 89 -> {92}; - 89 -> {90} [style=dotted]; - 90 -> {91} [style=dotted]; + 89 -> {90}; + 90 -> {91}; + 91 -> {94}; 91 -> {92} [style=dotted]; + 92 -> {93} [style=dotted]; + 93 -> {94} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt index b16f73c7bbf..560e2100256 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.fir.txt @@ -27,10 +27,13 @@ FILE: complex.kt lval : R|kotlin/collections/Iterator| = this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval element: R|kotlin/Any?| = R|/|.R|SubstitutionOverride|() - when () { - (R|/element| is R|T|) -> { - ^firstIsInstanceOrNull R|/element| + { + when () { + (R|/element| is R|T|) -> { + ^firstIsInstanceOrNull R|/element| + } } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot index 266d6f11186..8fc834389da 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot @@ -145,22 +145,27 @@ digraph loops_kt { 51 [label="Access variable R|/|"]; 52 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()" style="filled" fillcolor=yellow]; 53 [label="Variable declaration: lval i: R|kotlin/Int|"]; - 54 [label="Access variable R|/x|"]; - 55 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 56 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; - 57 [label="Exit block"]; + subgraph cluster_19 { + color=blue + 54 [label="Enter block"]; + 55 [label="Access variable R|/x|"]; + 56 [label="Type operator: (R|/x| is R|kotlin/String|)"]; + 57 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; + 58 [label="Exit block"]; + } + 59 [label="Exit block"]; } - 58 [label="Exit loop block"]; + 60 [label="Exit loop block"]; } - 59 [label="Exit while loop"]; + 61 [label="Exit while loop"]; } - 60 [label="Exit block"]; + 62 [label="Exit block"]; } - 61 [label="Access variable R|/x|"]; - 62 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 63 [label="Exit block"]; + 63 [label="Access variable R|/x|"]; + 64 [label="Type operator: (R|/x| is R|kotlin/String|)"]; + 65 [label="Exit block"]; } - 64 [label="Exit function testFor" style="filled" fillcolor=red]; + 66 [label="Exit function testFor" style="filled" fillcolor=red]; } 36 -> {37}; 37 -> {38}; @@ -174,7 +179,7 @@ digraph loops_kt { 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49 59}; + 48 -> {49 61}; 49 -> {50}; 50 -> {51}; 51 -> {52}; @@ -184,227 +189,227 @@ digraph loops_kt { 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {45} [color=green style=dashed]; + 58 -> {59}; 59 -> {60}; - 60 -> {61}; + 60 -> {45} [color=green style=dashed]; 61 -> {62}; 62 -> {63}; 63 -> {64}; + 64 -> {65}; + 65 -> {66}; - subgraph cluster_19 { + subgraph cluster_20 { color=red - 65 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; - subgraph cluster_20 { + 67 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; + subgraph cluster_21 { color=blue - 66 [label="Enter block"]; - subgraph cluster_21 { + 68 [label="Enter block"]; + subgraph cluster_22 { color=blue - 67 [label="Enter while loop"]; - subgraph cluster_22 { - color=blue - 68 [label="Enter loop condition"]; - 69 [label="Const: Boolean(true)"]; - 70 [label="Exit loop condition"]; - } + 69 [label="Enter while loop"]; subgraph cluster_23 { color=blue - 71 [label="Enter loop block"]; - subgraph cluster_24 { - color=blue - 72 [label="Enter block"]; - 73 [label="Const: Int(1)"]; - 74 [label="Exit block"]; - } - 75 [label="Exit loop block"]; + 70 [label="Enter loop condition"]; + 71 [label="Const: Boolean(true)"]; + 72 [label="Exit loop condition"]; } - 76 [label="Exit while loop" style="filled" fillcolor=gray]; + subgraph cluster_24 { + color=blue + 73 [label="Enter loop block"]; + subgraph cluster_25 { + color=blue + 74 [label="Enter block"]; + 75 [label="Const: Int(1)"]; + 76 [label="Exit block"]; + } + 77 [label="Exit loop block"]; + } + 78 [label="Exit while loop" style="filled" fillcolor=gray]; } - 77 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 78 [label="Exit block" style="filled" fillcolor=gray]; + 79 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 80 [label="Exit block" style="filled" fillcolor=gray]; } - 79 [label="Exit function testWhileTrue" style="filled" fillcolor=gray]; + 81 [label="Exit function testWhileTrue" style="filled" fillcolor=gray]; } - 65 -> {66}; - 66 -> {67}; 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; - 70 -> {76} [style=dotted]; 71 -> {72}; 72 -> {73}; + 72 -> {78} [style=dotted]; 73 -> {74}; 74 -> {75}; - 75 -> {68} [color=green style=dashed]; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; + 75 -> {76}; + 76 -> {77}; + 77 -> {70} [color=green style=dashed]; 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; - subgraph cluster_25 { + subgraph cluster_26 { color=red - 80 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; - subgraph cluster_26 { + 82 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_27 { color=blue - 81 [label="Enter block"]; - subgraph cluster_27 { + 83 [label="Enter block"]; + subgraph cluster_28 { color=blue - 82 [label="Enter while loop"]; - subgraph cluster_28 { - color=blue - 83 [label="Enter loop condition"]; - 84 [label="Const: Boolean(true)"]; - 85 [label="Exit loop condition"]; - } + 84 [label="Enter while loop"]; subgraph cluster_29 { color=blue - 86 [label="Enter loop block"]; - subgraph cluster_30 { + 85 [label="Enter loop condition"]; + 86 [label="Const: Boolean(true)"]; + 87 [label="Exit loop condition"]; + } + subgraph cluster_30 { + color=blue + 88 [label="Enter loop block"]; + subgraph cluster_31 { color=blue - 87 [label="Enter block"]; - subgraph cluster_31 { + 89 [label="Enter block"]; + subgraph cluster_32 { color=blue - 88 [label="Enter when"]; - subgraph cluster_32 { - color=blue - 89 [label="Enter when branch condition "]; - 90 [label="Access variable R|/b|"]; - 91 [label="Exit when branch condition"]; - } - 92 [label="Synthetic else branch"]; - 93 [label="Enter when branch result"]; + 90 [label="Enter when"]; subgraph cluster_33 { color=blue - 94 [label="Enter block"]; - 95 [label="Jump: break@@@[Boolean(true)] "]; - 96 [label="Stub" style="filled" fillcolor=gray]; - 97 [label="Exit block" style="filled" fillcolor=gray]; + 91 [label="Enter when branch condition "]; + 92 [label="Access variable R|/b|"]; + 93 [label="Exit when branch condition"]; } - 98 [label="Exit when branch result" style="filled" fillcolor=gray]; - 99 [label="Exit when"]; + 94 [label="Synthetic else branch"]; + 95 [label="Enter when branch result"]; + subgraph cluster_34 { + color=blue + 96 [label="Enter block"]; + 97 [label="Jump: break@@@[Boolean(true)] "]; + 98 [label="Stub" style="filled" fillcolor=gray]; + 99 [label="Exit block" style="filled" fillcolor=gray]; + } + 100 [label="Exit when branch result" style="filled" fillcolor=gray]; + 101 [label="Exit when"]; } - 100 [label="Exit block"]; + 102 [label="Exit block"]; } - 101 [label="Exit loop block"]; + 103 [label="Exit loop block"]; } - 102 [label="Exit while loop"]; + 104 [label="Exit while loop"]; } - 103 [label="Const: Int(1)"]; - 104 [label="Exit block"]; + 105 [label="Const: Int(1)"]; + 106 [label="Exit block"]; } - 105 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; + 107 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; } - 80 -> {81}; - 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; - 85 -> {102} [style=dotted]; 86 -> {87}; 87 -> {88}; + 87 -> {104} [style=dotted]; 88 -> {89}; 89 -> {90}; 90 -> {91}; - 91 -> {92 93}; - 92 -> {99}; - 93 -> {94}; - 94 -> {95}; - 95 -> {102}; - 95 -> {96} [style=dotted]; - 96 -> {97} [style=dotted]; + 91 -> {92}; + 92 -> {93}; + 93 -> {94 95}; + 94 -> {101}; + 95 -> {96}; + 96 -> {97}; + 97 -> {104}; 97 -> {98} [style=dotted]; 98 -> {99} [style=dotted]; - 99 -> {100}; - 100 -> {101}; - 101 -> {83} [color=green style=dashed]; + 99 -> {100} [style=dotted]; + 100 -> {101} [style=dotted]; + 101 -> {102}; 102 -> {103}; - 103 -> {104}; + 103 -> {85} [color=green style=dashed]; 104 -> {105}; + 105 -> {106}; + 106 -> {107}; - subgraph cluster_34 { + subgraph cluster_35 { color=red - 106 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; - subgraph cluster_35 { + 108 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_36 { color=blue - 107 [label="Enter block"]; - subgraph cluster_36 { + 109 [label="Enter block"]; + subgraph cluster_37 { color=blue - 108 [label="Enter while loop"]; - subgraph cluster_37 { - color=blue - 109 [label="Enter loop condition"]; - 110 [label="Const: Boolean(false)"]; - 111 [label="Exit loop condition"]; - } + 110 [label="Enter while loop"]; subgraph cluster_38 { color=blue - 112 [label="Enter loop block" style="filled" fillcolor=gray]; - subgraph cluster_39 { - color=blue - 113 [label="Enter block" style="filled" fillcolor=gray]; - 114 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 115 [label="Exit block" style="filled" fillcolor=gray]; - } - 116 [label="Exit loop block" style="filled" fillcolor=gray]; + 111 [label="Enter loop condition"]; + 112 [label="Const: Boolean(false)"]; + 113 [label="Exit loop condition"]; } - 117 [label="Exit while loop"]; + subgraph cluster_39 { + color=blue + 114 [label="Enter loop block" style="filled" fillcolor=gray]; + subgraph cluster_40 { + color=blue + 115 [label="Enter block" style="filled" fillcolor=gray]; + 116 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 117 [label="Exit block" style="filled" fillcolor=gray]; + } + 118 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 119 [label="Exit while loop"]; } - 118 [label="Const: Int(1)"]; - 119 [label="Exit block"]; + 120 [label="Const: Int(1)"]; + 121 [label="Exit block"]; } - 120 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; + 122 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; } - 106 -> {107}; - 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; - 111 -> {117}; - 111 -> {112} [style=dotted]; - 112 -> {113} [style=dotted]; + 111 -> {112}; + 112 -> {113}; + 113 -> {119}; 113 -> {114} [style=dotted]; 114 -> {115} [style=dotted]; 115 -> {116} [style=dotted]; - 116 -> {109} [color=green style=dotted]; - 117 -> {118}; - 118 -> {119}; + 116 -> {117} [style=dotted]; + 117 -> {118} [style=dotted]; + 118 -> {111} [color=green style=dotted]; 119 -> {120}; - - subgraph cluster_40 { - color=red - 121 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; - subgraph cluster_41 { - color=blue - 122 [label="Enter block"]; - subgraph cluster_42 { - color=blue - 123 [label="Enter do-while loop"]; - subgraph cluster_43 { - color=blue - 124 [label="Enter loop block"]; - subgraph cluster_44 { - color=blue - 125 [label="Enter block"]; - 126 [label="Const: Int(1)"]; - 127 [label="Exit block"]; - } - 128 [label="Exit loop block"]; - } - subgraph cluster_45 { - color=blue - 129 [label="Enter loop condition"]; - 130 [label="Const: Boolean(true)"]; - 131 [label="Exit loop condition"]; - } - 132 [label="Exit do-while loop" style="filled" fillcolor=gray]; - } - 133 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 134 [label="Exit block" style="filled" fillcolor=gray]; - } - 135 [label="Exit function testDoWhileTrue" style="filled" fillcolor=gray]; - } + 120 -> {121}; 121 -> {122}; - 122 -> {123}; + + subgraph cluster_41 { + color=red + 123 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; + subgraph cluster_42 { + color=blue + 124 [label="Enter block"]; + subgraph cluster_43 { + color=blue + 125 [label="Enter do-while loop"]; + subgraph cluster_44 { + color=blue + 126 [label="Enter loop block"]; + subgraph cluster_45 { + color=blue + 127 [label="Enter block"]; + 128 [label="Const: Int(1)"]; + 129 [label="Exit block"]; + } + 130 [label="Exit loop block"]; + } + subgraph cluster_46 { + color=blue + 131 [label="Enter loop condition"]; + 132 [label="Const: Boolean(true)"]; + 133 [label="Exit loop condition"]; + } + 134 [label="Exit do-while loop" style="filled" fillcolor=gray]; + } + 135 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 136 [label="Exit block" style="filled" fillcolor=gray]; + } + 137 [label="Exit function testDoWhileTrue" style="filled" fillcolor=gray]; + } 123 -> {124}; 124 -> {125}; 125 -> {126}; @@ -413,128 +418,128 @@ digraph loops_kt { 128 -> {129}; 129 -> {130}; 130 -> {131}; - 131 -> {124} [color=green style=dashed]; - 131 -> {132} [style=dotted]; - 132 -> {133} [style=dotted]; + 131 -> {132}; + 132 -> {133}; + 133 -> {126} [color=green style=dashed]; 133 -> {134} [style=dotted]; 134 -> {135} [style=dotted]; + 135 -> {136} [style=dotted]; + 136 -> {137} [style=dotted]; - subgraph cluster_46 { + subgraph cluster_47 { color=red - 136 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; - subgraph cluster_47 { + 138 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_48 { color=blue - 137 [label="Enter block"]; - subgraph cluster_48 { + 139 [label="Enter block"]; + subgraph cluster_49 { color=blue - 138 [label="Enter do-while loop"]; - subgraph cluster_49 { + 140 [label="Enter do-while loop"]; + subgraph cluster_50 { color=blue - 139 [label="Enter loop block"]; - subgraph cluster_50 { + 141 [label="Enter loop block"]; + subgraph cluster_51 { color=blue - 140 [label="Enter block"]; - subgraph cluster_51 { + 142 [label="Enter block"]; + subgraph cluster_52 { color=blue - 141 [label="Enter when"]; - subgraph cluster_52 { - color=blue - 142 [label="Enter when branch condition "]; - 143 [label="Access variable R|/b|"]; - 144 [label="Exit when branch condition"]; - } - 145 [label="Synthetic else branch"]; - 146 [label="Enter when branch result"]; + 143 [label="Enter when"]; subgraph cluster_53 { color=blue - 147 [label="Enter block"]; - 148 [label="Jump: break@@@[Boolean(true)] "]; - 149 [label="Stub" style="filled" fillcolor=gray]; - 150 [label="Exit block" style="filled" fillcolor=gray]; + 144 [label="Enter when branch condition "]; + 145 [label="Access variable R|/b|"]; + 146 [label="Exit when branch condition"]; } - 151 [label="Exit when branch result" style="filled" fillcolor=gray]; - 152 [label="Exit when"]; + 147 [label="Synthetic else branch"]; + 148 [label="Enter when branch result"]; + subgraph cluster_54 { + color=blue + 149 [label="Enter block"]; + 150 [label="Jump: break@@@[Boolean(true)] "]; + 151 [label="Stub" style="filled" fillcolor=gray]; + 152 [label="Exit block" style="filled" fillcolor=gray]; + } + 153 [label="Exit when branch result" style="filled" fillcolor=gray]; + 154 [label="Exit when"]; } - 153 [label="Exit block"]; + 155 [label="Exit block"]; } - 154 [label="Exit loop block"]; + 156 [label="Exit loop block"]; } - subgraph cluster_54 { + subgraph cluster_55 { color=blue - 155 [label="Enter loop condition"]; - 156 [label="Const: Boolean(true)"]; - 157 [label="Exit loop condition"]; + 157 [label="Enter loop condition"]; + 158 [label="Const: Boolean(true)"]; + 159 [label="Exit loop condition"]; } - 158 [label="Exit do-while loop"]; + 160 [label="Exit do-while loop"]; } - 159 [label="Const: Int(1)"]; - 160 [label="Exit block"]; + 161 [label="Const: Int(1)"]; + 162 [label="Exit block"]; } - 161 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + 163 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; } - 136 -> {137}; - 137 -> {138}; 138 -> {139}; 139 -> {140}; 140 -> {141}; 141 -> {142}; 142 -> {143}; 143 -> {144}; - 144 -> {145 146}; - 145 -> {152}; - 146 -> {147}; - 147 -> {148}; - 148 -> {158}; - 148 -> {149} [style=dotted]; - 149 -> {150} [style=dotted]; + 144 -> {145}; + 145 -> {146}; + 146 -> {147 148}; + 147 -> {154}; + 148 -> {149}; + 149 -> {150}; + 150 -> {160}; 150 -> {151} [style=dotted]; 151 -> {152} [style=dotted]; - 152 -> {153}; - 153 -> {154}; + 152 -> {153} [style=dotted]; + 153 -> {154} [style=dotted]; 154 -> {155}; 155 -> {156}; 156 -> {157}; - 157 -> {139} [color=green style=dashed]; - 157 -> {158} [style=dotted]; + 157 -> {158}; 158 -> {159}; - 159 -> {160}; + 159 -> {141} [color=green style=dashed]; + 159 -> {160} [style=dotted]; 160 -> {161}; - - subgraph cluster_55 { - color=red - 162 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; - subgraph cluster_56 { - color=blue - 163 [label="Enter block"]; - subgraph cluster_57 { - color=blue - 164 [label="Enter do-while loop"]; - subgraph cluster_58 { - color=blue - 165 [label="Enter loop block"]; - subgraph cluster_59 { - color=blue - 166 [label="Enter block"]; - 167 [label="Const: Int(1)"]; - 168 [label="Exit block"]; - } - 169 [label="Exit loop block"]; - } - subgraph cluster_60 { - color=blue - 170 [label="Enter loop condition"]; - 171 [label="Const: Boolean(false)"]; - 172 [label="Exit loop condition"]; - } - 173 [label="Exit do-while loop"]; - } - 174 [label="Const: Int(1)"]; - 175 [label="Exit block"]; - } - 176 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; - } + 161 -> {162}; 162 -> {163}; - 163 -> {164}; + + subgraph cluster_56 { + color=red + 164 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_57 { + color=blue + 165 [label="Enter block"]; + subgraph cluster_58 { + color=blue + 166 [label="Enter do-while loop"]; + subgraph cluster_59 { + color=blue + 167 [label="Enter loop block"]; + subgraph cluster_60 { + color=blue + 168 [label="Enter block"]; + 169 [label="Const: Int(1)"]; + 170 [label="Exit block"]; + } + 171 [label="Exit loop block"]; + } + subgraph cluster_61 { + color=blue + 172 [label="Enter loop condition"]; + 173 [label="Const: Boolean(false)"]; + 174 [label="Exit loop condition"]; + } + 175 [label="Exit do-while loop"]; + } + 176 [label="Const: Int(1)"]; + 177 [label="Exit block"]; + } + 178 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; + } 164 -> {165}; 165 -> {166}; 166 -> {167}; @@ -544,9 +549,11 @@ digraph loops_kt { 170 -> {171}; 171 -> {172}; 172 -> {173}; - 172 -> {165} [color=green style=dotted]; 173 -> {174}; 174 -> {175}; + 174 -> {167} [color=green style=dotted]; 175 -> {176}; + 176 -> {177}; + 177 -> {178}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt index bc838da0b35..16fe8e939ca 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.fir.txt @@ -18,7 +18,10 @@ FILE: loops.kt lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() - lval y: R|kotlin/Boolean| = (R|/x| is R|kotlin/String|) + { + lval y: R|kotlin/Boolean| = (R|/x| is R|kotlin/String|) + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt index d356593d714..b067c06f9bc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.fir.txt @@ -27,7 +27,10 @@ FILE: enumValues.kt lval : R|kotlin/collections/Iterator| = R|/values|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval value: R|MyEnum| = R|/|.R|SubstitutionOverride|() - R|/value|.R|/MyEnum.bar|() + { + R|/value|.R|/MyEnum.bar|() + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt index a8e21a4b376..425cee759bd 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.fir.txt @@ -70,7 +70,10 @@ FILE: CanBeValChecker.kt lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(10)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() - R|kotlin/io/print|(R|/i|) + { + R|kotlin/io/print|(R|/i|) + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt index 7d60a909c74..2c9df25d453 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.fir.txt @@ -4,6 +4,9 @@ FILE: NoWarning.kt lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } @@ -21,6 +24,9 @@ FILE: NoWarning.kt lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/ranges/downTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } @@ -38,6 +44,9 @@ FILE: NoWarning.kt lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt index bf402f57d08..e97d3b23307 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.fir.txt @@ -4,6 +4,9 @@ FILE: Warning.kt lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } @@ -21,6 +24,9 @@ FILE: Warning.kt lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/downTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } @@ -38,6 +44,9 @@ FILE: Warning.kt lval : R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(1)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() + { + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt index de842724971..72cc3a7072b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.fir.txt @@ -7,15 +7,18 @@ FILE: manyLocalVariables.kt lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() - when () { - ==(R|/a|, Int(2)) -> { - R|/b| = R|/c| - R|/c| = R|/a| - } - else -> { - R|/b| = R|/a| - R|/c| = R|/b| + { + when () { + ==(R|/a|, Int(2)) -> { + R|/b| = R|/c| + R|/c| = R|/a| + } + else -> { + R|/b| = R|/a| + R|/c| = R|/b| + } } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt b/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt index c3b8eefeb2e..2cce7d09287 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/fib.fir.txt @@ -12,9 +12,12 @@ FILE: fib.kt lval : R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|/n|).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() - lval temp: R|kotlin/Int| = R|/current| - R|/current| = R|/current|.R|kotlin/Int.plus|(R|/prev|) - R|/prev| = R|/temp| + { + lval temp: R|kotlin/Int| = R|/current| + R|/current| = R|/current|.R|kotlin/Int.plus|(R|/prev|) + R|/prev| = R|/temp| + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt index 7de87934244..9e4b641833a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.fir.txt @@ -9,7 +9,10 @@ FILE: nestedExtensionFunctionType.kt lval : R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1>| = R|/ys|.R|SubstitutionOverride>|>|() while(R|/|.R|SubstitutionOverride|()) { lval y: R|A.() -> kotlin/Unit| = R|/|.R|SubstitutionOverride kotlin/Unit|>|() - R|/y|.R|SubstitutionOverride|(R|/a|) + { + R|/y|.R|SubstitutionOverride|(R|/a|) + } + } } @@ -20,7 +23,10 @@ FILE: nestedExtensionFunctionType.kt lval : R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1>| = R|/zs|.R|SubstitutionOverride)>|>|() while(R|/|.R|SubstitutionOverride|()) { lval z: R|A.() -> kotlin/Unit| = R|/|.R|SubstitutionOverride kotlin/Unit|>|() - R|/z|.R|SubstitutionOverride|(R|/a|) + { + R|/z|.R|SubstitutionOverride|(R|/a|) + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index 1ab18f3380c..0980b14a9ea 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -65,43 +65,48 @@ digraph boundSmartcastsInBranches_kt { 25 [label="Variable declaration: lval a: R|A|"]; subgraph cluster_10 { color=blue - 26 [label="Enter when"]; + 26 [label="Enter block"]; subgraph cluster_11 { color=blue - 27 [label="Enter when branch condition "]; - 28 [label="Access variable R|/goodA|"]; - 29 [label="Const: Null(null)"]; - 30 [label="Equality operator =="]; - 31 [label="Exit when branch condition"]; + 27 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 28 [label="Enter when branch condition "]; + 29 [label="Access variable R|/goodA|"]; + 30 [label="Const: Null(null)"]; + 31 [label="Equality operator =="]; + 32 [label="Exit when branch condition"]; + } + 33 [label="Synthetic else branch"]; + 34 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 35 [label="Enter block"]; + 36 [label="Access variable R|/a|"]; + 37 [label="Assignment: R|/goodA|"]; + 38 [label="Jump: continue@@@[R|/|.R|SubstitutionOverride|()] "]; + 39 [label="Stub" style="filled" fillcolor=gray]; + 40 [label="Exit block" style="filled" fillcolor=gray]; + } + 41 [label="Exit when branch result" style="filled" fillcolor=gray]; + 42 [label="Exit when"]; } - 32 [label="Synthetic else branch"]; - 33 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 34 [label="Enter block"]; - 35 [label="Access variable R|/a|"]; - 36 [label="Assignment: R|/goodA|"]; - 37 [label="Jump: continue@@@[R|/|.R|SubstitutionOverride|()] "]; - 38 [label="Stub" style="filled" fillcolor=gray]; - 39 [label="Exit block" style="filled" fillcolor=gray]; - } - 40 [label="Exit when branch result" style="filled" fillcolor=gray]; - 41 [label="Exit when"]; + 43 [label="Access variable R|/goodA|"]; + 44 [label="Smart cast: R|/goodA|"]; + 45 [label="Access variable R|/A.s|"]; + 46 [label="Exit block"]; } - 42 [label="Access variable R|/goodA|"]; - 43 [label="Smart cast: R|/goodA|"]; - 44 [label="Access variable R|/A.s|"]; - 45 [label="Exit block"]; + 47 [label="Exit block"]; } - 46 [label="Exit loop block"]; + 48 [label="Exit loop block"]; } - 47 [label="Exit while loop"]; + 49 [label="Exit while loop"]; } - 48 [label="Exit block"]; + 50 [label="Exit block"]; } - 49 [label="Exit block"]; + 51 [label="Exit block"]; } - 50 [label="Exit function test_0" style="filled" fillcolor=red]; + 52 [label="Exit function test_0" style="filled" fillcolor=red]; } 8 -> {9}; 9 -> {10}; @@ -115,7 +120,7 @@ digraph boundSmartcastsInBranches_kt { 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21 47}; + 20 -> {21 49}; 21 -> {22}; 22 -> {23}; 23 -> {24}; @@ -126,92 +131,92 @@ digraph boundSmartcastsInBranches_kt { 28 -> {29}; 29 -> {30}; 30 -> {31}; - 31 -> {32 33}; - 32 -> {41}; - 33 -> {34}; + 31 -> {32}; + 32 -> {33 34}; + 33 -> {42}; 34 -> {35}; 35 -> {36}; 36 -> {37}; - 37 -> {17} [color=green style=dashed]; - 37 -> {38} [style=dotted]; + 37 -> {38}; + 38 -> {17} [color=green style=dashed]; 38 -> {39} [style=dotted]; 39 -> {40} [style=dotted]; 40 -> {41} [style=dotted]; - 41 -> {42}; + 41 -> {42} [style=dotted]; 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {17} [color=green style=dashed]; + 46 -> {47}; 47 -> {48}; - 48 -> {49}; + 48 -> {17} [color=green style=dashed]; 49 -> {50}; + 50 -> {51}; + 51 -> {52}; - subgraph cluster_13 { + subgraph cluster_14 { color=red - 51 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_14 { + 53 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_15 { color=blue - 52 [label="Enter block"]; - 53 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_15 { + 54 [label="Enter block"]; + 55 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_16 { color=blue - 54 [label="Enter when"]; - subgraph cluster_16 { - color=blue - 55 [label="Enter when branch condition "]; - 56 [label="Access variable R|/b|"]; - 57 [label="Exit when branch condition"]; - } + 56 [label="Enter when"]; subgraph cluster_17 { color=blue - 58 [label="Enter when branch condition else"]; + 57 [label="Enter when branch condition "]; + 58 [label="Access variable R|/b|"]; 59 [label="Exit when branch condition"]; } - 60 [label="Enter when branch result"]; subgraph cluster_18 { color=blue - 61 [label="Enter block"]; - 62 [label="Access variable R|/a|"]; - 63 [label="Assignment: R|/x|"]; - 64 [label="Exit block"]; + 60 [label="Enter when branch condition else"]; + 61 [label="Exit when branch condition"]; } - 65 [label="Exit when branch result"]; - 66 [label="Enter when branch result"]; + 62 [label="Enter when branch result"]; subgraph cluster_19 { color=blue - 67 [label="Enter block"]; - 68 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; - 69 [label="Assignment: R|/x|"]; - 70 [label="Exit block"]; + 63 [label="Enter block"]; + 64 [label="Access variable R|/a|"]; + 65 [label="Assignment: R|/x|"]; + 66 [label="Exit block"]; } - 71 [label="Exit when branch result"]; - 72 [label="Exit when"]; + 67 [label="Exit when branch result"]; + 68 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 69 [label="Enter block"]; + 70 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; + 71 [label="Assignment: R|/x|"]; + 72 [label="Exit block"]; + } + 73 [label="Exit when branch result"]; + 74 [label="Exit when"]; } - 73 [label="Access variable R|/x|"]; - 74 [label="Smart cast: R|/x|"]; - 75 [label="Access variable R|/A.s|"]; - 76 [label="Exit block"]; + 75 [label="Access variable R|/x|"]; + 76 [label="Smart cast: R|/x|"]; + 77 [label="Access variable R|/A.s|"]; + 78 [label="Exit block"]; } - 77 [label="Exit function test_1" style="filled" fillcolor=red]; + 79 [label="Exit function test_1" style="filled" fillcolor=red]; } - 51 -> {52}; - 52 -> {53}; 53 -> {54}; 54 -> {55}; 55 -> {56}; 56 -> {57}; - 57 -> {58 66}; + 57 -> {58}; 58 -> {59}; - 59 -> {60}; + 59 -> {60 68}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; - 65 -> {72}; + 65 -> {66}; 66 -> {67}; - 67 -> {68}; + 67 -> {74}; 68 -> {69}; 69 -> {70}; 70 -> {71}; @@ -221,66 +226,66 @@ digraph boundSmartcastsInBranches_kt { 74 -> {75}; 75 -> {76}; 76 -> {77}; + 77 -> {78}; + 78 -> {79}; - subgraph cluster_20 { + subgraph cluster_21 { color=red - 78 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_21 { + 80 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_22 { color=blue - 79 [label="Enter block"]; - 80 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_22 { + 81 [label="Enter block"]; + 82 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_23 { color=blue - 81 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 82 [label="Enter when branch condition "]; - 83 [label="Access variable R|/b|"]; - 84 [label="Exit when branch condition"]; - } + 83 [label="Enter when"]; subgraph cluster_24 { color=blue - 85 [label="Enter when branch condition else"]; + 84 [label="Enter when branch condition "]; + 85 [label="Access variable R|/b|"]; 86 [label="Exit when branch condition"]; } - 87 [label="Enter when branch result"]; subgraph cluster_25 { color=blue - 88 [label="Enter block"]; - 89 [label="Access variable R|/a|"]; - 90 [label="Assignment: R|/x|"]; - 91 [label="Access variable R|/a|"]; - 92 [label="Type operator: (R|/a| as R|A|)"]; - 93 [label="Exit block"]; + 87 [label="Enter when branch condition else"]; + 88 [label="Exit when branch condition"]; } - 94 [label="Exit when branch result"]; - 95 [label="Enter when branch result"]; + 89 [label="Enter when branch result"]; subgraph cluster_26 { color=blue - 96 [label="Enter block"]; - 97 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; - 98 [label="Assignment: R|/x|"]; - 99 [label="Exit block"]; + 90 [label="Enter block"]; + 91 [label="Access variable R|/a|"]; + 92 [label="Assignment: R|/x|"]; + 93 [label="Access variable R|/a|"]; + 94 [label="Type operator: (R|/a| as R|A|)"]; + 95 [label="Exit block"]; } - 100 [label="Exit when branch result"]; - 101 [label="Exit when"]; + 96 [label="Exit when branch result"]; + 97 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 98 [label="Enter block"]; + 99 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; + 100 [label="Assignment: R|/x|"]; + 101 [label="Exit block"]; + } + 102 [label="Exit when branch result"]; + 103 [label="Exit when"]; } - 102 [label="Access variable R|/x|"]; - 103 [label="Smart cast: R|/x|"]; - 104 [label="Access variable R|/A.s|"]; - 105 [label="Exit block"]; + 104 [label="Access variable R|/x|"]; + 105 [label="Smart cast: R|/x|"]; + 106 [label="Access variable R|/A.s|"]; + 107 [label="Exit block"]; } - 106 [label="Exit function test_2" style="filled" fillcolor=red]; + 108 [label="Exit function test_2" style="filled" fillcolor=red]; } - 78 -> {79}; - 79 -> {80}; 80 -> {81}; 81 -> {82}; 82 -> {83}; 83 -> {84}; - 84 -> {85 95}; + 84 -> {85}; 85 -> {86}; - 86 -> {87}; + 86 -> {87 97}; 87 -> {88}; 88 -> {89}; 89 -> {90}; @@ -288,9 +293,9 @@ digraph boundSmartcastsInBranches_kt { 91 -> {92}; 92 -> {93}; 93 -> {94}; - 94 -> {101}; + 94 -> {95}; 95 -> {96}; - 96 -> {97}; + 96 -> {103}; 97 -> {98}; 98 -> {99}; 99 -> {100}; @@ -300,67 +305,67 @@ digraph boundSmartcastsInBranches_kt { 103 -> {104}; 104 -> {105}; 105 -> {106}; + 106 -> {107}; + 107 -> {108}; - subgraph cluster_27 { + subgraph cluster_28 { color=red - 107 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_28 { + 109 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_29 { color=blue - 108 [label="Enter block"]; - 109 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_29 { + 110 [label="Enter block"]; + 111 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_30 { color=blue - 110 [label="Enter when"]; - subgraph cluster_30 { - color=blue - 111 [label="Enter when branch condition "]; - 112 [label="Access variable R|/b|"]; - 113 [label="Exit when branch condition"]; - } + 112 [label="Enter when"]; subgraph cluster_31 { color=blue - 114 [label="Enter when branch condition else"]; + 113 [label="Enter when branch condition "]; + 114 [label="Access variable R|/b|"]; 115 [label="Exit when branch condition"]; } - 116 [label="Enter when branch result"]; subgraph cluster_32 { color=blue - 117 [label="Enter block"]; - 118 [label="Access variable R|/a|"]; - 119 [label="Type operator: (R|/a| as R|A|)"]; - 120 [label="Access variable R|/a|"]; - 121 [label="Smart cast: R|/a|"]; - 122 [label="Assignment: R|/x|"]; - 123 [label="Exit block"]; + 116 [label="Enter when branch condition else"]; + 117 [label="Exit when branch condition"]; } - 124 [label="Exit when branch result"]; - 125 [label="Enter when branch result"]; + 118 [label="Enter when branch result"]; subgraph cluster_33 { color=blue - 126 [label="Enter block"]; - 127 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; - 128 [label="Assignment: R|/x|"]; - 129 [label="Exit block"]; + 119 [label="Enter block"]; + 120 [label="Access variable R|/a|"]; + 121 [label="Type operator: (R|/a| as R|A|)"]; + 122 [label="Access variable R|/a|"]; + 123 [label="Smart cast: R|/a|"]; + 124 [label="Assignment: R|/x|"]; + 125 [label="Exit block"]; } - 130 [label="Exit when branch result"]; - 131 [label="Exit when"]; + 126 [label="Exit when branch result"]; + 127 [label="Enter when branch result"]; + subgraph cluster_34 { + color=blue + 128 [label="Enter block"]; + 129 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; + 130 [label="Assignment: R|/x|"]; + 131 [label="Exit block"]; + } + 132 [label="Exit when branch result"]; + 133 [label="Exit when"]; } - 132 [label="Access variable R|/x|"]; - 133 [label="Smart cast: R|/x|"]; - 134 [label="Access variable R|/A.s|"]; - 135 [label="Exit block"]; + 134 [label="Access variable R|/x|"]; + 135 [label="Smart cast: R|/x|"]; + 136 [label="Access variable R|/A.s|"]; + 137 [label="Exit block"]; } - 136 [label="Exit function test_3" style="filled" fillcolor=red]; + 138 [label="Exit function test_3" style="filled" fillcolor=red]; } - 107 -> {108}; - 108 -> {109}; 109 -> {110}; 110 -> {111}; 111 -> {112}; 112 -> {113}; - 113 -> {114 125}; + 113 -> {114}; 114 -> {115}; - 115 -> {116}; + 115 -> {116 127}; 116 -> {117}; 117 -> {118}; 118 -> {119}; @@ -369,9 +374,9 @@ digraph boundSmartcastsInBranches_kt { 121 -> {122}; 122 -> {123}; 123 -> {124}; - 124 -> {131}; + 124 -> {125}; 125 -> {126}; - 126 -> {127}; + 126 -> {133}; 127 -> {128}; 128 -> {129}; 129 -> {130}; @@ -381,77 +386,77 @@ digraph boundSmartcastsInBranches_kt { 133 -> {134}; 134 -> {135}; 135 -> {136}; + 136 -> {137}; + 137 -> {138}; - subgraph cluster_34 { + subgraph cluster_35 { color=red - 137 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_35 { + 139 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_36 { color=blue - 138 [label="Enter block"]; - 139 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_36 { + 140 [label="Enter block"]; + 141 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_37 { color=blue - 140 [label="Enter when"]; - subgraph cluster_37 { - color=blue - 141 [label="Enter when branch condition "]; - 142 [label="Access variable R|/b|"]; - 143 [label="Exit when branch condition"]; - } + 142 [label="Enter when"]; subgraph cluster_38 { color=blue - 144 [label="Enter when branch condition else"]; + 143 [label="Enter when branch condition "]; + 144 [label="Access variable R|/b|"]; 145 [label="Exit when branch condition"]; } - 146 [label="Enter when branch result"]; subgraph cluster_39 { color=blue - 147 [label="Enter block"]; - 148 [label="Access variable R|/a|"]; - 149 [label="Assignment: R|/x|"]; - 150 [label="Exit block"]; + 146 [label="Enter when branch condition else"]; + 147 [label="Exit when branch condition"]; } - 151 [label="Exit when branch result"]; - 152 [label="Enter when branch result"]; + 148 [label="Enter when branch result"]; subgraph cluster_40 { color=blue - 153 [label="Enter block"]; - 154 [label="Access variable R|/a|"]; - 155 [label="Assignment: R|/x|"]; - 156 [label="Exit block"]; + 149 [label="Enter block"]; + 150 [label="Access variable R|/a|"]; + 151 [label="Assignment: R|/x|"]; + 152 [label="Exit block"]; } - 157 [label="Exit when branch result"]; - 158 [label="Exit when"]; + 153 [label="Exit when branch result"]; + 154 [label="Enter when branch result"]; + subgraph cluster_41 { + color=blue + 155 [label="Enter block"]; + 156 [label="Access variable R|/a|"]; + 157 [label="Assignment: R|/x|"]; + 158 [label="Exit block"]; + } + 159 [label="Exit when branch result"]; + 160 [label="Exit when"]; } - 159 [label="Access variable R|/x|"]; - 160 [label="Type operator: (R|/x| as R|A|)"]; 161 [label="Access variable R|/x|"]; - 162 [label="Smart cast: R|/x|"]; - 163 [label="Access variable R|/A.s|"]; - 164 [label="Access variable R|/a|"]; - 165 [label="Smart cast: R|/a|"]; - 166 [label="Access variable R|/A.s|"]; - 167 [label="Exit block"]; + 162 [label="Type operator: (R|/x| as R|A|)"]; + 163 [label="Access variable R|/x|"]; + 164 [label="Smart cast: R|/x|"]; + 165 [label="Access variable R|/A.s|"]; + 166 [label="Access variable R|/a|"]; + 167 [label="Smart cast: R|/a|"]; + 168 [label="Access variable R|/A.s|"]; + 169 [label="Exit block"]; } - 168 [label="Exit function test_4" style="filled" fillcolor=red]; + 170 [label="Exit function test_4" style="filled" fillcolor=red]; } - 137 -> {138}; - 138 -> {139}; 139 -> {140}; 140 -> {141}; 141 -> {142}; 142 -> {143}; - 143 -> {144 152}; + 143 -> {144}; 144 -> {145}; - 145 -> {146}; + 145 -> {146 154}; 146 -> {147}; 147 -> {148}; 148 -> {149}; 149 -> {150}; 150 -> {151}; - 151 -> {158}; + 151 -> {152}; 152 -> {153}; - 153 -> {154}; + 153 -> {160}; 154 -> {155}; 155 -> {156}; 156 -> {157}; @@ -466,77 +471,77 @@ digraph boundSmartcastsInBranches_kt { 165 -> {166}; 166 -> {167}; 167 -> {168}; + 168 -> {169}; + 169 -> {170}; - subgraph cluster_41 { + subgraph cluster_42 { color=red - 169 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_42 { + 171 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_43 { color=blue - 170 [label="Enter block"]; - 171 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_43 { + 172 [label="Enter block"]; + 173 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_44 { color=blue - 172 [label="Enter when"]; - subgraph cluster_44 { - color=blue - 173 [label="Enter when branch condition "]; - 174 [label="Access variable R|/b|"]; - 175 [label="Exit when branch condition"]; - } + 174 [label="Enter when"]; subgraph cluster_45 { color=blue - 176 [label="Enter when branch condition else"]; + 175 [label="Enter when branch condition "]; + 176 [label="Access variable R|/b|"]; 177 [label="Exit when branch condition"]; } - 178 [label="Enter when branch result"]; subgraph cluster_46 { color=blue - 179 [label="Enter block"]; - 180 [label="Access variable R|/a|"]; - 181 [label="Assignment: R|/x|"]; - 182 [label="Exit block"]; + 178 [label="Enter when branch condition else"]; + 179 [label="Exit when branch condition"]; } - 183 [label="Exit when branch result"]; - 184 [label="Enter when branch result"]; + 180 [label="Enter when branch result"]; subgraph cluster_47 { color=blue - 185 [label="Enter block"]; - 186 [label="Access variable R|/a|"]; - 187 [label="Assignment: R|/x|"]; - 188 [label="Exit block"]; + 181 [label="Enter block"]; + 182 [label="Access variable R|/a|"]; + 183 [label="Assignment: R|/x|"]; + 184 [label="Exit block"]; } - 189 [label="Exit when branch result"]; - 190 [label="Exit when"]; + 185 [label="Exit when branch result"]; + 186 [label="Enter when branch result"]; + subgraph cluster_48 { + color=blue + 187 [label="Enter block"]; + 188 [label="Access variable R|/a|"]; + 189 [label="Assignment: R|/x|"]; + 190 [label="Exit block"]; + } + 191 [label="Exit when branch result"]; + 192 [label="Exit when"]; } - 191 [label="Access variable R|/a|"]; - 192 [label="Type operator: (R|/a| as R|A|)"]; - 193 [label="Access variable R|/x|"]; - 194 [label="Smart cast: R|/x|"]; - 195 [label="Access variable R|/A.s|"]; - 196 [label="Access variable R|/a|"]; - 197 [label="Smart cast: R|/a|"]; - 198 [label="Access variable R|/A.s|"]; - 199 [label="Exit block"]; + 193 [label="Access variable R|/a|"]; + 194 [label="Type operator: (R|/a| as R|A|)"]; + 195 [label="Access variable R|/x|"]; + 196 [label="Smart cast: R|/x|"]; + 197 [label="Access variable R|/A.s|"]; + 198 [label="Access variable R|/a|"]; + 199 [label="Smart cast: R|/a|"]; + 200 [label="Access variable R|/A.s|"]; + 201 [label="Exit block"]; } - 200 [label="Exit function test_5" style="filled" fillcolor=red]; + 202 [label="Exit function test_5" style="filled" fillcolor=red]; } - 169 -> {170}; - 170 -> {171}; 171 -> {172}; 172 -> {173}; 173 -> {174}; 174 -> {175}; - 175 -> {176 184}; + 175 -> {176}; 176 -> {177}; - 177 -> {178}; + 177 -> {178 186}; 178 -> {179}; 179 -> {180}; 180 -> {181}; 181 -> {182}; 182 -> {183}; - 183 -> {190}; + 183 -> {184}; 184 -> {185}; - 185 -> {186}; + 185 -> {192}; 186 -> {187}; 187 -> {188}; 188 -> {189}; @@ -551,25 +556,25 @@ digraph boundSmartcastsInBranches_kt { 197 -> {198}; 198 -> {199}; 199 -> {200}; - - subgraph cluster_48 { - color=red - 201 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_49 { - color=blue - 202 [label="Enter block"]; - 203 [label="Variable declaration: lval x: R|kotlin/Any|"]; - 204 [label="Access variable R|/a|"]; - 205 [label="Assignment: R|/x|"]; - 206 [label="Access variable R|/x|"]; - 207 [label="Smart cast: R|/x|"]; - 208 [label="Access variable R|/A.s|"]; - 209 [label="Exit block"]; - } - 210 [label="Exit function test_6" style="filled" fillcolor=red]; - } + 200 -> {201}; 201 -> {202}; - 202 -> {203}; + + subgraph cluster_49 { + color=red + 203 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_50 { + color=blue + 204 [label="Enter block"]; + 205 [label="Variable declaration: lval x: R|kotlin/Any|"]; + 206 [label="Access variable R|/a|"]; + 207 [label="Assignment: R|/x|"]; + 208 [label="Access variable R|/x|"]; + 209 [label="Smart cast: R|/x|"]; + 210 [label="Access variable R|/A.s|"]; + 211 [label="Exit block"]; + } + 212 [label="Exit function test_6" style="filled" fillcolor=red]; + } 203 -> {204}; 204 -> {205}; 205 -> {206}; @@ -577,199 +582,199 @@ digraph boundSmartcastsInBranches_kt { 207 -> {208}; 208 -> {209}; 209 -> {210}; + 210 -> {211}; + 211 -> {212}; - subgraph cluster_50 { + subgraph cluster_51 { color=red - 211 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_51 { + 213 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_52 { color=blue - 212 [label="Enter block"]; - 213 [label="Const: Null(null)"]; - 214 [label="Variable declaration: lval z: R|kotlin/String?|"]; - 215 [label="Access variable R|/z|"]; - 216 [label="Variable declaration: lvar y: R|kotlin/String?|"]; - 217 [label="Access variable R|/y|"]; - 218 [label="Variable declaration: lval x: R|kotlin/String?|"]; - subgraph cluster_52 { + 214 [label="Enter block"]; + 215 [label="Const: Null(null)"]; + 216 [label="Variable declaration: lval z: R|kotlin/String?|"]; + 217 [label="Access variable R|/z|"]; + 218 [label="Variable declaration: lvar y: R|kotlin/String?|"]; + 219 [label="Access variable R|/y|"]; + 220 [label="Variable declaration: lval x: R|kotlin/String?|"]; + subgraph cluster_53 { color=blue - 219 [label="Enter when"]; - subgraph cluster_53 { - color=blue - 220 [label="Enter when branch condition "]; - 221 [label="Access variable R|/x|"]; - 222 [label="Const: Null(null)"]; - 223 [label="Equality operator !="]; - 224 [label="Exit when branch condition"]; - } - 225 [label="Synthetic else branch"]; - 226 [label="Enter when branch result"]; + 221 [label="Enter when"]; subgraph cluster_54 { color=blue - 227 [label="Enter block"]; - 228 [label="Access variable R|/x|"]; - 229 [label="Smart cast: R|/x|"]; - 230 [label="Access variable R|kotlin/String.length|"]; - 231 [label="Access variable R|/y|"]; - 232 [label="Access variable R|kotlin/String.length#|"]; - 233 [label="Access variable R|/z|"]; - 234 [label="Access variable R|kotlin/String.length#|"]; - 235 [label="Exit block"]; + 222 [label="Enter when branch condition "]; + 223 [label="Access variable R|/x|"]; + 224 [label="Const: Null(null)"]; + 225 [label="Equality operator !="]; + 226 [label="Exit when branch condition"]; } - 236 [label="Exit when branch result"]; - 237 [label="Exit when"]; - } - subgraph cluster_55 { - color=blue - 238 [label="Enter when"]; - subgraph cluster_56 { + 227 [label="Synthetic else branch"]; + 228 [label="Enter when branch result"]; + subgraph cluster_55 { color=blue - 239 [label="Enter when branch condition "]; - 240 [label="Access variable R|/y|"]; - 241 [label="Const: Null(null)"]; - 242 [label="Equality operator !="]; - 243 [label="Exit when branch condition"]; + 229 [label="Enter block"]; + 230 [label="Access variable R|/x|"]; + 231 [label="Smart cast: R|/x|"]; + 232 [label="Access variable R|kotlin/String.length|"]; + 233 [label="Access variable R|/y|"]; + 234 [label="Access variable R|kotlin/String.length#|"]; + 235 [label="Access variable R|/z|"]; + 236 [label="Access variable R|kotlin/String.length#|"]; + 237 [label="Exit block"]; } - 244 [label="Synthetic else branch"]; - 245 [label="Enter when branch result"]; + 238 [label="Exit when branch result"]; + 239 [label="Exit when"]; + } + subgraph cluster_56 { + color=blue + 240 [label="Enter when"]; subgraph cluster_57 { color=blue - 246 [label="Enter block"]; - 247 [label="Access variable R|/x|"]; - 248 [label="Access variable R|kotlin/String.length#|"]; - 249 [label="Access variable R|/y|"]; - 250 [label="Smart cast: R|/y|"]; - 251 [label="Access variable R|kotlin/String.length|"]; - 252 [label="Access variable R|/z|"]; - 253 [label="Access variable R|kotlin/String.length#|"]; - 254 [label="Exit block"]; + 241 [label="Enter when branch condition "]; + 242 [label="Access variable R|/y|"]; + 243 [label="Const: Null(null)"]; + 244 [label="Equality operator !="]; + 245 [label="Exit when branch condition"]; } - 255 [label="Exit when branch result"]; - 256 [label="Exit when"]; - } - subgraph cluster_58 { - color=blue - 257 [label="Enter when"]; - subgraph cluster_59 { + 246 [label="Synthetic else branch"]; + 247 [label="Enter when branch result"]; + subgraph cluster_58 { color=blue - 258 [label="Enter when branch condition "]; - 259 [label="Access variable R|/z|"]; - 260 [label="Const: Null(null)"]; - 261 [label="Equality operator !="]; - 262 [label="Exit when branch condition"]; + 248 [label="Enter block"]; + 249 [label="Access variable R|/x|"]; + 250 [label="Access variable R|kotlin/String.length#|"]; + 251 [label="Access variable R|/y|"]; + 252 [label="Smart cast: R|/y|"]; + 253 [label="Access variable R|kotlin/String.length|"]; + 254 [label="Access variable R|/z|"]; + 255 [label="Access variable R|kotlin/String.length#|"]; + 256 [label="Exit block"]; } - 263 [label="Synthetic else branch"]; - 264 [label="Enter when branch result"]; + 257 [label="Exit when branch result"]; + 258 [label="Exit when"]; + } + subgraph cluster_59 { + color=blue + 259 [label="Enter when"]; subgraph cluster_60 { color=blue - 265 [label="Enter block"]; - 266 [label="Access variable R|/x|"]; - 267 [label="Access variable R|kotlin/String.length#|"]; - 268 [label="Access variable R|/y|"]; - 269 [label="Access variable R|kotlin/String.length#|"]; - 270 [label="Access variable R|/z|"]; - 271 [label="Smart cast: R|/z|"]; - 272 [label="Access variable R|kotlin/String.length|"]; - 273 [label="Exit block"]; + 260 [label="Enter when branch condition "]; + 261 [label="Access variable R|/z|"]; + 262 [label="Const: Null(null)"]; + 263 [label="Equality operator !="]; + 264 [label="Exit when branch condition"]; } - 274 [label="Exit when branch result"]; - 275 [label="Exit when"]; - } - 276 [label="Const: Null(null)"]; - 277 [label="Assignment: R|/y|"]; - subgraph cluster_61 { - color=blue - 278 [label="Enter when"]; - subgraph cluster_62 { + 265 [label="Synthetic else branch"]; + 266 [label="Enter when branch result"]; + subgraph cluster_61 { color=blue - 279 [label="Enter when branch condition "]; - 280 [label="Access variable R|/x|"]; - 281 [label="Const: Null(null)"]; - 282 [label="Equality operator !="]; - 283 [label="Exit when branch condition"]; + 267 [label="Enter block"]; + 268 [label="Access variable R|/x|"]; + 269 [label="Access variable R|kotlin/String.length#|"]; + 270 [label="Access variable R|/y|"]; + 271 [label="Access variable R|kotlin/String.length#|"]; + 272 [label="Access variable R|/z|"]; + 273 [label="Smart cast: R|/z|"]; + 274 [label="Access variable R|kotlin/String.length|"]; + 275 [label="Exit block"]; } - 284 [label="Synthetic else branch"]; - 285 [label="Enter when branch result"]; + 276 [label="Exit when branch result"]; + 277 [label="Exit when"]; + } + 278 [label="Const: Null(null)"]; + 279 [label="Assignment: R|/y|"]; + subgraph cluster_62 { + color=blue + 280 [label="Enter when"]; subgraph cluster_63 { color=blue - 286 [label="Enter block"]; - 287 [label="Access variable R|/x|"]; - 288 [label="Smart cast: R|/x|"]; - 289 [label="Access variable R|kotlin/String.length|"]; - 290 [label="Access variable R|/y|"]; - 291 [label="Smart cast: R|/y|"]; - 292 [label="Access variable R|kotlin/String.length#|"]; - 293 [label="Access variable R|/z|"]; - 294 [label="Access variable R|kotlin/String.length#|"]; - 295 [label="Exit block"]; + 281 [label="Enter when branch condition "]; + 282 [label="Access variable R|/x|"]; + 283 [label="Const: Null(null)"]; + 284 [label="Equality operator !="]; + 285 [label="Exit when branch condition"]; } - 296 [label="Exit when branch result"]; - 297 [label="Exit when"]; - } - subgraph cluster_64 { - color=blue - 298 [label="Enter when"]; - subgraph cluster_65 { + 286 [label="Synthetic else branch"]; + 287 [label="Enter when branch result"]; + subgraph cluster_64 { color=blue - 299 [label="Enter when branch condition "]; - 300 [label="Access variable R|/y|"]; - 301 [label="Smart cast: R|/y|"]; - 302 [label="Const: Null(null)"]; - 303 [label="Equality operator !="]; - 304 [label="Exit when branch condition"]; + 288 [label="Enter block"]; + 289 [label="Access variable R|/x|"]; + 290 [label="Smart cast: R|/x|"]; + 291 [label="Access variable R|kotlin/String.length|"]; + 292 [label="Access variable R|/y|"]; + 293 [label="Smart cast: R|/y|"]; + 294 [label="Access variable R|kotlin/String.length#|"]; + 295 [label="Access variable R|/z|"]; + 296 [label="Access variable R|kotlin/String.length#|"]; + 297 [label="Exit block"]; } - 305 [label="Synthetic else branch"]; - 306 [label="Enter when branch result"]; + 298 [label="Exit when branch result"]; + 299 [label="Exit when"]; + } + subgraph cluster_65 { + color=blue + 300 [label="Enter when"]; subgraph cluster_66 { color=blue - 307 [label="Enter block"]; - 308 [label="Access variable R|/x|"]; - 309 [label="Access variable R|kotlin/String.length#|"]; - 310 [label="Access variable R|/y|"]; - 311 [label="Smart cast: R|/y|"]; - 312 [label="Stub" style="filled" fillcolor=gray]; - 313 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; - 314 [label="Access variable R|/z|" style="filled" fillcolor=gray]; - 315 [label="Access variable R|kotlin/String.length#|" style="filled" fillcolor=gray]; - 316 [label="Exit block" style="filled" fillcolor=gray]; + 301 [label="Enter when branch condition "]; + 302 [label="Access variable R|/y|"]; + 303 [label="Smart cast: R|/y|"]; + 304 [label="Const: Null(null)"]; + 305 [label="Equality operator !="]; + 306 [label="Exit when branch condition"]; } - 317 [label="Exit when branch result" style="filled" fillcolor=gray]; - 318 [label="Exit when"]; - } - subgraph cluster_67 { - color=blue - 319 [label="Enter when"]; - subgraph cluster_68 { + 307 [label="Synthetic else branch"]; + 308 [label="Enter when branch result"]; + subgraph cluster_67 { color=blue - 320 [label="Enter when branch condition "]; - 321 [label="Access variable R|/z|"]; - 322 [label="Const: Null(null)"]; - 323 [label="Equality operator !="]; - 324 [label="Exit when branch condition"]; + 309 [label="Enter block"]; + 310 [label="Access variable R|/x|"]; + 311 [label="Access variable R|kotlin/String.length#|"]; + 312 [label="Access variable R|/y|"]; + 313 [label="Smart cast: R|/y|"]; + 314 [label="Stub" style="filled" fillcolor=gray]; + 315 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; + 316 [label="Access variable R|/z|" style="filled" fillcolor=gray]; + 317 [label="Access variable R|kotlin/String.length#|" style="filled" fillcolor=gray]; + 318 [label="Exit block" style="filled" fillcolor=gray]; } - 325 [label="Synthetic else branch"]; - 326 [label="Enter when branch result"]; + 319 [label="Exit when branch result" style="filled" fillcolor=gray]; + 320 [label="Exit when"]; + } + subgraph cluster_68 { + color=blue + 321 [label="Enter when"]; subgraph cluster_69 { color=blue - 327 [label="Enter block"]; - 328 [label="Access variable R|/x|"]; - 329 [label="Access variable R|kotlin/String.length#|"]; - 330 [label="Access variable R|/y|"]; - 331 [label="Smart cast: R|/y|"]; - 332 [label="Access variable R|kotlin/String.length#|"]; - 333 [label="Access variable R|/z|"]; - 334 [label="Smart cast: R|/z|"]; - 335 [label="Access variable R|kotlin/String.length|"]; - 336 [label="Exit block"]; + 322 [label="Enter when branch condition "]; + 323 [label="Access variable R|/z|"]; + 324 [label="Const: Null(null)"]; + 325 [label="Equality operator !="]; + 326 [label="Exit when branch condition"]; } - 337 [label="Exit when branch result"]; - 338 [label="Exit when"]; + 327 [label="Synthetic else branch"]; + 328 [label="Enter when branch result"]; + subgraph cluster_70 { + color=blue + 329 [label="Enter block"]; + 330 [label="Access variable R|/x|"]; + 331 [label="Access variable R|kotlin/String.length#|"]; + 332 [label="Access variable R|/y|"]; + 333 [label="Smart cast: R|/y|"]; + 334 [label="Access variable R|kotlin/String.length#|"]; + 335 [label="Access variable R|/z|"]; + 336 [label="Smart cast: R|/z|"]; + 337 [label="Access variable R|kotlin/String.length|"]; + 338 [label="Exit block"]; + } + 339 [label="Exit when branch result"]; + 340 [label="Exit when"]; } - 339 [label="Exit block"]; + 341 [label="Exit block"]; } - 340 [label="Exit function test_7" style="filled" fillcolor=red]; + 342 [label="Exit function test_7" style="filled" fillcolor=red]; } - 211 -> {212}; - 212 -> {213}; 213 -> {214}; 214 -> {215}; 215 -> {216}; @@ -781,10 +786,10 @@ digraph boundSmartcastsInBranches_kt { 221 -> {222}; 222 -> {223}; 223 -> {224}; - 224 -> {225 226}; - 225 -> {237}; - 226 -> {227}; - 227 -> {228}; + 224 -> {225}; + 225 -> {226}; + 226 -> {227 228}; + 227 -> {239}; 228 -> {229}; 229 -> {230}; 230 -> {231}; @@ -800,10 +805,10 @@ digraph boundSmartcastsInBranches_kt { 240 -> {241}; 241 -> {242}; 242 -> {243}; - 243 -> {244 245}; - 244 -> {256}; - 245 -> {246}; - 246 -> {247}; + 243 -> {244}; + 244 -> {245}; + 245 -> {246 247}; + 246 -> {258}; 247 -> {248}; 248 -> {249}; 249 -> {250}; @@ -819,10 +824,10 @@ digraph boundSmartcastsInBranches_kt { 259 -> {260}; 260 -> {261}; 261 -> {262}; - 262 -> {263 264}; - 263 -> {275}; - 264 -> {265}; - 265 -> {266}; + 262 -> {263}; + 263 -> {264}; + 264 -> {265 266}; + 265 -> {277}; 266 -> {267}; 267 -> {268}; 268 -> {269}; @@ -840,10 +845,10 @@ digraph boundSmartcastsInBranches_kt { 280 -> {281}; 281 -> {282}; 282 -> {283}; - 283 -> {284 285}; - 284 -> {297}; - 285 -> {286}; - 286 -> {287}; + 283 -> {284}; + 284 -> {285}; + 285 -> {286 287}; + 286 -> {299}; 287 -> {288}; 288 -> {289}; 289 -> {290}; @@ -861,30 +866,30 @@ digraph boundSmartcastsInBranches_kt { 301 -> {302}; 302 -> {303}; 303 -> {304}; - 304 -> {305 306}; - 305 -> {318}; - 306 -> {307}; - 307 -> {308}; + 304 -> {305}; + 305 -> {306}; + 306 -> {307 308}; + 307 -> {320}; 308 -> {309}; 309 -> {310}; 310 -> {311}; - 311 -> {312} [style=dotted]; - 312 -> {313} [style=dotted]; + 311 -> {312}; + 312 -> {313}; 313 -> {314} [style=dotted]; 314 -> {315} [style=dotted]; 315 -> {316} [style=dotted]; 316 -> {317} [style=dotted]; 317 -> {318} [style=dotted]; - 318 -> {319}; - 319 -> {320}; + 318 -> {319} [style=dotted]; + 319 -> {320} [style=dotted]; 320 -> {321}; 321 -> {322}; 322 -> {323}; 323 -> {324}; - 324 -> {325 326}; - 325 -> {338}; - 326 -> {327}; - 327 -> {328}; + 324 -> {325}; + 325 -> {326}; + 326 -> {327 328}; + 327 -> {340}; 328 -> {329}; 329 -> {330}; 330 -> {331}; @@ -897,207 +902,207 @@ digraph boundSmartcastsInBranches_kt { 337 -> {338}; 338 -> {339}; 339 -> {340}; + 340 -> {341}; + 341 -> {342}; - subgraph cluster_70 { + subgraph cluster_71 { color=red - 341 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_71 { + 343 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_72 { color=blue - 342 [label="Enter block"]; - 343 [label="Const: Null(null)"]; - 344 [label="Variable declaration: lval z: R|kotlin/String?|"]; - 345 [label="Access variable R|/z|"]; - 346 [label="Variable declaration: lvar y: R|kotlin/String?|"]; - 347 [label="Access variable R|/y|"]; - 348 [label="Variable declaration: lval x: R|kotlin/String?|"]; - subgraph cluster_72 { + 344 [label="Enter block"]; + 345 [label="Const: Null(null)"]; + 346 [label="Variable declaration: lval z: R|kotlin/String?|"]; + 347 [label="Access variable R|/z|"]; + 348 [label="Variable declaration: lvar y: R|kotlin/String?|"]; + 349 [label="Access variable R|/y|"]; + 350 [label="Variable declaration: lval x: R|kotlin/String?|"]; + subgraph cluster_73 { color=blue - 349 [label="Enter when"]; - subgraph cluster_73 { - color=blue - 350 [label="Enter when branch condition "]; - 351 [label="Access variable R|/x|"]; - 352 [label="Const: Null(null)"]; - 353 [label="Equality operator !="]; - 354 [label="Exit when branch condition"]; - } - 355 [label="Synthetic else branch"]; - 356 [label="Enter when branch result"]; + 351 [label="Enter when"]; subgraph cluster_74 { color=blue - 357 [label="Enter block"]; - 358 [label="Access variable R|/x|"]; - 359 [label="Smart cast: R|/x|"]; - 360 [label="Access variable R|kotlin/String.length|"]; - 361 [label="Access variable R|/y|"]; - 362 [label="Smart cast: R|/y|"]; - 363 [label="Access variable R|kotlin/String.length|"]; - 364 [label="Access variable R|/z|"]; - 365 [label="Smart cast: R|/z|"]; - 366 [label="Access variable R|kotlin/String.length|"]; - 367 [label="Exit block"]; + 352 [label="Enter when branch condition "]; + 353 [label="Access variable R|/x|"]; + 354 [label="Const: Null(null)"]; + 355 [label="Equality operator !="]; + 356 [label="Exit when branch condition"]; } - 368 [label="Exit when branch result"]; - 369 [label="Exit when"]; - } - subgraph cluster_75 { - color=blue - 370 [label="Enter when"]; - subgraph cluster_76 { + 357 [label="Synthetic else branch"]; + 358 [label="Enter when branch result"]; + subgraph cluster_75 { color=blue - 371 [label="Enter when branch condition "]; - 372 [label="Access variable R|/y|"]; - 373 [label="Const: Null(null)"]; - 374 [label="Equality operator !="]; - 375 [label="Exit when branch condition"]; + 359 [label="Enter block"]; + 360 [label="Access variable R|/x|"]; + 361 [label="Smart cast: R|/x|"]; + 362 [label="Access variable R|kotlin/String.length|"]; + 363 [label="Access variable R|/y|"]; + 364 [label="Smart cast: R|/y|"]; + 365 [label="Access variable R|kotlin/String.length|"]; + 366 [label="Access variable R|/z|"]; + 367 [label="Smart cast: R|/z|"]; + 368 [label="Access variable R|kotlin/String.length|"]; + 369 [label="Exit block"]; } - 376 [label="Synthetic else branch"]; - 377 [label="Enter when branch result"]; + 370 [label="Exit when branch result"]; + 371 [label="Exit when"]; + } + subgraph cluster_76 { + color=blue + 372 [label="Enter when"]; subgraph cluster_77 { color=blue - 378 [label="Enter block"]; - 379 [label="Access variable R|/x|"]; - 380 [label="Smart cast: R|/x|"]; - 381 [label="Access variable R|kotlin/String.length|"]; - 382 [label="Access variable R|/y|"]; - 383 [label="Smart cast: R|/y|"]; - 384 [label="Access variable R|kotlin/String.length|"]; - 385 [label="Access variable R|/z|"]; - 386 [label="Smart cast: R|/z|"]; - 387 [label="Access variable R|kotlin/String.length|"]; - 388 [label="Exit block"]; + 373 [label="Enter when branch condition "]; + 374 [label="Access variable R|/y|"]; + 375 [label="Const: Null(null)"]; + 376 [label="Equality operator !="]; + 377 [label="Exit when branch condition"]; } - 389 [label="Exit when branch result"]; - 390 [label="Exit when"]; - } - subgraph cluster_78 { - color=blue - 391 [label="Enter when"]; - subgraph cluster_79 { + 378 [label="Synthetic else branch"]; + 379 [label="Enter when branch result"]; + subgraph cluster_78 { color=blue - 392 [label="Enter when branch condition "]; - 393 [label="Access variable R|/z|"]; - 394 [label="Const: Null(null)"]; - 395 [label="Equality operator !="]; - 396 [label="Exit when branch condition"]; + 380 [label="Enter block"]; + 381 [label="Access variable R|/x|"]; + 382 [label="Smart cast: R|/x|"]; + 383 [label="Access variable R|kotlin/String.length|"]; + 384 [label="Access variable R|/y|"]; + 385 [label="Smart cast: R|/y|"]; + 386 [label="Access variable R|kotlin/String.length|"]; + 387 [label="Access variable R|/z|"]; + 388 [label="Smart cast: R|/z|"]; + 389 [label="Access variable R|kotlin/String.length|"]; + 390 [label="Exit block"]; } - 397 [label="Synthetic else branch"]; - 398 [label="Enter when branch result"]; + 391 [label="Exit when branch result"]; + 392 [label="Exit when"]; + } + subgraph cluster_79 { + color=blue + 393 [label="Enter when"]; subgraph cluster_80 { color=blue - 399 [label="Enter block"]; - 400 [label="Access variable R|/x|"]; - 401 [label="Smart cast: R|/x|"]; - 402 [label="Access variable R|kotlin/String.length|"]; - 403 [label="Access variable R|/y|"]; - 404 [label="Smart cast: R|/y|"]; - 405 [label="Access variable R|kotlin/String.length|"]; - 406 [label="Access variable R|/z|"]; - 407 [label="Smart cast: R|/z|"]; - 408 [label="Access variable R|kotlin/String.length|"]; - 409 [label="Exit block"]; + 394 [label="Enter when branch condition "]; + 395 [label="Access variable R|/z|"]; + 396 [label="Const: Null(null)"]; + 397 [label="Equality operator !="]; + 398 [label="Exit when branch condition"]; } - 410 [label="Exit when branch result"]; - 411 [label="Exit when"]; - } - 412 [label="Const: Null(null)"]; - 413 [label="Assignment: R|/y|"]; - subgraph cluster_81 { - color=blue - 414 [label="Enter when"]; - subgraph cluster_82 { + 399 [label="Synthetic else branch"]; + 400 [label="Enter when branch result"]; + subgraph cluster_81 { color=blue - 415 [label="Enter when branch condition "]; - 416 [label="Access variable R|/x|"]; - 417 [label="Const: Null(null)"]; - 418 [label="Equality operator !="]; - 419 [label="Exit when branch condition"]; + 401 [label="Enter block"]; + 402 [label="Access variable R|/x|"]; + 403 [label="Smart cast: R|/x|"]; + 404 [label="Access variable R|kotlin/String.length|"]; + 405 [label="Access variable R|/y|"]; + 406 [label="Smart cast: R|/y|"]; + 407 [label="Access variable R|kotlin/String.length|"]; + 408 [label="Access variable R|/z|"]; + 409 [label="Smart cast: R|/z|"]; + 410 [label="Access variable R|kotlin/String.length|"]; + 411 [label="Exit block"]; } - 420 [label="Synthetic else branch"]; - 421 [label="Enter when branch result"]; + 412 [label="Exit when branch result"]; + 413 [label="Exit when"]; + } + 414 [label="Const: Null(null)"]; + 415 [label="Assignment: R|/y|"]; + subgraph cluster_82 { + color=blue + 416 [label="Enter when"]; subgraph cluster_83 { color=blue - 422 [label="Enter block"]; - 423 [label="Access variable R|/x|"]; - 424 [label="Smart cast: R|/x|"]; - 425 [label="Access variable R|kotlin/String.length|"]; - 426 [label="Access variable R|/y|"]; - 427 [label="Smart cast: R|/y|"]; - 428 [label="Access variable R|kotlin/String.length#|"]; - 429 [label="Access variable R|/z|"]; - 430 [label="Smart cast: R|/z|"]; - 431 [label="Access variable R|kotlin/String.length|"]; - 432 [label="Exit block"]; + 417 [label="Enter when branch condition "]; + 418 [label="Access variable R|/x|"]; + 419 [label="Const: Null(null)"]; + 420 [label="Equality operator !="]; + 421 [label="Exit when branch condition"]; } - 433 [label="Exit when branch result"]; - 434 [label="Exit when"]; - } - subgraph cluster_84 { - color=blue - 435 [label="Enter when"]; - subgraph cluster_85 { + 422 [label="Synthetic else branch"]; + 423 [label="Enter when branch result"]; + subgraph cluster_84 { color=blue - 436 [label="Enter when branch condition "]; - 437 [label="Access variable R|/y|"]; - 438 [label="Smart cast: R|/y|"]; - 439 [label="Const: Null(null)"]; - 440 [label="Equality operator !="]; - 441 [label="Exit when branch condition"]; + 424 [label="Enter block"]; + 425 [label="Access variable R|/x|"]; + 426 [label="Smart cast: R|/x|"]; + 427 [label="Access variable R|kotlin/String.length|"]; + 428 [label="Access variable R|/y|"]; + 429 [label="Smart cast: R|/y|"]; + 430 [label="Access variable R|kotlin/String.length#|"]; + 431 [label="Access variable R|/z|"]; + 432 [label="Smart cast: R|/z|"]; + 433 [label="Access variable R|kotlin/String.length|"]; + 434 [label="Exit block"]; } - 442 [label="Synthetic else branch"]; - 443 [label="Enter when branch result"]; + 435 [label="Exit when branch result"]; + 436 [label="Exit when"]; + } + subgraph cluster_85 { + color=blue + 437 [label="Enter when"]; subgraph cluster_86 { color=blue - 444 [label="Enter block"]; - 445 [label="Access variable R|/x|"]; - 446 [label="Access variable R|kotlin/String.length#|"]; - 447 [label="Access variable R|/y|"]; - 448 [label="Smart cast: R|/y|"]; - 449 [label="Stub" style="filled" fillcolor=gray]; - 450 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; - 451 [label="Access variable R|/z|" style="filled" fillcolor=gray]; - 452 [label="Access variable R|kotlin/String.length#|" style="filled" fillcolor=gray]; - 453 [label="Exit block" style="filled" fillcolor=gray]; + 438 [label="Enter when branch condition "]; + 439 [label="Access variable R|/y|"]; + 440 [label="Smart cast: R|/y|"]; + 441 [label="Const: Null(null)"]; + 442 [label="Equality operator !="]; + 443 [label="Exit when branch condition"]; } - 454 [label="Exit when branch result" style="filled" fillcolor=gray]; - 455 [label="Exit when"]; - } - subgraph cluster_87 { - color=blue - 456 [label="Enter when"]; - subgraph cluster_88 { + 444 [label="Synthetic else branch"]; + 445 [label="Enter when branch result"]; + subgraph cluster_87 { color=blue - 457 [label="Enter when branch condition "]; - 458 [label="Access variable R|/z|"]; - 459 [label="Const: Null(null)"]; - 460 [label="Equality operator !="]; - 461 [label="Exit when branch condition"]; + 446 [label="Enter block"]; + 447 [label="Access variable R|/x|"]; + 448 [label="Access variable R|kotlin/String.length#|"]; + 449 [label="Access variable R|/y|"]; + 450 [label="Smart cast: R|/y|"]; + 451 [label="Stub" style="filled" fillcolor=gray]; + 452 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; + 453 [label="Access variable R|/z|" style="filled" fillcolor=gray]; + 454 [label="Access variable R|kotlin/String.length#|" style="filled" fillcolor=gray]; + 455 [label="Exit block" style="filled" fillcolor=gray]; } - 462 [label="Synthetic else branch"]; - 463 [label="Enter when branch result"]; + 456 [label="Exit when branch result" style="filled" fillcolor=gray]; + 457 [label="Exit when"]; + } + subgraph cluster_88 { + color=blue + 458 [label="Enter when"]; subgraph cluster_89 { color=blue - 464 [label="Enter block"]; - 465 [label="Access variable R|/x|"]; - 466 [label="Smart cast: R|/x|"]; - 467 [label="Access variable R|kotlin/String.length|"]; - 468 [label="Access variable R|/y|"]; - 469 [label="Smart cast: R|/y|"]; - 470 [label="Access variable R|kotlin/String.length#|"]; - 471 [label="Access variable R|/z|"]; - 472 [label="Smart cast: R|/z|"]; - 473 [label="Access variable R|kotlin/String.length|"]; - 474 [label="Exit block"]; + 459 [label="Enter when branch condition "]; + 460 [label="Access variable R|/z|"]; + 461 [label="Const: Null(null)"]; + 462 [label="Equality operator !="]; + 463 [label="Exit when branch condition"]; } - 475 [label="Exit when branch result"]; - 476 [label="Exit when"]; + 464 [label="Synthetic else branch"]; + 465 [label="Enter when branch result"]; + subgraph cluster_90 { + color=blue + 466 [label="Enter block"]; + 467 [label="Access variable R|/x|"]; + 468 [label="Smart cast: R|/x|"]; + 469 [label="Access variable R|kotlin/String.length|"]; + 470 [label="Access variable R|/y|"]; + 471 [label="Smart cast: R|/y|"]; + 472 [label="Access variable R|kotlin/String.length#|"]; + 473 [label="Access variable R|/z|"]; + 474 [label="Smart cast: R|/z|"]; + 475 [label="Access variable R|kotlin/String.length|"]; + 476 [label="Exit block"]; + } + 477 [label="Exit when branch result"]; + 478 [label="Exit when"]; } - 477 [label="Exit block"]; + 479 [label="Exit block"]; } - 478 [label="Exit function test_8" style="filled" fillcolor=red]; + 480 [label="Exit function test_8" style="filled" fillcolor=red]; } - 341 -> {342}; - 342 -> {343}; 343 -> {344}; 344 -> {345}; 345 -> {346}; @@ -1109,10 +1114,10 @@ digraph boundSmartcastsInBranches_kt { 351 -> {352}; 352 -> {353}; 353 -> {354}; - 354 -> {355 356}; - 355 -> {369}; - 356 -> {357}; - 357 -> {358}; + 354 -> {355}; + 355 -> {356}; + 356 -> {357 358}; + 357 -> {371}; 358 -> {359}; 359 -> {360}; 360 -> {361}; @@ -1130,10 +1135,10 @@ digraph boundSmartcastsInBranches_kt { 372 -> {373}; 373 -> {374}; 374 -> {375}; - 375 -> {376 377}; - 376 -> {390}; - 377 -> {378}; - 378 -> {379}; + 375 -> {376}; + 376 -> {377}; + 377 -> {378 379}; + 378 -> {392}; 379 -> {380}; 380 -> {381}; 381 -> {382}; @@ -1151,10 +1156,10 @@ digraph boundSmartcastsInBranches_kt { 393 -> {394}; 394 -> {395}; 395 -> {396}; - 396 -> {397 398}; - 397 -> {411}; - 398 -> {399}; - 399 -> {400}; + 396 -> {397}; + 397 -> {398}; + 398 -> {399 400}; + 399 -> {413}; 400 -> {401}; 401 -> {402}; 402 -> {403}; @@ -1174,10 +1179,10 @@ digraph boundSmartcastsInBranches_kt { 416 -> {417}; 417 -> {418}; 418 -> {419}; - 419 -> {420 421}; - 420 -> {434}; - 421 -> {422}; - 422 -> {423}; + 419 -> {420}; + 420 -> {421}; + 421 -> {422 423}; + 422 -> {436}; 423 -> {424}; 424 -> {425}; 425 -> {426}; @@ -1196,30 +1201,30 @@ digraph boundSmartcastsInBranches_kt { 438 -> {439}; 439 -> {440}; 440 -> {441}; - 441 -> {442 443}; - 442 -> {455}; - 443 -> {444}; - 444 -> {445}; + 441 -> {442}; + 442 -> {443}; + 443 -> {444 445}; + 444 -> {457}; 445 -> {446}; 446 -> {447}; 447 -> {448}; - 448 -> {449} [style=dotted]; - 449 -> {450} [style=dotted]; + 448 -> {449}; + 449 -> {450}; 450 -> {451} [style=dotted]; 451 -> {452} [style=dotted]; 452 -> {453} [style=dotted]; 453 -> {454} [style=dotted]; 454 -> {455} [style=dotted]; - 455 -> {456}; - 456 -> {457}; + 455 -> {456} [style=dotted]; + 456 -> {457} [style=dotted]; 457 -> {458}; 458 -> {459}; 459 -> {460}; 460 -> {461}; - 461 -> {462 463}; - 462 -> {476}; - 463 -> {464}; - 464 -> {465}; + 461 -> {462}; + 462 -> {463}; + 463 -> {464 465}; + 464 -> {478}; 465 -> {466}; 466 -> {467}; 467 -> {468}; @@ -1233,86 +1238,86 @@ digraph boundSmartcastsInBranches_kt { 475 -> {476}; 476 -> {477}; 477 -> {478}; + 478 -> {479}; + 479 -> {480}; - subgraph cluster_90 { + subgraph cluster_91 { color=red - 479 [label="Enter function test_9" style="filled" fillcolor=red]; - subgraph cluster_91 { + 481 [label="Enter function test_9" style="filled" fillcolor=red]; + subgraph cluster_92 { color=blue - 480 [label="Enter block"]; - 481 [label="Const: Null(null)"]; - 482 [label="Variable declaration: lvar a: R|kotlin/String?|"]; - 483 [label="Variable declaration: lval b: R|kotlin/String?|"]; - subgraph cluster_92 { + 482 [label="Enter block"]; + 483 [label="Const: Null(null)"]; + 484 [label="Variable declaration: lvar a: R|kotlin/String?|"]; + 485 [label="Variable declaration: lval b: R|kotlin/String?|"]; + subgraph cluster_93 { color=blue - 484 [label="Enter when"]; - subgraph cluster_93 { - color=blue - 485 [label="Enter when branch condition "]; - 486 [label="Access variable R|/a|"]; - 487 [label="Const: Null(null)"]; - 488 [label="Equality operator !="]; - 489 [label="Exit when branch condition"]; - } + 486 [label="Enter when"]; subgraph cluster_94 { color=blue - 490 [label="Enter when branch condition else"]; + 487 [label="Enter when branch condition "]; + 488 [label="Access variable R|/a|"]; + 489 [label="Const: Null(null)"]; + 490 [label="Equality operator !="]; 491 [label="Exit when branch condition"]; } - 492 [label="Enter when branch result"]; subgraph cluster_95 { color=blue - 493 [label="Enter block"]; - 494 [label="Access variable R|/a|"]; - 495 [label="Smart cast: R|/a|"]; - 496 [label="Assignment: R|/b|"]; - 497 [label="Exit block"]; + 492 [label="Enter when branch condition else"]; + 493 [label="Exit when branch condition"]; } - 498 [label="Exit when branch result"]; - 499 [label="Enter when branch result"]; + 494 [label="Enter when branch result"]; subgraph cluster_96 { color=blue - 500 [label="Enter block"]; - 501 [label="Access variable R|/a|"]; - 502 [label="Smart cast: R|/a|"]; - 503 [label="Assignment: R|/b|"]; - 504 [label="Exit block"]; + 495 [label="Enter block"]; + 496 [label="Access variable R|/a|"]; + 497 [label="Smart cast: R|/a|"]; + 498 [label="Assignment: R|/b|"]; + 499 [label="Exit block"]; } - 505 [label="Exit when branch result"]; - 506 [label="Exit when"]; - } - 507 [label="Access variable R|/b|"]; - 508 [label="Access variable R|kotlin/String.length#|"]; - subgraph cluster_97 { - color=blue - 509 [label="Enter when"]; - subgraph cluster_98 { + 500 [label="Exit when branch result"]; + 501 [label="Enter when branch result"]; + subgraph cluster_97 { color=blue - 510 [label="Enter when branch condition "]; - 511 [label="Access variable R|/a|"]; - 512 [label="Const: Null(null)"]; - 513 [label="Equality operator !="]; - 514 [label="Exit when branch condition"]; + 502 [label="Enter block"]; + 503 [label="Access variable R|/a|"]; + 504 [label="Smart cast: R|/a|"]; + 505 [label="Assignment: R|/b|"]; + 506 [label="Exit block"]; } - 515 [label="Synthetic else branch"]; - 516 [label="Enter when branch result"]; + 507 [label="Exit when branch result"]; + 508 [label="Exit when"]; + } + 509 [label="Access variable R|/b|"]; + 510 [label="Access variable R|kotlin/String.length#|"]; + subgraph cluster_98 { + color=blue + 511 [label="Enter when"]; subgraph cluster_99 { color=blue - 517 [label="Enter block"]; - 518 [label="Access variable R|/b|"]; - 519 [label="Smart cast: R|/b|"]; - 520 [label="Access variable R|kotlin/String.length|"]; - 521 [label="Exit block"]; + 512 [label="Enter when branch condition "]; + 513 [label="Access variable R|/a|"]; + 514 [label="Const: Null(null)"]; + 515 [label="Equality operator !="]; + 516 [label="Exit when branch condition"]; } - 522 [label="Exit when branch result"]; - 523 [label="Exit when"]; + 517 [label="Synthetic else branch"]; + 518 [label="Enter when branch result"]; + subgraph cluster_100 { + color=blue + 519 [label="Enter block"]; + 520 [label="Access variable R|/b|"]; + 521 [label="Smart cast: R|/b|"]; + 522 [label="Access variable R|kotlin/String.length|"]; + 523 [label="Exit block"]; + } + 524 [label="Exit when branch result"]; + 525 [label="Exit when"]; } - 524 [label="Exit block"]; + 526 [label="Exit block"]; } - 525 [label="Exit function test_9" style="filled" fillcolor=red]; + 527 [label="Exit function test_9" style="filled" fillcolor=red]; } - 479 -> {480}; - 480 -> {481}; 481 -> {482}; 482 -> {483}; 483 -> {484}; @@ -1321,18 +1326,18 @@ digraph boundSmartcastsInBranches_kt { 486 -> {487}; 487 -> {488}; 488 -> {489}; - 489 -> {490 499}; + 489 -> {490}; 490 -> {491}; - 491 -> {492}; + 491 -> {492 501}; 492 -> {493}; 493 -> {494}; 494 -> {495}; 495 -> {496}; 496 -> {497}; 497 -> {498}; - 498 -> {506}; + 498 -> {499}; 499 -> {500}; - 500 -> {501}; + 500 -> {508}; 501 -> {502}; 502 -> {503}; 503 -> {504}; @@ -1346,10 +1351,10 @@ digraph boundSmartcastsInBranches_kt { 511 -> {512}; 512 -> {513}; 513 -> {514}; - 514 -> {515 516}; - 515 -> {523}; - 516 -> {517}; - 517 -> {518}; + 514 -> {515}; + 515 -> {516}; + 516 -> {517 518}; + 517 -> {525}; 518 -> {519}; 519 -> {520}; 520 -> {521}; @@ -1357,5 +1362,7 @@ digraph boundSmartcastsInBranches_kt { 522 -> {523}; 523 -> {524}; 524 -> {525}; + 525 -> {526}; + 526 -> {527}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt index 16774238358..fd4772c4b94 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.fir.txt @@ -14,14 +14,17 @@ FILE: boundSmartcastsInBranches.kt lval : R|kotlin/collections/Iterator| = R|/list|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval a: R|A| = R|/|.R|SubstitutionOverride|() - when () { - ==(R|/goodA|, Null(null)) -> { - R|/goodA| = R|/a| - continue@@@[R|/|.R|SubstitutionOverride|()] + { + when () { + ==(R|/goodA|, Null(null)) -> { + R|/goodA| = R|/a| + continue@@@[R|/|.R|SubstitutionOverride|()] + } } + + R|/goodA|.R|/A.s| } - R|/goodA|.R|/A.s| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 9d3a58e73aa..6a337e7d8ae 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -184,61 +184,66 @@ digraph smartcastToNothing_kt { 66 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 67 [label="Stub" style="filled" fillcolor=gray]; 68 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray]; - 69 [label="Access variable R|/result|" style="filled" fillcolor=gray]; - 70 [label="Stub" style="filled" fillcolor=gray]; - 71 [label="Assignment: R|/s|" style="filled" fillcolor=gray]; subgraph cluster_21 { color=blue - 72 [label="Enter when" style="filled" fillcolor=gray]; + 69 [label="Enter block" style="filled" fillcolor=gray]; + 70 [label="Access variable R|/result|" style="filled" fillcolor=gray]; + 71 [label="Stub" style="filled" fillcolor=gray]; + 72 [label="Assignment: R|/s|" style="filled" fillcolor=gray]; subgraph cluster_22 { color=blue - 73 [label="Enter when branch condition " style="filled" fillcolor=gray]; - 74 [label="Access variable R|/result|" style="filled" fillcolor=gray]; - 75 [label="Stub" style="filled" fillcolor=gray]; - 76 [label="Access variable #" style="filled" fillcolor=gray]; - 77 [label="Exit when branch condition" style="filled" fillcolor=gray]; + 73 [label="Enter when" style="filled" fillcolor=gray]; + subgraph cluster_23 { + color=blue + 74 [label="Enter when branch condition " style="filled" fillcolor=gray]; + 75 [label="Access variable R|/result|" style="filled" fillcolor=gray]; + 76 [label="Stub" style="filled" fillcolor=gray]; + 77 [label="Access variable #" style="filled" fillcolor=gray]; + 78 [label="Exit when branch condition" style="filled" fillcolor=gray]; + } + 79 [label="Synthetic else branch" style="filled" fillcolor=gray]; + 80 [label="Enter when branch result" style="filled" fillcolor=gray]; + subgraph cluster_24 { + color=blue + 81 [label="Enter block" style="filled" fillcolor=gray]; + 82 [label="Jump: break@@@[R|/|.R|SubstitutionOverride|()] " style="filled" fillcolor=gray]; + 83 [label="Stub" style="filled" fillcolor=gray]; + 84 [label="Exit block" style="filled" fillcolor=gray]; + } + 85 [label="Exit when branch result" style="filled" fillcolor=gray]; + 86 [label="Exit when" style="filled" fillcolor=gray]; } - 78 [label="Synthetic else branch" style="filled" fillcolor=gray]; - 79 [label="Enter when branch result" style="filled" fillcolor=gray]; - subgraph cluster_23 { - color=blue - 80 [label="Enter block" style="filled" fillcolor=gray]; - 81 [label="Jump: break@@@[R|/|.R|SubstitutionOverride|()] " style="filled" fillcolor=gray]; - 82 [label="Stub" style="filled" fillcolor=gray]; - 83 [label="Exit block" style="filled" fillcolor=gray]; - } - 84 [label="Exit when branch result" style="filled" fillcolor=gray]; - 85 [label="Exit when" style="filled" fillcolor=gray]; + 87 [label="Exit block" style="filled" fillcolor=gray]; } - 86 [label="Exit block" style="filled" fillcolor=gray]; + 88 [label="Exit block" style="filled" fillcolor=gray]; } - 87 [label="Exit loop block" style="filled" fillcolor=gray]; + 89 [label="Exit loop block" style="filled" fillcolor=gray]; } - 88 [label="Exit while loop"]; + 90 [label="Exit while loop"]; } - 89 [label="Exit block"]; + 91 [label="Exit block"]; } - 90 [label="Access variable R|/s|"]; - 91 [label="Enter safe call"]; - 92 [label="Postponed enter to lambda"]; - subgraph cluster_24 { + 92 [label="Access variable R|/s|"]; + 93 [label="Enter safe call"]; + 94 [label="Postponed enter to lambda"]; + subgraph cluster_25 { color=blue - 93 [label="Enter function " style="filled" fillcolor=red]; - subgraph cluster_25 { + 95 [label="Enter function " style="filled" fillcolor=red]; + subgraph cluster_26 { color=blue - 94 [label="Enter block"]; - 95 [label="Access variable R|/it|"]; - 96 [label="Access variable R|/A.a|"]; - 97 [label="Exit block"]; + 96 [label="Enter block"]; + 97 [label="Access variable R|/it|"]; + 98 [label="Access variable R|/A.a|"]; + 99 [label="Exit block"]; } - 98 [label="Exit function " style="filled" fillcolor=red]; + 100 [label="Exit function " style="filled" fillcolor=red]; } - 99 [label="Postponed exit from lambda"]; - 100 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; - 101 [label="Exit safe call"]; - 102 [label="Exit block"]; + 101 [label="Postponed exit from lambda"]; + 102 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; + 103 [label="Exit safe call"]; + 104 [label="Exit block"]; } - 103 [label="Exit function test_0" style="filled" fillcolor=red]; + 105 [label="Exit function test_0" style="filled" fillcolor=red]; } 50 -> {51}; 51 -> {52}; @@ -252,7 +257,7 @@ digraph smartcastToNothing_kt { 59 -> {60}; 60 -> {61}; 61 -> {62}; - 62 -> {63 88}; + 62 -> {63 90}; 63 -> {64}; 64 -> {65}; 65 -> {66}; @@ -267,26 +272,26 @@ digraph smartcastToNothing_kt { 74 -> {75} [style=dotted]; 75 -> {76} [style=dotted]; 76 -> {77} [style=dotted]; - 77 -> {78 79} [style=dotted]; - 78 -> {85} [style=dotted]; - 79 -> {80} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79 80} [style=dotted]; + 79 -> {86} [style=dotted]; 80 -> {81} [style=dotted]; - 81 -> {82 88} [style=dotted]; - 82 -> {83} [style=dotted]; + 81 -> {82} [style=dotted]; + 82 -> {83 90} [style=dotted]; 83 -> {84} [style=dotted]; 84 -> {85} [style=dotted]; 85 -> {86} [style=dotted]; 86 -> {87} [style=dotted]; - 87 -> {59} [color=green style=dotted]; - 88 -> {89}; - 89 -> {90}; - 90 -> {91 101}; + 87 -> {88} [style=dotted]; + 88 -> {89} [style=dotted]; + 89 -> {59} [color=green style=dotted]; + 90 -> {91}; 91 -> {92}; - 92 -> {93 100}; - 92 -> {99} [style=dotted]; - 92 -> {93} [style=dashed]; + 92 -> {93 103}; 93 -> {94}; - 94 -> {95}; + 94 -> {95 102}; + 94 -> {101} [style=dotted]; + 94 -> {95} [style=dashed]; 95 -> {96}; 96 -> {97}; 97 -> {98}; @@ -295,82 +300,82 @@ digraph smartcastToNothing_kt { 100 -> {101}; 101 -> {102}; 102 -> {103}; + 103 -> {104}; + 104 -> {105}; - subgraph cluster_26 { + subgraph cluster_27 { color=red - 104 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_27 { + 106 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_28 { color=blue - 105 [label="Enter block"]; - subgraph cluster_28 { + 107 [label="Enter block"]; + subgraph cluster_29 { color=blue - 106 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 107 [label="Enter when branch condition "]; - 108 [label="Access variable R|/a|"]; - 109 [label="Type operator: (R|/a| is R|kotlin/Nothing?|)"]; - 110 [label="Exit when branch condition"]; - } - 111 [label="Synthetic else branch"]; - 112 [label="Enter when branch result"]; + 108 [label="Enter when"]; subgraph cluster_30 { color=blue - 113 [label="Enter block"]; - 114 [label="Access variable R|/a|"]; - 115 [label="Smart cast: R|/a|"]; - 116 [label="Enter safe call"]; - 117 [label="Access variable R|kotlin/String.length|"]; - 118 [label="Exit safe call"]; - 119 [label="Variable declaration: lval b: R|kotlin/Int?|"]; - 120 [label="Exit block"]; + 109 [label="Enter when branch condition "]; + 110 [label="Access variable R|/a|"]; + 111 [label="Type operator: (R|/a| is R|kotlin/Nothing?|)"]; + 112 [label="Exit when branch condition"]; } - 121 [label="Exit when branch result"]; - 122 [label="Exit when"]; - } - subgraph cluster_31 { - color=blue - 123 [label="Enter when"]; - subgraph cluster_32 { + 113 [label="Synthetic else branch"]; + 114 [label="Enter when branch result"]; + subgraph cluster_31 { color=blue - 124 [label="Enter when branch condition "]; - 125 [label="Access variable R|/a|"]; - 126 [label="Type operator: (R|/a| is R|kotlin/Nothing|)"]; - 127 [label="Exit when branch condition"]; + 115 [label="Enter block"]; + 116 [label="Access variable R|/a|"]; + 117 [label="Smart cast: R|/a|"]; + 118 [label="Enter safe call"]; + 119 [label="Access variable R|kotlin/String.length|"]; + 120 [label="Exit safe call"]; + 121 [label="Variable declaration: lval b: R|kotlin/Int?|"]; + 122 [label="Exit block"]; } - 128 [label="Synthetic else branch"]; - 129 [label="Enter when branch result"]; + 123 [label="Exit when branch result"]; + 124 [label="Exit when"]; + } + subgraph cluster_32 { + color=blue + 125 [label="Enter when"]; subgraph cluster_33 { color=blue - 130 [label="Enter block"]; - 131 [label="Access variable R|/a|"]; - 132 [label="Smart cast: R|/a|"]; - 133 [label="Stub" style="filled" fillcolor=gray]; - 134 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; - 135 [label="Variable declaration: lval b: R|kotlin/Int|" style="filled" fillcolor=gray]; - 136 [label="Exit block" style="filled" fillcolor=gray]; + 126 [label="Enter when branch condition "]; + 127 [label="Access variable R|/a|"]; + 128 [label="Type operator: (R|/a| is R|kotlin/Nothing|)"]; + 129 [label="Exit when branch condition"]; } - 137 [label="Exit when branch result" style="filled" fillcolor=gray]; - 138 [label="Exit when"]; + 130 [label="Synthetic else branch"]; + 131 [label="Enter when branch result"]; + subgraph cluster_34 { + color=blue + 132 [label="Enter block"]; + 133 [label="Access variable R|/a|"]; + 134 [label="Smart cast: R|/a|"]; + 135 [label="Stub" style="filled" fillcolor=gray]; + 136 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; + 137 [label="Variable declaration: lval b: R|kotlin/Int|" style="filled" fillcolor=gray]; + 138 [label="Exit block" style="filled" fillcolor=gray]; + } + 139 [label="Exit when branch result" style="filled" fillcolor=gray]; + 140 [label="Exit when"]; } - 139 [label="Exit block"]; + 141 [label="Exit block"]; } - 140 [label="Exit function test_1" style="filled" fillcolor=red]; + 142 [label="Exit function test_1" style="filled" fillcolor=red]; } - 104 -> {105}; - 105 -> {106}; 106 -> {107}; 107 -> {108}; 108 -> {109}; 109 -> {110}; - 110 -> {111 112}; - 111 -> {122}; - 112 -> {113}; - 113 -> {114}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113 114}; + 113 -> {124}; 114 -> {115}; - 115 -> {116 118}; + 115 -> {116}; 116 -> {117}; - 117 -> {118}; + 117 -> {118 120}; 118 -> {119}; 119 -> {120}; 120 -> {121}; @@ -380,18 +385,20 @@ digraph smartcastToNothing_kt { 124 -> {125}; 125 -> {126}; 126 -> {127}; - 127 -> {128 129}; - 128 -> {138}; - 129 -> {130}; - 130 -> {131}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130 131}; + 130 -> {140}; 131 -> {132}; - 132 -> {133} [style=dotted]; - 133 -> {134} [style=dotted]; + 132 -> {133}; + 133 -> {134}; 134 -> {135} [style=dotted]; 135 -> {136} [style=dotted]; 136 -> {137} [style=dotted]; 137 -> {138} [style=dotted]; - 138 -> {139}; - 139 -> {140}; + 138 -> {139} [style=dotted]; + 139 -> {140} [style=dotted]; + 140 -> {141}; + 141 -> {142}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt index 5e53f372bf3..74b0e7ef03e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.fir.txt @@ -34,11 +34,14 @@ FILE: smartcastToNothing.kt lval : R|kotlin/collections/Iterator| = R|/results|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval result: R|kotlin/Nothing| = R|/|.R|SubstitutionOverride|() - R|/s| = R|/result| - when () { - R|/result|.# -> { - break@@@[R|/|.R|SubstitutionOverride|()] + { + R|/s| = R|/result| + when () { + R|/result|.# -> { + break@@@[R|/|.R|SubstitutionOverride|()] + } } + } } diff --git a/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt b/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt index 6cdd83a1305..d0c574be592 100644 --- a/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.fir.txt @@ -13,7 +13,10 @@ FILE: varargInPrimaryConstructor.kt lval : R|kotlin/collections/Iterator| = R|/foo|.R|/Foo.strings|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval s: R|kotlin/String| = R|/|.R|SubstitutionOverride|() - R|/s|.R|kotlin/String.length| + { + R|/s|.R|kotlin/String.length| + } + } } @@ -24,7 +27,10 @@ FILE: varargInPrimaryConstructor.kt lval : R|kotlin/collections/Iterator| = R|/strings|.R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval s: R|kotlin/String| = R|/|.R|SubstitutionOverride|() - R|/s|.R|kotlin/String.length| + { + R|/s|.R|kotlin/String.length| + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt index 96041532173..4bbe80b6601 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/components.fir.txt @@ -24,6 +24,9 @@ FILE: components.kt lval : R|D| = R|/|.R|SubstitutionOverride|() lval x: R|kotlin/Int| = R|/|.R|/D.component1|() lval y: R|kotlin/String| = R|/|.R|/D.component2|() + { + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot index 993aeebaec2..666293fa5ea 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot @@ -167,49 +167,54 @@ digraph flow_kt { 74 [label="Access variable R|/|"]; 75 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()" style="filled" fillcolor=yellow]; 76 [label="Variable declaration: lval i: R|kotlin/Int|"]; - 77 [label="Access variable R|/x|"]; - 78 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; - 79 [label="Exit block"]; + subgraph cluster_24 { + color=blue + 77 [label="Enter block"]; + 78 [label="Access variable R|/x|"]; + 79 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 80 [label="Exit block"]; + } + 81 [label="Exit block"]; } - 80 [label="Exit loop block"]; + 82 [label="Exit loop block"]; } - 81 [label="Exit while loop"]; + 83 [label="Exit while loop"]; } - 82 [label="Exit block"]; + 84 [label="Exit block"]; } - 83 [label="Access variable R|/y|"]; - 84 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; - 85 [label="Exit block"]; + 85 [label="Access variable R|/y|"]; + 86 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 87 [label="Exit block"]; } - 86 [label="Exit when branch result"]; - 87 [label="Exit when"]; + 88 [label="Exit when branch result"]; + 89 [label="Exit when"]; } - subgraph cluster_24 { + subgraph cluster_25 { color=blue - 88 [label="Enter do-while loop"]; - subgraph cluster_25 { + 90 [label="Enter do-while loop"]; + subgraph cluster_26 { color=blue - 89 [label="Enter loop block"]; - subgraph cluster_26 { + 91 [label="Enter loop block"]; + subgraph cluster_27 { color=blue - 90 [label="Enter block"]; - 91 [label="Access variable R|/z|"]; - 92 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; - 93 [label="Exit block"]; + 92 [label="Enter block"]; + 93 [label="Access variable R|/z|"]; + 94 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; + 95 [label="Exit block"]; } - 94 [label="Exit loop block"]; + 96 [label="Exit loop block"]; } - subgraph cluster_27 { + subgraph cluster_28 { color=blue - 95 [label="Enter loop condition"]; - 96 [label="Const: Boolean(true)"]; - 97 [label="Exit loop condition"]; + 97 [label="Enter loop condition"]; + 98 [label="Const: Boolean(true)"]; + 99 [label="Exit loop condition"]; } - 98 [label="Exit do-while loop" style="filled" fillcolor=gray]; + 100 [label="Exit do-while loop" style="filled" fillcolor=gray]; } - 99 [label="Exit block" style="filled" fillcolor=gray]; + 101 [label="Exit block" style="filled" fillcolor=gray]; } - 100 [label="Exit function foo" style="filled" fillcolor=red]; + 102 [label="Exit function foo" style="filled" fillcolor=red]; } 22 -> {23}; 23 -> {24}; @@ -235,7 +240,7 @@ digraph flow_kt { 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {100}; + 46 -> {102}; 46 -> {47} [style=dotted]; 47 -> {48} [style=dotted]; 48 -> {49} [style=dotted]; @@ -248,7 +253,7 @@ digraph flow_kt { 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {87}; + 58 -> {89}; 59 -> {60}; 60 -> {61}; 61 -> {62}; @@ -261,7 +266,7 @@ digraph flow_kt { 68 -> {69}; 69 -> {70}; 70 -> {71}; - 71 -> {72 81}; + 71 -> {72 83}; 72 -> {73}; 73 -> {74}; 74 -> {75}; @@ -270,9 +275,9 @@ digraph flow_kt { 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {68} [color=green style=dashed]; + 80 -> {81}; 81 -> {82}; - 82 -> {83}; + 82 -> {68} [color=green style=dashed]; 83 -> {84}; 84 -> {85}; 85 -> {86}; @@ -287,9 +292,11 @@ digraph flow_kt { 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {89} [color=green style=dashed]; - 97 -> {98} [style=dotted]; - 98 -> {99} [style=dotted]; + 97 -> {98}; + 98 -> {99}; + 99 -> {91} [color=green style=dashed]; 99 -> {100} [style=dotted]; + 100 -> {101} [style=dotted]; + 101 -> {102} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt index 2f2951e0b03..c761e15f5aa 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.fir.txt @@ -44,7 +44,10 @@ FILE: flow.kt lval : R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(0)).R|kotlin/ranges/IntProgression.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|kotlin/collections/IntIterator.next|() - R|/x|.R|SubstitutionOverride|() + { + R|/x|.R|SubstitutionOverride|() + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt index 01e8f921f84..390a054d42f 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/forLoopChecker.fir.txt @@ -175,6 +175,9 @@ FILE: forLoopChecker.kt lval : = R|/notRange1|.#() while(R|/|.#()) { lval i: = R|/|.#() + { + } + } } @@ -183,6 +186,9 @@ FILE: forLoopChecker.kt lval : R|kotlin/Unit| = R|/notRange2|.R|/NotRange2.iterator|() while(R|/|.#()) { lval i: = R|/|.#() + { + } + } } @@ -191,6 +197,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator1| = R|/notRange3|.R|/NotRange3.iterator|() while(R|/|.R|/ImproperIterator1.hasNext|()) { lval i: = R|/|.#() + { + } + } } @@ -199,6 +208,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator2| = R|/notRange4|.R|/NotRange4.iterator|() while(R|/|.#()) { lval i: R|kotlin/Boolean| = R|/|.R|/ImproperIterator2.next|() + { + } + } } @@ -207,6 +219,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator3| = R|/notRange5|.R|/NotRange5.iterator|() while(R|/|.R|/ImproperIterator3.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|/ImproperIterator3.next|() + { + } + } } @@ -215,6 +230,9 @@ FILE: forLoopChecker.kt lval : R|AmbiguousHasNextIterator| = R|/notRange6|.R|/NotRange6.iterator|() while(R|/|.R|/AmbiguousHasNextIterator.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|/AmbiguousHasNextIterator.next|() + { + } + } } @@ -223,6 +241,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator3| = R|/notRange7|.R|/NotRange7.iterator|() while(R|/|.R|/ImproperIterator3.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|/ImproperIterator3.next|() + { + } + } } @@ -231,6 +252,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator5| = R|/notRange8|.R|/NotRange8.iterator|() while(R|/|.#()) { lval i: R|kotlin/Int| = R|/|.R|/ImproperIterator5.next|() + { + } + } } @@ -239,6 +263,9 @@ FILE: forLoopChecker.kt lval : R|ImproperIterator6| = R|/notRange9|.R|/NotRange9.iterator|() while(R|/|.R|/ImproperIterator6.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|/ImproperIterator6.next|() + { + } + } } @@ -247,6 +274,9 @@ FILE: forLoopChecker.kt lval : R|GoodIterator| = R|/range0|.R|/Range0.iterator|() while(R|/|.R|/GoodIterator.hasNext|()) { lval i: R|kotlin/Int| = R|/|.R|/GoodIterator.next|() + { + } + } } @@ -255,6 +285,9 @@ FILE: forLoopChecker.kt lval : R|kotlin/collections/Iterator| = R|/range1|.R|/Range1.iterator|() while(R|/|.R|SubstitutionOverride|()) { lval i: R|kotlin/Int| = R|/|.R|SubstitutionOverride|() + { + } + } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt index 72788c22926..1aa4cb0dc64 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.fir.txt @@ -48,10 +48,13 @@ FILE: DeepCopyIrTree.kt lval : R|kotlin/Pair| = R|/|.R|SubstitutionOverride|>|() lval thisTypeParameter: R|IrTypeParameter| = R|/|.R|SubstitutionOverride|() lval otherTypeParameter: R|IrTypeParameter| = R|/|.R|SubstitutionOverride|() - R|/otherTypeParameter|.R|/IrTypeParameter.superTypes|.R|kotlin/collections/mapTo||>(R|/thisTypeParameter|.R|/IrTypeParameter.superTypes|, = mapTo@fun (it: R|IrType|): R|IrType| { - ^ this@R|/DeepCopyIrTreeWithSymbols|.R|/DeepCopyIrTreeWithSymbols.typeRemapper|.R|/TypeRemapper.remapType|(R|/it|) + { + R|/otherTypeParameter|.R|/IrTypeParameter.superTypes|.R|kotlin/collections/mapTo||>(R|/thisTypeParameter|.R|/IrTypeParameter.superTypes|, = mapTo@fun (it: R|IrType|): R|IrType| { + ^ this@R|/DeepCopyIrTreeWithSymbols|.R|/DeepCopyIrTreeWithSymbols.typeRemapper|.R|/TypeRemapper.remapType|(R|/it|) + } + ) } - ) + } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt index ebdf9eab436..3fbf4d2e6aa 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/valueOfOrNull.fir.txt @@ -51,10 +51,13 @@ FILE: valueOfOrNull.kt lval : R|kotlin/collections/Iterator| = R|kotlin/enumValues|().R|SubstitutionOverride|>|() while(R|/|.R|SubstitutionOverride|()) { lval enumValue: R|E| = R|/|.R|SubstitutionOverride|() - when () { - ==(R|/enumValue|.R|SubstitutionOverride|, R|/value|) -> { - ^valueOfOrNull R|/enumValue| + { + when () { + ==(R|/enumValue|.R|SubstitutionOverride|, R|/value|) -> { + ^valueOfOrNull R|/enumValue| + } } + } } diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt index 21ea232ddeb..db1941d3dd0 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt @@ -1132,10 +1132,8 @@ class ExpressionsConverter( // So, prepare the loop target after building the condition. target = prepareTarget(forLoop) }.configure(target) { - // NB: just body.toFirBlock() isn't acceptable here because we need to add some statements buildBlock block@{ source = blockNode?.toFirSourceElement() - statements += convertLoopBody(blockNode).statements val valueParameter = parameter ?: return@block val multiDeclaration = valueParameter.destructuringDeclaration val firLoopParameter = generateTemporaryVariable( @@ -1159,10 +1157,11 @@ class ExpressionsConverter( firLoopParameter, tmpVariable = true ) - statements.addAll(0, destructuringBlock.statements) + statements.addAll(destructuringBlock.statements) } else { - statements.add(0, firLoopParameter) + statements.add(firLoopParameter) } + statements += convertLoopBody(blockNode) } } } diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index a464635174c..20f1ad0ead8 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -2326,14 +2326,8 @@ open class RawFirBuilder( // So, prepare the loop target after building the condition. target = prepareTarget(expression) }.configure(target) { - // NB: just body.toFirBlock() isn't acceptable here because we need to add some statements - val blockBuilder = when (val body = expression.body) { - is KtBlockExpression -> configureBlockWithoutBuilding(body) - null -> FirBlockBuilder() - else -> FirBlockBuilder().apply { - source = body.toFirSourceElement(KtFakeSourceElementKind.DesugaredForLoop) - statements += body.toFirStatement() - } + val blockBuilder = FirBlockBuilder().apply { + source = expression.toFirSourceElement(KtFakeSourceElementKind.DesugaredForLoop) } if (ktParameter != null) { val multiDeclaration = ktParameter.destructuringDeclaration @@ -2358,11 +2352,12 @@ open class RawFirBuilder( tmpVariable = true, extractAnnotationsTo = { extractAnnotationsTo(it) }, ) { toFirOrImplicitType() } - blockBuilder.statements.addAll(0, destructuringBlock.statements) + blockBuilder.statements.addAll(destructuringBlock.statements) } else { - blockBuilder.statements.add(0, firLoopParameter) + blockBuilder.statements.add(firLoopParameter) } } + blockBuilder.statements.add(expression.body.toFirBlock()) blockBuilder.build() } } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/for.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/for.txt index 412058524e5..714d773cb82 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/for.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/for.txt @@ -4,7 +4,10 @@ FILE: for.kt lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(10)).iterator#() while(R|/|.hasNext#()) { lval i: = R|/|.next#() - println#(i#) + { + println#(i#) + } + } } @@ -16,13 +19,16 @@ FILE: for.kt lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(10)).iterator#() label@while(R|/|.hasNext#()) { lval i: = R|/|.next#() - when () { - ==(i#, IntegerLiteral(5)) -> { - continue@@@[R|/|.hasNext#()] + { + when () { + ==(i#, IntegerLiteral(5)) -> { + continue@@@[R|/|.hasNext#()] + } } + + println#(i#) } - println#(i#) } } @@ -34,7 +40,10 @@ FILE: for.kt lval : = list#.subList#(IntegerLiteral(0), IntegerLiteral(10)).iterator#() while(R|/|.hasNext#()) { lval element: = R|/|.next#() - println#(element#) + { + println#(element#) + } + } } @@ -43,7 +52,10 @@ FILE: for.kt lval : = list#.subList#(IntegerLiteral(10), IntegerLiteral(20)).iterator#() while(R|/|.hasNext#()) { lval element: = R|/|.next#() - println#(element#) + { + println#(element#) + } + } } @@ -74,7 +86,10 @@ FILE: for.kt lval : = R|/|.next#() lval x: = R|/|.component1#() lval y: = R|/|.component2#() - println#((String(x = ), x#, String( y = ), y#)) + { + println#((String(x = ), x#, String( y = ), y#)) + } + } } @@ -85,7 +100,10 @@ FILE: for.kt lval : = list#.iterator#() while(R|/|.hasNext#()) { lval s: Some = R|/|.next#() - println#(s#) + { + println#(s#) + } + } } diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.kt index f540ac86c44..4a562ddcf02 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.kt @@ -1,3 +1,4 @@ +// FIR_DUMP // ISSUE: KT-54405 class A { @@ -5,7 +6,7 @@ class A { operator fun component2() = "" } -fun test(b: Boolean) { +fun testRedeclaration(b: Boolean) { val y = 1 val y = 2 val `_` = 3 @@ -14,15 +15,16 @@ fun test(b: Boolean) { var a = 10 var a = 11 } +} + +fun testNoRedeclaration(list: List, b: Boolean) { + for (el in list) { + val el = 42 + } if (b) { val z = 3 - val x = 5 - val x = 6 } else { val z = 4 } -} - -fun test2() { val (`_`, _) = A() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.txt b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.txt new file mode 100644 index 00000000000..bedcff1dabc --- /dev/null +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.fir.txt @@ -0,0 +1,51 @@ +FILE: RedeclaredValsAndVars.fir.kt + public final class A : R|kotlin/Any| { + public constructor(): R|A| { + super() + } + + public final operator fun component1(): R|kotlin/Int| { + ^component1 Int(1) + } + + public final operator fun component2(): R|kotlin/String| { + ^component2 String() + } + + } + public final fun testRedeclaration(b: R|kotlin/Boolean|): R|kotlin/Unit| { + lval y: R|kotlin/Int| = Int(1) + lval y: R|kotlin/Int| = Int(2) + lval _: R|kotlin/Int| = Int(3) + lval _: R|kotlin/Int| = Int(4) + fun (): R|kotlin/Unit| { + lvar a: R|kotlin/Int| = Int(10) + lvar a: R|kotlin/Int| = Int(11) + } + + } + public final fun testNoRedeclaration(list: R|kotlin/collections/List|, b: R|kotlin/Boolean|): R|kotlin/Unit| { + { + lval : R|kotlin/collections/Iterator| = R|/list|.R|SubstitutionOverride|>|() + while(R|/|.R|SubstitutionOverride|()) { + lval el: R|kotlin/Int| = R|/|.R|SubstitutionOverride|() + { + lval el: R|kotlin/Int| = Int(42) + } + + } + + } + + when () { + R|/b| -> { + lval z: R|kotlin/Int| = Int(3) + } + else -> { + lval z: R|kotlin/Int| = Int(4) + } + } + + lval : R|A| = R|/A.A|() + lval _: R|kotlin/Int| = R|/|.R|/A.component1|() + } diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.kt index 8e378e51dec..f6958b60054 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.kt @@ -1,3 +1,4 @@ +// FIR_DUMP // ISSUE: KT-54405 class A { @@ -5,7 +6,7 @@ class A { operator fun component2() = "" } -fun test(b: Boolean) { +fun testRedeclaration(b: Boolean) { val y = 1 val y = 2 val `_` = 3 @@ -14,15 +15,16 @@ fun test(b: Boolean) { var a = 10 var a = 11 } +} + +fun testNoRedeclaration(list: List, b: Boolean) { + for (el in list) { + val el = 42 + } if (b) { val z = 3 - val x = 5 - val x = 6 } else { val z = 4 } -} - -fun test2() { val (`_`, _) = A() } diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.txt b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.txt index fa0ba0e8247..40d9ed5c126 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.txt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredValsAndVars.txt @@ -1,7 +1,7 @@ package -public fun test(/*0*/ b: kotlin.Boolean): kotlin.Unit -public fun test2(): kotlin.Unit +public fun testNoRedeclaration(/*0*/ list: kotlin.collections.List, /*1*/ b: kotlin.Boolean): kotlin.Unit +public fun testRedeclaration(/*0*/ b: kotlin.Boolean): kotlin.Unit public final class A { public constructor A()