Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot
T
Brian Norman b55fda0c55 [FIR] Create CFG for files to track top-level property initialization
In order to properly analyze top-level property initialization, a
control-flow graph must be created for FirFiles. This change adds the
foundation for the file CFG and updates body resolve to create the CFG.
Checking the CFG for proper initialization is separated into a following
change to ease code review.

KT-56683
2023-08-31 12:50:52 +00:00

635 lines
24 KiB
Plaintext
Vendored

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