102c9c08d0
Before that commit we desugared `a ?: b` as
when (val elvis = a) {
null -> b
else -> elvis
}
It was incorrect, because `a` should be resolved in dependent mode,
but when it was `elvis` initializer it was resolved in independent
mode, so we can't infer type for `a` in some complex cases
201 lines
6.5 KiB
Plaintext
Vendored
201 lines
6.5 KiB
Plaintext
Vendored
digraph elvis_kt {
|
|
graph [nodesep=3]
|
|
node [shape=box penwidth=2]
|
|
edge [penwidth=2]
|
|
|
|
subgraph cluster_0 {
|
|
color=red
|
|
0 [label="Enter class A" style="filled" fillcolor=red];
|
|
1 [label="Exit class A" style="filled" fillcolor=red];
|
|
}
|
|
0 -> {1} [color=green];
|
|
|
|
subgraph cluster_1 {
|
|
color=red
|
|
2 [label="Enter function foo" style="filled" fillcolor=red];
|
|
3 [label="Exit function foo" style="filled" fillcolor=red];
|
|
}
|
|
2 -> {3};
|
|
|
|
subgraph cluster_2 {
|
|
color=red
|
|
4 [label="Enter function getter" style="filled" fillcolor=red];
|
|
5 [label="Exit function getter" style="filled" fillcolor=red];
|
|
}
|
|
4 -> {5};
|
|
|
|
subgraph cluster_3 {
|
|
color=red
|
|
6 [label="Enter function test_1" style="filled" fillcolor=red];
|
|
subgraph cluster_4 {
|
|
color=blue
|
|
7 [label="Enter block"];
|
|
subgraph cluster_5 {
|
|
color=blue
|
|
8 [label="Enter when"];
|
|
subgraph cluster_6 {
|
|
color=blue
|
|
9 [label="Enter when branch condition "];
|
|
10 [label="Access variable R|<local>/x|"];
|
|
11 [label="Enter safe call"];
|
|
12 [label="Access variable R|/A.b|"];
|
|
13 [label="Exit safe call"];
|
|
14 [label="Exit lhs of ?:"];
|
|
15 [label="Enter rhs of ?:"];
|
|
16 [label="Jump: ^test_1 Unit"];
|
|
17 [label="Stub" style="filled" fillcolor=gray];
|
|
18 [label="Lhs of ?: is not null"];
|
|
19 [label="Exit ?:"];
|
|
20 [label="Exit when branch condition"];
|
|
}
|
|
21 [label="Synthetic else branch"];
|
|
22 [label="Enter when branch result"];
|
|
subgraph cluster_7 {
|
|
color=blue
|
|
23 [label="Enter block"];
|
|
24 [label="Access variable R|<local>/x|"];
|
|
25 [label="Function call: R|<local>/x|.R|/A.foo|()"];
|
|
26 [label="Exit block"];
|
|
}
|
|
27 [label="Exit when branch result"];
|
|
28 [label="Exit when"];
|
|
}
|
|
29 [label="Exit block"];
|
|
}
|
|
30 [label="Exit function test_1" style="filled" fillcolor=red];
|
|
}
|
|
6 -> {7};
|
|
7 -> {8};
|
|
8 -> {9};
|
|
9 -> {10};
|
|
10 -> {11 13};
|
|
11 -> {12};
|
|
12 -> {13};
|
|
13 -> {14};
|
|
14 -> {18 15};
|
|
15 -> {16};
|
|
16 -> {30};
|
|
16 -> {17} [style=dotted];
|
|
17 -> {19} [style=dotted];
|
|
18 -> {19};
|
|
19 -> {20};
|
|
20 -> {22 21};
|
|
21 -> {28};
|
|
22 -> {23};
|
|
23 -> {24};
|
|
24 -> {25};
|
|
25 -> {26};
|
|
26 -> {27};
|
|
27 -> {28};
|
|
28 -> {29};
|
|
29 -> {30};
|
|
|
|
subgraph cluster_8 {
|
|
color=red
|
|
31 [label="Enter function test2" style="filled" fillcolor=red];
|
|
subgraph cluster_9 {
|
|
color=blue
|
|
32 [label="Enter block"];
|
|
subgraph cluster_10 {
|
|
color=blue
|
|
33 [label="Enter when"];
|
|
subgraph cluster_11 {
|
|
color=blue
|
|
34 [label="Enter when branch condition "];
|
|
35 [label="Access variable R|<local>/b|"];
|
|
36 [label="Type operator: (R|<local>/b| !is R|kotlin/String|)"];
|
|
37 [label="Exit when branch condition"];
|
|
}
|
|
38 [label="Synthetic else branch"];
|
|
39 [label="Enter when branch result"];
|
|
subgraph cluster_12 {
|
|
color=blue
|
|
40 [label="Enter block"];
|
|
41 [label="Const: String()"];
|
|
42 [label="Jump: ^test2 String()"];
|
|
43 [label="Stub" style="filled" fillcolor=gray];
|
|
44 [label="Exit block" style="filled" fillcolor=gray];
|
|
}
|
|
45 [label="Exit when branch result" style="filled" fillcolor=gray];
|
|
46 [label="Exit when"];
|
|
}
|
|
subgraph cluster_13 {
|
|
color=blue
|
|
47 [label="Enter when"];
|
|
subgraph cluster_14 {
|
|
color=blue
|
|
48 [label="Enter when branch condition "];
|
|
49 [label="Access variable R|<local>/a|"];
|
|
50 [label="Type operator: (R|<local>/a| !is R|kotlin/String?|)"];
|
|
51 [label="Exit when branch condition"];
|
|
}
|
|
52 [label="Synthetic else branch"];
|
|
53 [label="Enter when branch result"];
|
|
subgraph cluster_15 {
|
|
color=blue
|
|
54 [label="Enter block"];
|
|
55 [label="Const: String()"];
|
|
56 [label="Jump: ^test2 String()"];
|
|
57 [label="Stub" style="filled" fillcolor=gray];
|
|
58 [label="Exit block" style="filled" fillcolor=gray];
|
|
}
|
|
59 [label="Exit when branch result" style="filled" fillcolor=gray];
|
|
60 [label="Exit when"];
|
|
}
|
|
61 [label="Access variable R|<local>/a|"];
|
|
62 [label="Exit lhs of ?:"];
|
|
63 [label="Enter rhs of ?:"];
|
|
64 [label="Access variable R|<local>/b|"];
|
|
65 [label="Lhs of ?: is not null"];
|
|
66 [label="Exit ?:"];
|
|
67 [label="Jump: ^test2 R|<local>/a| ?: R|<local>/b|"];
|
|
68 [label="Stub" style="filled" fillcolor=gray];
|
|
69 [label="Exit block" style="filled" fillcolor=gray];
|
|
}
|
|
70 [label="Exit function test2" style="filled" fillcolor=red];
|
|
}
|
|
31 -> {32};
|
|
32 -> {33};
|
|
33 -> {34};
|
|
34 -> {35};
|
|
35 -> {36};
|
|
36 -> {37};
|
|
37 -> {39 38};
|
|
38 -> {46};
|
|
39 -> {40};
|
|
40 -> {41};
|
|
41 -> {42};
|
|
42 -> {70};
|
|
42 -> {43} [style=dotted];
|
|
43 -> {44} [style=dotted];
|
|
44 -> {45} [style=dotted];
|
|
45 -> {46} [style=dotted];
|
|
46 -> {47};
|
|
47 -> {48};
|
|
48 -> {49};
|
|
49 -> {50};
|
|
50 -> {51};
|
|
51 -> {53 52};
|
|
52 -> {60};
|
|
53 -> {54};
|
|
54 -> {55};
|
|
55 -> {56};
|
|
56 -> {70};
|
|
56 -> {57} [style=dotted];
|
|
57 -> {58} [style=dotted];
|
|
58 -> {59} [style=dotted];
|
|
59 -> {60} [style=dotted];
|
|
60 -> {61};
|
|
61 -> {62};
|
|
62 -> {65 63};
|
|
63 -> {64};
|
|
64 -> {66};
|
|
65 -> {66};
|
|
66 -> {67};
|
|
67 -> {70};
|
|
67 -> {68} [style=dotted];
|
|
68 -> {69} [style=dotted];
|
|
69 -> {70} [style=dotted];
|
|
|
|
}
|