[FIR] Properly support smartcasts on stable when subjects in when conditions

^KT-49860 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-11-24 17:14:21 +03:00
committed by teamcityserver
parent 20425fb458
commit 330574cab6
41 changed files with 1225 additions and 791 deletions
@@ -0,0 +1,198 @@
digraph whenSubjectExpression_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function whenWithSubjectExpression" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
subgraph cluster_2 {
color=blue
2 [label="Enter when"];
3 [label="Access variable R|<local>/x|"];
subgraph cluster_3 {
color=blue
4 [label="Enter when branch condition "];
5 [label="Exit $subj"];
6 [label="Type operator: ($subj$ !is R|kotlin/Double|)"];
7 [label="Exit when branch condition"];
}
subgraph cluster_4 {
color=blue
8 [label="Enter when branch condition "];
9 [label="Exit $subj"];
10 [label="Const: Double(0.0)"];
11 [label="Equality operator =="];
12 [label="Exit when branch condition"];
}
subgraph cluster_5 {
color=blue
13 [label="Enter when branch condition else"];
14 [label="Exit when branch condition"];
}
15 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
16 [label="Enter block"];
17 [label="Access variable R|<local>/x|"];
18 [label="Function call: R|<local>/x|.R|kotlin/Double.toInt|()"];
19 [label="Exit block"];
}
20 [label="Exit when branch result"];
21 [label="Enter when branch result"];
subgraph cluster_7 {
color=blue
22 [label="Enter block"];
23 [label="Const: Int(0)"];
24 [label="Exit block"];
}
25 [label="Exit when branch result"];
26 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
27 [label="Enter block"];
28 [label="Const: Int(-1)"];
29 [label="Exit block"];
}
30 [label="Exit when branch result"];
31 [label="Exit when"];
}
32 [label="Exit block"];
}
33 [label="Exit function whenWithSubjectExpression" style="filled" fillcolor=red];
}
0 -> {1};
1 -> {2};
2 -> {3};
3 -> {4};
4 -> {5};
5 -> {6};
6 -> {7};
7 -> {26 8};
8 -> {9};
9 -> {10};
10 -> {11};
11 -> {12};
12 -> {21 13};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {31};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {31};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
subgraph cluster_9 {
color=red
34 [label="Enter function whenWithSubjectVariable" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
35 [label="Enter block"];
subgraph cluster_11 {
color=blue
36 [label="Enter when"];
37 [label="Access variable R|<local>/x|"];
38 [label="Variable declaration: lval y: R|kotlin/Any|"];
subgraph cluster_12 {
color=blue
39 [label="Enter when branch condition "];
40 [label="Exit $subj"];
41 [label="Type operator: ($subj$ !is R|kotlin/Double|)"];
42 [label="Exit when branch condition"];
}
subgraph cluster_13 {
color=blue
43 [label="Enter when branch condition "];
44 [label="Exit $subj"];
45 [label="Const: Double(0.0)"];
46 [label="Equality operator =="];
47 [label="Exit when branch condition"];
}
subgraph cluster_14 {
color=blue
48 [label="Enter when branch condition else"];
49 [label="Exit when branch condition"];
}
50 [label="Enter when branch result"];
subgraph cluster_15 {
color=blue
51 [label="Enter block"];
52 [label="Access variable R|<local>/y|"];
53 [label="Function call: R|<local>/y|.R|kotlin/Double.toInt|()"];
54 [label="Exit block"];
}
55 [label="Exit when branch result"];
56 [label="Enter when branch result"];
subgraph cluster_16 {
color=blue
57 [label="Enter block"];
58 [label="Const: Int(0)"];
59 [label="Exit block"];
}
60 [label="Exit when branch result"];
61 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
62 [label="Enter block"];
63 [label="Const: Int(-1)"];
64 [label="Exit block"];
}
65 [label="Exit when branch result"];
66 [label="Exit when"];
}
67 [label="Exit block"];
}
68 [label="Exit function whenWithSubjectVariable" style="filled" fillcolor=red];
}
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {61 43};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {56 48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {66};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {66};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
}