Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot
T
Brian Norman 17a1871b83 [FIR] Make sure the primary constructor is first in class CFG
The primary constructor of a class needs to be the first subgraph of the
class control-flow graph. Based on the Kotlin specification, class
initialization order goes first primary constructor, in-place
declarations (properties and init blocks), and then secondary
constructors. If the class doesn't have a primary constructor, then it
is just skipped in the order.

Unfortunately, the class control-flow graph had in-place declarations
first and then all constructors. Instead, we should treat the primary
constructor as the first in-place declaration, and then continue with
the existing processing as secondary constructors. This will guarantee
that super constructor calls have the correct property initialization
information.

^KT-65093 Fixed
2024-01-23 23:16:00 +00:00

674 lines
23 KiB
Plaintext
Vendored

digraph boundSmartcasts_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter file boundSmartcasts.kt" style="filled" fillcolor=red];
1 [label="Exit file boundSmartcasts.kt" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter class A" style="filled" fillcolor=red];
3 [label="Exit class A" style="filled" fillcolor=red];
}
2 -> {3} [color=green];
subgraph cluster_2 {
color=red
4 [label="Enter function foo" style="filled" fillcolor=red];
5 [label="Exit function foo" style="filled" fillcolor=red];
}
4 -> {5};
subgraph cluster_3 {
color=red
6 [label="Enter class B" style="filled" fillcolor=red];
7 [label="Exit class B" style="filled" fillcolor=red];
}
6 -> {7} [color=green];
subgraph cluster_4 {
color=red
8 [label="Enter function bar" style="filled" fillcolor=red];
9 [label="Exit function bar" style="filled" fillcolor=red];
}
8 -> {9};
subgraph cluster_5 {
color=red
10 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
11 [label="Enter block"];
12 [label="Access variable R|<local>/x|"];
13 [label="Variable declaration: lval y: R|kotlin/Any|"];
subgraph cluster_7 {
color=blue
14 [label="Enter when"];
subgraph cluster_8 {
color=blue
15 [label="Enter when branch condition "];
16 [label="Access variable R|<local>/x|"];
17 [label="Type operator: (R|<local>/x| is R|A|)"];
18 [label="Exit when branch condition"];
}
19 [label="Synthetic else branch"];
20 [label="Enter when branch result"];
subgraph cluster_9 {
color=blue
21 [label="Enter block"];
subgraph cluster_10 {
color=blue
22 [label="Function call arguments enter"];
23 [label="Access variable R|<local>/x|"];
24 [label="Smart cast: R|<local>/x|"];
25 [label="Function call arguments exit"];
}
26 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
subgraph cluster_11 {
color=blue
27 [label="Function call arguments enter"];
28 [label="Access variable R|<local>/y|"];
29 [label="Smart cast: R|<local>/y|"];
30 [label="Function call arguments exit"];
}
31 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
32 [label="Exit block"];
}
33 [label="Exit when branch result"];
34 [label="Exit when"];
}
35 [label="Exit block"];
}
36 [label="Exit function test_1" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19 20};
19 -> {34};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
subgraph cluster_12 {
color=red
37 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
38 [label="Enter block"];
39 [label="Access variable R|<local>/x|"];
40 [label="Variable declaration: lval y: R|kotlin/Any|"];
subgraph cluster_14 {
color=blue
41 [label="Enter when"];
subgraph cluster_15 {
color=blue
42 [label="Enter when branch condition "];
43 [label="Access variable R|<local>/y|"];
44 [label="Type operator: (R|<local>/y| is R|A|)"];
45 [label="Exit when branch condition"];
}
46 [label="Synthetic else branch"];
47 [label="Enter when branch result"];
subgraph cluster_16 {
color=blue
48 [label="Enter block"];
subgraph cluster_17 {
color=blue
49 [label="Function call arguments enter"];
50 [label="Access variable R|<local>/x|"];
51 [label="Smart cast: R|<local>/x|"];
52 [label="Function call arguments exit"];
}
53 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
subgraph cluster_18 {
color=blue
54 [label="Function call arguments enter"];
55 [label="Access variable R|<local>/y|"];
56 [label="Smart cast: R|<local>/y|"];
57 [label="Function call arguments exit"];
}
58 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
59 [label="Exit block"];
}
60 [label="Exit when branch result"];
61 [label="Exit when"];
}
62 [label="Exit block"];
}
63 [label="Exit function test_2" style="filled" fillcolor=red];
}
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46 47};
46 -> {61};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
subgraph cluster_19 {
color=red
64 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_20 {
color=blue
65 [label="Enter block"];
66 [label="Access variable R|<local>/x|"];
67 [label="Variable declaration: lvar z: R|kotlin/Any|"];
subgraph cluster_21 {
color=blue
68 [label="Enter when"];
subgraph cluster_22 {
color=blue
69 [label="Enter when branch condition "];
70 [label="Access variable R|<local>/x|"];
71 [label="Type operator: (R|<local>/x| is R|A|)"];
72 [label="Exit when branch condition"];
}
73 [label="Synthetic else branch"];
74 [label="Enter when branch result"];
subgraph cluster_23 {
color=blue
75 [label="Enter block"];
subgraph cluster_24 {
color=blue
76 [label="Function call arguments enter"];
77 [label="Access variable R|<local>/z|"];
78 [label="Smart cast: R|<local>/z|"];
79 [label="Function call arguments exit"];
}
80 [label="Function call: R|<local>/z|.R|/A.foo|()" style="filled" fillcolor=yellow];
81 [label="Exit block"];
}
82 [label="Exit when branch result"];
83 [label="Exit when"];
}
84 [label="Access variable R|<local>/y|"];
85 [label="Assignment: R|<local>/z|"];
subgraph cluster_25 {
color=blue
86 [label="Enter when"];
subgraph cluster_26 {
color=blue
87 [label="Enter when branch condition "];
88 [label="Access variable R|<local>/y|"];
89 [label="Type operator: (R|<local>/y| is R|B|)"];
90 [label="Exit when branch condition"];
}
91 [label="Synthetic else branch"];
92 [label="Enter when branch result"];
subgraph cluster_27 {
color=blue
93 [label="Enter block"];
subgraph cluster_28 {
color=blue
94 [label="Function call arguments enter"];
95 [label="Access variable R|<local>/z|"];
96 [label="Smart cast: R|<local>/z|"];
97 [label="Function call arguments exit"];
}
98 [label="Function call: R|<local>/z|.<Unresolved name: foo>#()" style="filled" fillcolor=yellow];
subgraph cluster_29 {
color=blue
99 [label="Function call arguments enter"];
100 [label="Access variable R|<local>/z|"];
101 [label="Smart cast: R|<local>/z|"];
102 [label="Function call arguments exit"];
}
103 [label="Function call: R|<local>/z|.R|/B.bar|()" style="filled" fillcolor=yellow];
104 [label="Exit block"];
}
105 [label="Exit when branch result"];
106 [label="Exit when"];
}
107 [label="Exit block"];
}
108 [label="Exit function test_3" style="filled" fillcolor=red];
}
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73 74};
73 -> {83};
74 -> {75};
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {84};
84 -> {85};
85 -> {86};
86 -> {87};
87 -> {88};
88 -> {89};
89 -> {90};
90 -> {91 92};
91 -> {106};
92 -> {93};
93 -> {94};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
subgraph cluster_30 {
color=red
109 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_31 {
color=blue
110 [label="Enter block"];
111 [label="Const: Int(1)"];
112 [label="Variable declaration: lvar x: R|kotlin/Any|"];
113 [label="Access variable R|<local>/x|"];
114 [label="Type operator: (R|<local>/x| as R|kotlin/Int|)"];
subgraph cluster_32 {
color=blue
115 [label="Function call arguments enter"];
116 [label="Access variable R|<local>/x|"];
117 [label="Smart cast: R|<local>/x|"];
118 [label="Function call arguments exit"];
}
119 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
120 [label="Access variable R|<local>/y|"];
121 [label="Assignment: R|<local>/x|"];
subgraph cluster_33 {
color=blue
122 [label="Function call arguments enter"];
123 [label="Access variable R|<local>/x|"];
124 [label="Function call arguments exit"];
}
125 [label="Function call: R|<local>/x|.<Unresolved name: inc>#()" style="filled" fillcolor=yellow];
subgraph cluster_34 {
color=blue
126 [label="Enter when"];
subgraph cluster_35 {
color=blue
127 [label="Enter when branch condition "];
128 [label="Access variable R|<local>/y|"];
129 [label="Type operator: (R|<local>/y| is R|A|)"];
130 [label="Exit when branch condition"];
}
131 [label="Synthetic else branch"];
132 [label="Enter when branch result"];
subgraph cluster_36 {
color=blue
133 [label="Enter block"];
subgraph cluster_37 {
color=blue
134 [label="Function call arguments enter"];
135 [label="Access variable R|<local>/x|"];
136 [label="Smart cast: R|<local>/x|"];
137 [label="Function call arguments exit"];
}
138 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
subgraph cluster_38 {
color=blue
139 [label="Function call arguments enter"];
140 [label="Access variable R|<local>/y|"];
141 [label="Smart cast: R|<local>/y|"];
142 [label="Function call arguments exit"];
}
143 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
144 [label="Exit block"];
}
145 [label="Exit when branch result"];
146 [label="Exit when"];
}
147 [label="Exit block"];
}
148 [label="Exit function test_4" style="filled" fillcolor=red];
}
109 -> {110};
110 -> {111};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {117};
117 -> {118};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {124};
124 -> {125};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {129};
129 -> {130};
130 -> {131 132};
131 -> {146};
132 -> {133};
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {145};
145 -> {146};
146 -> {147};
147 -> {148};
subgraph cluster_39 {
color=red
149 [label="Enter class D" style="filled" fillcolor=red];
subgraph cluster_40 {
color=blue
150 [label="Enter function <init>" style="filled" fillcolor=red];
151 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
152 [label="Exit function <init>" style="filled" fillcolor=red];
}
subgraph cluster_41 {
color=blue
153 [label="Enter property" style="filled" fillcolor=red];
154 [label="Access variable R|<local>/any|"];
155 [label="Exit property" style="filled" fillcolor=red];
}
156 [label="Exit class D" style="filled" fillcolor=red];
}
149 -> {150} [color=green];
149 -> {156} [style=dotted];
149 -> {150 153} [style=dashed];
150 -> {151};
151 -> {152};
152 -> {153} [color=green];
153 -> {154};
154 -> {155};
155 -> {156} [color=green];
subgraph cluster_42 {
color=red
157 [label="Enter function baz" style="filled" fillcolor=red];
subgraph cluster_43 {
color=blue
158 [label="Enter block"];
159 [label="Exit block"];
}
160 [label="Exit function baz" style="filled" fillcolor=red];
}
157 -> {158};
158 -> {159};
159 -> {160};
subgraph cluster_44 {
color=red
161 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_45 {
color=blue
162 [label="Enter block"];
163 [label="Access variable R|<local>/d|"];
164 [label="Access variable R|/D.any|"];
165 [label="Exit lhs of ?:"];
166 [label="Enter rhs of ?:"];
167 [label="Jump: ^test_5 Unit"];
168 [label="Stub" style="filled" fillcolor=gray];
169 [label="Lhs of ?: is not null"];
170 [label="Exit ?:"];
171 [label="Variable declaration: lval a: R|kotlin/Any|"];
subgraph cluster_46 {
color=blue
172 [label="Function call arguments enter"];
173 [label="Access variable R|<local>/a|"];
174 [label="Function call arguments exit"];
}
175 [label="Function call: R|<local>/a|.R|/baz|()" style="filled" fillcolor=yellow];
subgraph cluster_47 {
color=blue
176 [label="Function call arguments enter"];
177 [label="Access variable R|<local>/d|"];
178 [label="Access variable R|/D.any|"];
179 [label="Smart cast: R|<local>/d|.R|/D.any|"];
180 [label="Function call arguments exit"];
}
181 [label="Function call: R|<local>/d|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
182 [label="Access variable R|<local>/a|"];
183 [label="Type operator: (R|<local>/a| as R|A|)"];
subgraph cluster_48 {
color=blue
184 [label="Function call arguments enter"];
185 [label="Access variable R|<local>/a|"];
186 [label="Smart cast: R|<local>/a|"];
187 [label="Function call arguments exit"];
}
188 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
189 [label="Exit block"];
}
190 [label="Exit function test_5" style="filled" fillcolor=red];
}
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {165};
165 -> {166 169};
166 -> {167};
167 -> {190};
167 -> {168} [style=dotted];
168 -> {170} [style=dotted];
169 -> {170};
170 -> {171};
171 -> {172};
172 -> {173};
173 -> {174};
174 -> {175};
175 -> {176};
176 -> {177};
177 -> {178};
178 -> {179};
179 -> {180};
180 -> {181};
181 -> {182};
182 -> {183};
183 -> {184};
184 -> {185};
185 -> {186};
186 -> {187};
187 -> {188};
188 -> {189};
189 -> {190};
subgraph cluster_49 {
color=red
191 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_50 {
color=blue
192 [label="Enter block"];
193 [label="Access variable R|<local>/d1|"];
194 [label="Access variable R|/D.any|"];
195 [label="Variable declaration: lval a: R|kotlin/Any?|"];
196 [label="Access variable R|<local>/a|"];
197 [label="Type operator: (R|<local>/a| as R|A|)"];
subgraph cluster_51 {
color=blue
198 [label="Function call arguments enter"];
199 [label="Access variable R|<local>/a|"];
200 [label="Smart cast: R|<local>/a|"];
201 [label="Function call arguments exit"];
}
202 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
subgraph cluster_52 {
color=blue
203 [label="Function call arguments enter"];
204 [label="Access variable R|<local>/d1|"];
205 [label="Access variable R|/D.any|"];
206 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
207 [label="Function call arguments exit"];
}
208 [label="Function call: R|<local>/d1|.R|/D.any|.R|/A.foo|()" style="filled" fillcolor=yellow];
subgraph cluster_53 {
color=blue
209 [label="Function call arguments enter"];
210 [label="Access variable R|<local>/d1|"];
211 [label="Access variable R|/D.any|"];
212 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
213 [label="Function call arguments exit"];
}
214 [label="Function call: R|<local>/d1|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
215 [label="Exit block"];
}
216 [label="Exit function test_6" style="filled" fillcolor=red];
}
191 -> {192};
192 -> {193};
193 -> {194};
194 -> {195};
195 -> {196};
196 -> {197};
197 -> {198};
198 -> {199};
199 -> {200};
200 -> {201};
201 -> {202};
202 -> {203};
203 -> {204};
204 -> {205};
205 -> {206};
206 -> {207};
207 -> {208};
208 -> {209};
209 -> {210};
210 -> {211};
211 -> {212};
212 -> {213};
213 -> {214};
214 -> {215};
215 -> {216};
subgraph cluster_54 {
color=red
217 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_55 {
color=blue
218 [label="Enter block"];
219 [label="Access variable R|<local>/d1|"];
220 [label="Enter safe call"];
221 [label="Access variable R|/D.any|"];
222 [label="Exit safe call"];
223 [label="Variable declaration: lval a: R|kotlin/Any?|"];
224 [label="Access variable R|<local>/d2|"];
225 [label="Enter safe call"];
226 [label="Access variable R|/D.any|"];
227 [label="Exit safe call"];
228 [label="Variable declaration: lval b: R|kotlin/Any?|"];
229 [label="Access variable R|<local>/a|"];
230 [label="Type operator: (R|<local>/a| as R|A|)"];
subgraph cluster_56 {
color=blue
231 [label="Function call arguments enter"];
232 [label="Access variable R|<local>/a|"];
233 [label="Smart cast: R|<local>/a|"];
234 [label="Function call arguments exit"];
}
235 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
236 [label="Access variable R|<local>/b|"];
237 [label="Type operator: (R|<local>/b| as R|B|)"];
subgraph cluster_57 {
color=blue
238 [label="Function call arguments enter"];
239 [label="Access variable R|<local>/b|"];
240 [label="Smart cast: R|<local>/b|"];
241 [label="Function call arguments exit"];
}
242 [label="Function call: R|<local>/b|.R|/B.bar|()" style="filled" fillcolor=yellow];
243 [label="Exit block"];
}
244 [label="Exit function test_7" style="filled" fillcolor=red];
}
217 -> {218};
218 -> {219};
219 -> {220 222};
220 -> {221};
221 -> {222};
222 -> {223};
223 -> {224};
224 -> {225 227};
225 -> {226};
226 -> {227};
227 -> {228};
228 -> {229};
229 -> {230};
230 -> {231};
231 -> {232};
232 -> {233};
233 -> {234};
234 -> {235};
235 -> {236};
236 -> {237};
237 -> {238};
238 -> {239};
239 -> {240};
240 -> {241};
241 -> {242};
242 -> {243};
243 -> {244};
}