[FIR] Don't pass flow from inplace lambdas throw when and elvis expressions

#KT-39080 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-07-02 16:22:45 +03:00
parent 1429cba2d4
commit 1db2ba51d2
9 changed files with 433 additions and 105 deletions
@@ -0,0 +1,250 @@
digraph lambdaInWhenBranch_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter class Sealed" style="filled" fillcolor=red];
1 [label="Exit class Sealed" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter function <init>" style="filled" fillcolor=red];
3 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
4 [label="Exit function <init>" style="filled" fillcolor=red];
}
2 -> {3};
3 -> {4};
subgraph cluster_2 {
color=red
5 [label="Enter class SubClass1" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
7 [label="Enter property" style="filled" fillcolor=red];
8 [label="Access variable R|<local>/t|"];
9 [label="Exit property" style="filled" fillcolor=red];
}
6 [label="Exit class SubClass1" style="filled" fillcolor=red];
}
5 -> {7} [color=green];
7 -> {8};
8 -> {9};
9 -> {6} [color=green];
subgraph cluster_4 {
color=red
10 [label="Enter function <init>" style="filled" fillcolor=red];
11 [label="Delegated constructor call: super<R|Sealed|>()"];
12 [label="Exit function <init>" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
subgraph cluster_5 {
color=red
13 [label="Enter function getter" style="filled" fillcolor=red];
14 [label="Exit function getter" style="filled" fillcolor=red];
}
13 -> {14};
subgraph cluster_6 {
color=red
15 [label="Enter function component1" style="filled" fillcolor=red];
16 [label="Exit function component1" style="filled" fillcolor=red];
}
15 -> {16};
subgraph cluster_7 {
color=red
17 [label="Enter function copy" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
19 [label="Enter default value of t" style="filled" fillcolor=red];
20 [label="Access variable R|/SubClass1.t|"];
21 [label="Exit default value of t" style="filled" fillcolor=red];
}
18 [label="Exit function copy" style="filled" fillcolor=red];
}
17 -> {19 18};
19 -> {20};
20 -> {21};
subgraph cluster_9 {
color=red
22 [label="Enter class SubClass2" style="filled" fillcolor=red];
23 [label="Exit class SubClass2" style="filled" fillcolor=red];
}
22 -> {23} [color=green];
subgraph cluster_10 {
color=red
24 [label="Enter function <init>" style="filled" fillcolor=red];
25 [label="Delegated constructor call: super<R|Sealed|>()"];
26 [label="Exit function <init>" style="filled" fillcolor=red];
}
24 -> {25};
25 -> {26};
subgraph cluster_11 {
color=red
27 [label="Enter function copy" style="filled" fillcolor=red];
28 [label="Exit function copy" style="filled" fillcolor=red];
}
27 -> {28};
subgraph cluster_12 {
color=red
29 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
30 [label="Enter block"];
subgraph cluster_14 {
color=blue
31 [label="Enter when"];
32 [label="Access variable R|<local>/p|"];
subgraph cluster_15 {
color=blue
33 [label="Enter when branch condition "];
34 [label="Type operator: ($subj$ is R|SubClass1|)"];
35 [label="Exit when branch condition"];
}
subgraph cluster_16 {
color=blue
36 [label="Enter when branch condition "];
37 [label="Type operator: ($subj$ is R|SubClass2|)"];
38 [label="Exit when branch condition"];
}
39 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
40 [label="Enter block"];
41 [label="Const: String()"];
42 [label="Exit block"];
}
43 [label="Exit when branch result"];
44 [label="Enter when branch result"];
subgraph cluster_18 {
color=blue
45 [label="Enter block"];
46 [label="Const: String()"];
47 [label="Postponed enter to lambda"];
subgraph cluster_19 {
color=blue
78 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_20 {
color=blue
79 [label="Enter block"];
80 [label="Access variable R|<local>/it|"];
81 [label="Exit block"];
}
82 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
48 [label="Postponed exit from lambda"];
49 [label="Function call: String().R|kotlin/let|<R|kotlin/String|, R|kotlin/String|>(...)"];
50 [label="Exit block"];
}
51 [label="Exit when branch result"];
52 [label="Exit when"];
}
53 [label="Access variable R|<local>/p|"];
54 [label="Access variable <Unresolved name: t>#"];
subgraph cluster_21 {
color=blue
55 [label="Enter when"];
56 [label="Access variable R|<local>/p|"];
subgraph cluster_22 {
color=blue
57 [label="Enter when branch condition "];
58 [label="Type operator: ($subj$ is R|SubClass1|)"];
59 [label="Exit when branch condition"];
}
subgraph cluster_23 {
color=blue
60 [label="Enter when branch condition "];
61 [label="Type operator: ($subj$ is R|SubClass2|)"];
62 [label="Exit when branch condition"];
}
63 [label="Enter when branch result"];
subgraph cluster_24 {
color=blue
64 [label="Enter block"];
65 [label="Const: String(2)"];
66 [label="Exit block"];
}
67 [label="Exit when branch result"];
68 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
69 [label="Enter block"];
70 [label="Access variable R|<local>/p|"];
71 [label="Access variable R|/SubClass1.t|"];
72 [label="Exit block"];
}
73 [label="Exit when branch result"];
74 [label="Exit when"];
}
75 [label="Access variable R|kotlin/String.length|"];
76 [label="Exit block"];
}
77 [label="Exit function foo" style="filled" fillcolor=red];
}
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {44 36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {52};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {78};
47 -> {48} [color=red];
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {68 60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {74};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {75};
75 -> {76};
76 -> {77};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {48} [color=green];
}