Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot
T
Tianyu Geng 6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00

310 lines
9.9 KiB
Plaintext
Vendored

digraph safeCalls_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
2 [label="Const: String()"];
3 [label="Jump: ^foo String()"];
4 [label="Stub" style="filled" fillcolor=gray];
5 [label="Exit block" style="filled" fillcolor=gray];
}
6 [label="Exit function foo" style="filled" fillcolor=red];
}
0 -> {1};
1 -> {2};
2 -> {3};
3 -> {6};
3 -> {4} [style=dotted];
4 -> {5} [style=dotted];
5 -> {6} [style=dotted];
subgraph cluster_2 {
color=red
7 [label="Enter function let" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
8 [label="Enter block"];
9 [label="Exit block"];
}
10 [label="Exit function let" style="filled" fillcolor=red];
}
7 -> {8};
8 -> {9};
9 -> {10};
subgraph cluster_4 {
color=red
11 [label="Enter function test" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
12 [label="Enter block"];
13 [label="Access variable R|<local>/x|"];
14 [label="Enter safe call"];
15 [label="Access variable R|<local>/x|"];
16 [label="Access variable R|kotlin/String.length|"];
17 [label="Const: Int(1)"];
18 [label="Equality operator =="];
19 [label="Function call: $subj$.R|/foo|(...)"];
20 [label="Exit safe call"];
21 [label="Access variable R|<local>/x|"];
22 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
23 [label="Exit block"];
}
24 [label="Exit function test" style="filled" fillcolor=red];
}
11 -> {12};
12 -> {13};
13 -> {14 20};
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
subgraph cluster_6 {
color=red
25 [label="Enter class A" style="filled" fillcolor=red];
26 [label="Exit class A" style="filled" fillcolor=red];
}
25 -> {26} [color=green];
subgraph cluster_7 {
color=red
27 [label="Enter function bar" style="filled" fillcolor=red];
28 [label="Exit function bar" style="filled" fillcolor=red];
}
27 -> {28};
subgraph cluster_8 {
color=red
29 [label="Enter function bool" style="filled" fillcolor=red];
30 [label="Exit function bool" style="filled" fillcolor=red];
}
29 -> {30};
subgraph cluster_9 {
color=red
31 [label="Enter function id" style="filled" fillcolor=red];
32 [label="Exit function id" style="filled" fillcolor=red];
}
31 -> {32};
subgraph cluster_10 {
color=red
33 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
34 [label="Enter block"];
35 [label="Access variable R|<local>/x|"];
36 [label="Type operator: (R|<local>/x| as? R|A|)"];
37 [label="Enter safe call"];
38 [label="Access variable R|<local>/x|"];
39 [label="Function call: $subj$.R|/A.bar|(...)"];
40 [label="Exit safe call"];
41 [label="Exit block"];
}
42 [label="Exit function test_2" style="filled" fillcolor=red];
}
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37 40};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
subgraph cluster_12 {
color=red
43 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
44 [label="Enter block"];
45 [label="Access variable R|<local>/x|"];
46 [label="Type operator: (R|<local>/x| as? R|A|)"];
47 [label="Enter safe call"];
48 [label="Access variable R|<local>/x|"];
49 [label="Function call: $subj$.R|/A.bar|(...)"];
50 [label="Exit safe call"];
51 [label="Enter safe call"];
52 [label="Access variable R|<local>/x|"];
53 [label="Function call: R|<local>/x|.R|/A.bool|()"];
54 [label="Function call: $subj$.R|/foo|(...)"];
55 [label="Exit safe call"];
56 [label="Enter safe call"];
57 [label="Postponed enter to lambda"];
subgraph cluster_14 {
color=blue
65 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_15 {
color=blue
66 [label="Enter block"];
67 [label="Access variable R|<local>/x|"];
68 [label="Function call: R|<local>/x|.R|/A.bool|()"];
69 [label="Exit block"];
}
70 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
58 [label="Postponed exit from lambda"];
59 [label="Function call: $subj$.R|/let|(...)"];
60 [label="Exit safe call"];
61 [label="Access variable R|<local>/x|"];
62 [label="Function call: R|<local>/x|.<Unresolved name: bool>#()"];
63 [label="Exit block"];
}
64 [label="Exit function test_3" style="filled" fillcolor=red];
}
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47 50};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51 55};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56 60};
56 -> {57};
57 -> {58 65};
57 -> {65} [style=dashed];
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
subgraph cluster_16 {
color=red
71 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
72 [label="Enter block"];
73 [label="Access variable R|<local>/x|"];
74 [label="Enter safe call"];
75 [label="Function call: $subj$.R|/A.id|()"];
76 [label="Exit safe call"];
77 [label="Enter safe call"];
78 [label="Function call: $subj$.R|/A.bool|()"];
79 [label="Exit safe call"];
80 [label="Access variable R|<local>/x|"];
81 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()"];
82 [label="Exit block"];
}
83 [label="Exit function test_4" style="filled" fillcolor=red];
}
71 -> {72};
72 -> {73};
73 -> {74 76};
74 -> {75};
75 -> {76};
76 -> {77 79};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
subgraph cluster_18 {
color=red
84 [label="Enter function boo" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
85 [label="Enter block"];
86 [label="Exit block"];
}
87 [label="Exit function boo" style="filled" fillcolor=red];
}
84 -> {85};
85 -> {86};
86 -> {87};
subgraph cluster_20 {
color=red
88 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
89 [label="Enter block"];
90 [label="Access variable R|<local>/x|"];
91 [label="Enter safe call"];
92 [label="Postponed enter to lambda"];
subgraph cluster_22 {
color=blue
107 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
108 [label="Enter block"];
109 [label="Jump: ^test_5 Unit"];
110 [label="Stub" style="filled" fillcolor=gray];
111 [label="Exit block" style="filled" fillcolor=gray];
}
112 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
93 [label="Call arguments union" style="filled" fillcolor=gray];
94 [label="Postponed exit from lambda" style="filled" fillcolor=gray];
95 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)" style="filled" fillcolor=gray];
96 [label="Stub" style="filled" fillcolor=gray];
97 [label="Exit safe call"];
98 [label="Enter safe call"];
99 [label="Access variable R|<local>/x|"];
100 [label="Function call: R|<local>/x|.R|/A.bool|()"];
101 [label="Function call: $subj$.R|/boo|(...)"];
102 [label="Exit safe call"];
103 [label="Access variable R|<local>/x|"];
104 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()"];
105 [label="Exit block"];
}
106 [label="Exit function test_5" style="filled" fillcolor=red];
}
88 -> {89};
89 -> {90};
90 -> {91 97};
91 -> {92};
92 -> {107};
92 -> {94} [color=red];
92 -> {107} [style=dashed];
93 -> {95} [style=dotted];
94 -> {95} [style=dotted];
95 -> {96} [style=dotted];
95 -> {106} [style=dotted] [label=onUncaughtException];
96 -> {97} [style=dotted];
97 -> {98 102};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
107 -> {108};
108 -> {109};
109 -> {106};
109 -> {110} [style=dotted];
110 -> {111} [style=dotted];
111 -> {112} [style=dotted];
112 -> {94 93} [style=dotted];
}