[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
@@ -66,43 +66,45 @@ digraph exhaustiveWhenAndDNNType_kt {
subgraph cluster_9 {
color=blue
22 [label="Enter when branch condition "];
23 [label="Access qualifier /SomeEnum"];
24 [label="Access variable R|/SomeEnum.A1|"];
25 [label="Equality operator =="];
26 [label="Exit when branch condition"];
23 [label="Exit $subj"];
24 [label="Access qualifier /SomeEnum"];
25 [label="Access variable R|/SomeEnum.A1|"];
26 [label="Equality operator =="];
27 [label="Exit when branch condition"];
}
subgraph cluster_10 {
color=blue
27 [label="Enter when branch condition "];
28 [label="Access qualifier /SomeEnum"];
29 [label="Access variable R|/SomeEnum.A2|"];
30 [label="Equality operator =="];
31 [label="Exit when branch condition"];
28 [label="Enter when branch condition "];
29 [label="Exit $subj"];
30 [label="Access qualifier /SomeEnum"];
31 [label="Access variable R|/SomeEnum.A2|"];
32 [label="Equality operator =="];
33 [label="Exit when branch condition"];
}
32 [label="Enter when branch result"];
34 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
33 [label="Enter block"];
34 [label="Function call: R|/B.B|()"];
35 [label="Exit block"];
35 [label="Enter block"];
36 [label="Function call: R|/B.B|()"];
37 [label="Exit block"];
}
36 [label="Exit when branch result"];
37 [label="Enter when branch result"];
38 [label="Exit when branch result"];
39 [label="Enter when branch result"];
subgraph cluster_12 {
color=blue
38 [label="Enter block"];
39 [label="Function call: R|/B.B|()"];
40 [label="Exit block"];
40 [label="Enter block"];
41 [label="Function call: R|/B.B|()"];
42 [label="Exit block"];
}
41 [label="Exit when branch result"];
42 [label="Exit when"];
43 [label="Exit when branch result"];
44 [label="Exit when"];
}
43 [label="Variable declaration: lval b: R|B|"];
44 [label="Access variable R|<local>/b|"];
45 [label="Function call: R|/takeB|(...)"];
46 [label="Exit block"];
45 [label="Variable declaration: lval b: R|B|"];
46 [label="Access variable R|<local>/b|"];
47 [label="Function call: R|/takeB|(...)"];
48 [label="Exit block"];
}
47 [label="Exit function test_1" style="filled" fillcolor=red];
49 [label="Exit function test_1" style="filled" fillcolor=red];
}
14 -> {15};
15 -> {16};
@@ -116,8 +118,8 @@ digraph exhaustiveWhenAndDNNType_kt {
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {37 27};
27 -> {28};
26 -> {27};
27 -> {39 28};
28 -> {29};
29 -> {30};
30 -> {31};
@@ -126,9 +128,9 @@ digraph exhaustiveWhenAndDNNType_kt {
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {42};
36 -> {37};
37 -> {38};
38 -> {39};
38 -> {44};
39 -> {40};
40 -> {41};
41 -> {42};
@@ -137,64 +139,66 @@ digraph exhaustiveWhenAndDNNType_kt {
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {49};
subgraph cluster_13 {
color=red
48 [label="Enter function test_2" style="filled" fillcolor=red];
50 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_14 {
color=blue
49 [label="Enter block"];
50 [label="Access qualifier /SomeEnum"];
51 [label="Access variable R|/SomeEnum.A1|"];
52 [label="Variable declaration: lval flag: R|SomeEnum|"];
51 [label="Enter block"];
52 [label="Access qualifier /SomeEnum"];
53 [label="Access variable R|/SomeEnum.A1|"];
54 [label="Variable declaration: lval flag: R|SomeEnum|"];
subgraph cluster_15 {
color=blue
53 [label="Enter when"];
54 [label="Access variable R|<local>/flag|"];
55 [label="Check not null: R|<local>/flag|!!"];
55 [label="Enter when"];
56 [label="Access variable R|<local>/flag|"];
57 [label="Check not null: R|<local>/flag|!!"];
subgraph cluster_16 {
color=blue
56 [label="Enter when branch condition "];
57 [label="Access qualifier /SomeEnum"];
58 [label="Access variable R|/SomeEnum.A1|"];
59 [label="Equality operator =="];
60 [label="Exit when branch condition"];
58 [label="Enter when branch condition "];
59 [label="Exit $subj"];
60 [label="Access qualifier /SomeEnum"];
61 [label="Access variable R|/SomeEnum.A1|"];
62 [label="Equality operator =="];
63 [label="Exit when branch condition"];
}
subgraph cluster_17 {
color=blue
61 [label="Enter when branch condition "];
62 [label="Access qualifier /SomeEnum"];
63 [label="Access variable R|/SomeEnum.A2|"];
64 [label="Equality operator =="];
65 [label="Exit when branch condition"];
64 [label="Enter when branch condition "];
65 [label="Exit $subj"];
66 [label="Access qualifier /SomeEnum"];
67 [label="Access variable R|/SomeEnum.A2|"];
68 [label="Equality operator =="];
69 [label="Exit when branch condition"];
}
66 [label="Enter when branch result"];
70 [label="Enter when branch result"];
subgraph cluster_18 {
color=blue
67 [label="Enter block"];
68 [label="Function call: R|/B.B|()"];
69 [label="Exit block"];
71 [label="Enter block"];
72 [label="Function call: R|/B.B|()"];
73 [label="Exit block"];
}
70 [label="Exit when branch result"];
71 [label="Enter when branch result"];
74 [label="Exit when branch result"];
75 [label="Enter when branch result"];
subgraph cluster_19 {
color=blue
72 [label="Enter block"];
73 [label="Function call: R|/B.B|()"];
74 [label="Exit block"];
76 [label="Enter block"];
77 [label="Function call: R|/B.B|()"];
78 [label="Exit block"];
}
75 [label="Exit when branch result"];
76 [label="Exit when"];
79 [label="Exit when branch result"];
80 [label="Exit when"];
}
77 [label="Variable declaration: lval b: R|B|"];
78 [label="Access variable R|<local>/b|"];
79 [label="Function call: R|/takeB|(...)"];
80 [label="Exit block"];
81 [label="Variable declaration: lval b: R|B|"];
82 [label="Access variable R|<local>/b|"];
83 [label="Function call: R|/takeB|(...)"];
84 [label="Exit block"];
}
81 [label="Exit function test_2" style="filled" fillcolor=red];
85 [label="Exit function test_2" style="filled" fillcolor=red];
}
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
@@ -205,86 +209,88 @@ digraph exhaustiveWhenAndDNNType_kt {
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {71 61};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
63 -> {75 64};
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {76};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {75};
74 -> {80};
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
subgraph cluster_20 {
color=red
82 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
83 [label="Enter block"];
84 [label="Access qualifier /SomeEnum"];
85 [label="Access variable R|/SomeEnum.A1|"];
86 [label="Variable declaration: lval flag: R|SomeEnum|"];
subgraph cluster_22 {
color=blue
87 [label="Enter when"];
88 [label="Access variable R|<local>/flag|"];
subgraph cluster_23 {
color=blue
89 [label="Enter when branch condition "];
90 [label="Access qualifier /SomeEnum"];
91 [label="Access variable R|/SomeEnum.A1|"];
92 [label="Equality operator =="];
93 [label="Exit when branch condition"];
}
subgraph cluster_24 {
color=blue
94 [label="Enter when branch condition "];
95 [label="Access qualifier /SomeEnum"];
96 [label="Access variable R|/SomeEnum.A2|"];
97 [label="Equality operator =="];
98 [label="Exit when branch condition"];
}
99 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
100 [label="Enter block"];
101 [label="Function call: R|/B.B|()"];
102 [label="Exit block"];
}
103 [label="Exit when branch result"];
104 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
105 [label="Enter block"];
106 [label="Function call: R|/B.B|()"];
107 [label="Exit block"];
}
108 [label="Exit when branch result"];
109 [label="Exit when"];
}
110 [label="Variable declaration: lval b: R|B|"];
111 [label="Access variable R|<local>/b|"];
112 [label="Function call: R|/takeB|(...)"];
113 [label="Exit block"];
}
114 [label="Exit function test_3" style="filled" fillcolor=red];
}
81 -> {82};
82 -> {83};
83 -> {84};
84 -> {85};
85 -> {86};
subgraph cluster_20 {
color=red
86 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
87 [label="Enter block"];
88 [label="Access qualifier /SomeEnum"];
89 [label="Access variable R|/SomeEnum.A1|"];
90 [label="Variable declaration: lval flag: R|SomeEnum|"];
subgraph cluster_22 {
color=blue
91 [label="Enter when"];
92 [label="Access variable R|<local>/flag|"];
subgraph cluster_23 {
color=blue
93 [label="Enter when branch condition "];
94 [label="Exit $subj"];
95 [label="Access qualifier /SomeEnum"];
96 [label="Access variable R|/SomeEnum.A1|"];
97 [label="Equality operator =="];
98 [label="Exit when branch condition"];
}
subgraph cluster_24 {
color=blue
99 [label="Enter when branch condition "];
100 [label="Exit $subj"];
101 [label="Access qualifier /SomeEnum"];
102 [label="Access variable R|/SomeEnum.A2|"];
103 [label="Equality operator =="];
104 [label="Exit when branch condition"];
}
105 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
106 [label="Enter block"];
107 [label="Function call: R|/B.B|()"];
108 [label="Exit block"];
}
109 [label="Exit when branch result"];
110 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
111 [label="Enter block"];
112 [label="Function call: R|/B.B|()"];
113 [label="Exit block"];
}
114 [label="Exit when branch result"];
115 [label="Exit when"];
}
116 [label="Variable declaration: lval b: R|B|"];
117 [label="Access variable R|<local>/b|"];
118 [label="Function call: R|/takeB|(...)"];
119 [label="Exit block"];
}
120 [label="Exit function test_3" style="filled" fillcolor=red];
}
86 -> {87};
87 -> {88};
88 -> {89};
@@ -292,26 +298,32 @@ digraph exhaustiveWhenAndDNNType_kt {
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {104 94};
93 -> {94};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {99};
98 -> {110 99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {109};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
108 -> {109};
109 -> {110};
109 -> {115};
110 -> {111};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {117};
117 -> {118};
118 -> {119};
119 -> {120};
}