Files
kotlin-fork/compiler/testData/diagnostics/tests/script/NestedInnerClass.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

336 lines
12 KiB
Plaintext
Vendored

digraph NestedInnerClass_fir_kts {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter file NestedInnerClass.fir.kts [1]" style="filled" fillcolor=red];
1 [label="Exit file NestedInnerClass.fir.kts [1]" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter class <script-NestedInnerClass.fir.kts> [2]" style="filled" fillcolor=red];
subgraph cluster_2 {
color=blue
3 [label="Enter property [3]" style="filled" fillcolor=red];
4 [label="Const: String() [3]"];
5 [label="Exit property [3]" style="filled" fillcolor=red];
}
6 [label="Exit class <script-NestedInnerClass.fir.kts> [2]" 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 function [3]" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
8 [label="Enter block [3]"];
9 [label="Const: Int(42) [3]"];
10 [label="Jump: ^function Int(42) [3]"];
11 [label="Stub [3]" style="filled" fillcolor=gray];
12 [label="Exit block [3]" style="filled" fillcolor=gray];
}
13 [label="Exit function function [3]" style="filled" fillcolor=red];
}
7 -> {8};
8 -> {9};
9 -> {10};
10 -> {13};
10 -> {11} [style=dotted];
11 -> {12} [style=dotted];
12 -> {13} [style=dotted];
subgraph cluster_5 {
color=red
14 [label="Enter class Nested [3]" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
15 [label="Enter function <init> [4]" style="filled" fillcolor=red];
16 [label="Delegated constructor call: super<R|kotlin/Any|>() [4]" style="filled" fillcolor=yellow];
17 [label="Exit function <init> [4]" style="filled" fillcolor=red];
}
18 [label="Exit class Nested [3]" style="filled" fillcolor=red];
}
14 -> {15} [color=green];
14 -> {18} [style=dotted];
14 -> {15} [style=dashed];
15 -> {16};
16 -> {17};
17 -> {18} [color=green];
subgraph cluster_7 {
color=red
19 [label="Enter function f [4]" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
20 [label="Enter block [4]"];
subgraph cluster_9 {
color=blue
21 [label="Function call arguments enter [4]"];
22 [label="Function call arguments exit [4]"];
}
23 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow];
24 [label="Jump: ^f R|/function|() [4]"];
25 [label="Stub [4]" style="filled" fillcolor=gray];
26 [label="Exit block [4]" style="filled" fillcolor=gray];
}
27 [label="Exit function f [4]" style="filled" fillcolor=red];
}
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {27};
24 -> {25} [style=dotted];
25 -> {26} [style=dotted];
26 -> {27} [style=dotted];
subgraph cluster_10 {
color=red
28 [label="Enter function g [4]" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
29 [label="Enter block [4]"];
30 [label="Access variable R|/property| [4]"];
31 [label="Jump: ^g R|/property| [4]"];
32 [label="Stub [4]" style="filled" fillcolor=gray];
33 [label="Exit block [4]" style="filled" fillcolor=gray];
}
34 [label="Exit function g [4]" style="filled" fillcolor=red];
}
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {34};
31 -> {32} [style=dotted];
32 -> {33} [style=dotted];
33 -> {34} [style=dotted];
subgraph cluster_12 {
color=red
35 [label="Enter class Inner [3]" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
36 [label="Enter function <init> [4]" style="filled" fillcolor=red];
37 [label="Delegated constructor call: super<R|kotlin/Any|>() [4]" style="filled" fillcolor=yellow];
38 [label="Exit function <init> [4]" style="filled" fillcolor=red];
}
subgraph cluster_14 {
color=blue
39 [label="Enter property [4]" style="filled" fillcolor=red];
40 [label="Access variable R|/property| [4]"];
41 [label="Exit property [4]" style="filled" fillcolor=red];
}
subgraph cluster_15 {
color=blue
42 [label="Enter property [4]" style="filled" fillcolor=red];
43 [label="Access variable this@NestedInnerClass# [4]"];
44 [label="Access variable <Unresolved name: property># [4]"];
45 [label="Exit property [4]" style="filled" fillcolor=red];
}
46 [label="Exit class Inner [3]" style="filled" fillcolor=red];
}
35 -> {36} [color=green];
35 -> {46} [style=dotted];
35 -> {36 39 42} [style=dashed];
36 -> {37};
37 -> {38};
38 -> {39} [color=green];
39 -> {40};
40 -> {41};
41 -> {42} [color=green];
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46} [color=green];
subgraph cluster_16 {
color=red
47 [label="Enter function innerFun [4]" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
48 [label="Enter block [4]"];
subgraph cluster_18 {
color=blue
49 [label="Function call arguments enter [4]"];
50 [label="Function call arguments exit [4]"];
}
51 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow];
52 [label="Jump: ^innerFun R|/function|() [4]"];
53 [label="Stub [4]" style="filled" fillcolor=gray];
54 [label="Exit block [4]" style="filled" fillcolor=gray];
}
55 [label="Exit function innerFun [4]" style="filled" fillcolor=red];
}
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {55};
52 -> {53} [style=dotted];
53 -> {54} [style=dotted];
54 -> {55} [style=dotted];
subgraph cluster_19 {
color=red
56 [label="Enter function innerThisFun [4]" style="filled" fillcolor=red];
subgraph cluster_20 {
color=blue
57 [label="Enter block [4]"];
subgraph cluster_21 {
color=blue
58 [label="Function call arguments enter [4]"];
59 [label="Access variable this@NestedInnerClass# [4]"];
60 [label="Function call arguments exit [4]"];
}
61 [label="Function call: this@NestedInnerClass#.<Unresolved name: function>#() [4]" style="filled" fillcolor=yellow];
62 [label="Jump: ^innerThisFun this@NestedInnerClass#.<Unresolved name: function>#() [4]"];
63 [label="Stub [4]" style="filled" fillcolor=gray];
64 [label="Exit block [4]" style="filled" fillcolor=gray];
}
65 [label="Exit function innerThisFun [4]" style="filled" fillcolor=red];
}
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {65};
62 -> {63} [style=dotted];
63 -> {64} [style=dotted];
64 -> {65} [style=dotted];
subgraph cluster_22 {
color=red
66 [label="Enter class InnerInner [4]" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
67 [label="Enter function <init> [5]" style="filled" fillcolor=red];
68 [label="Delegated constructor call: super<R|kotlin/Any|>() [5]" style="filled" fillcolor=yellow];
69 [label="Exit function <init> [5]" style="filled" fillcolor=red];
}
70 [label="Exit class InnerInner [4]" style="filled" fillcolor=red];
}
66 -> {67} [color=green];
66 -> {70} [style=dotted];
66 -> {67} [style=dashed];
67 -> {68};
68 -> {69};
69 -> {70} [color=green];
subgraph cluster_24 {
color=red
71 [label="Enter function f [5]" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
72 [label="Enter block [5]"];
subgraph cluster_26 {
color=blue
73 [label="Function call arguments enter [5]"];
74 [label="Function call arguments exit [5]"];
}
75 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow];
76 [label="Jump: ^f this@R|/Inner|.R|/Inner.innerFun|() [5]"];
77 [label="Stub [5]" style="filled" fillcolor=gray];
78 [label="Exit block [5]" style="filled" fillcolor=gray];
}
79 [label="Exit function f [5]" style="filled" fillcolor=red];
}
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {75};
75 -> {76};
76 -> {79};
76 -> {77} [style=dotted];
77 -> {78} [style=dotted];
78 -> {79} [style=dotted];
subgraph cluster_27 {
color=red
80 [label="Enter function g [5]" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
81 [label="Enter block [5]"];
82 [label="Access variable R|/Inner.innerProp| [5]"];
83 [label="Jump: ^g this@R|/Inner|.R|/Inner.innerProp| [5]"];
84 [label="Stub [5]" style="filled" fillcolor=gray];
85 [label="Exit block [5]" style="filled" fillcolor=gray];
}
86 [label="Exit function g [5]" style="filled" fillcolor=red];
}
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {86};
83 -> {84} [style=dotted];
84 -> {85} [style=dotted];
85 -> {86} [style=dotted];
subgraph cluster_29 {
color=red
87 [label="Enter function h [5]" style="filled" fillcolor=red];
subgraph cluster_30 {
color=blue
88 [label="Enter block [5]"];
subgraph cluster_31 {
color=blue
89 [label="Function call arguments enter [5]"];
90 [label="Access variable this@R|/Inner| [5]"];
91 [label="Function call arguments exit [5]"];
}
92 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow];
93 [label="Jump: ^h this@R|/Inner|.R|/Inner.innerFun|() [5]"];
94 [label="Stub [5]" style="filled" fillcolor=gray];
95 [label="Exit block [5]" style="filled" fillcolor=gray];
}
96 [label="Exit function h [5]" style="filled" fillcolor=red];
}
87 -> {88};
88 -> {89};
89 -> {90};
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {96};
93 -> {94} [style=dotted];
94 -> {95} [style=dotted];
95 -> {96} [style=dotted];
subgraph cluster_32 {
color=red
97 [label="Enter function i [5]" style="filled" fillcolor=red];
subgraph cluster_33 {
color=blue
98 [label="Enter block [5]"];
99 [label="Access variable this@R|/Inner| [5]"];
100 [label="Access variable R|/Inner.innerProp| [5]"];
101 [label="Jump: ^i this@R|/Inner|.R|/Inner.innerProp| [5]"];
102 [label="Stub [5]" style="filled" fillcolor=gray];
103 [label="Exit block [5]" style="filled" fillcolor=gray];
}
104 [label="Exit function i [5]" style="filled" fillcolor=red];
}
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {104};
101 -> {102} [style=dotted];
102 -> {103} [style=dotted];
103 -> {104} [style=dotted];
}