FIR: Do not use return statement for type of a block expression

Type of a block is a kind of irrelevant for lambdas: their type is much
more complicated and defined via FirDataFlowAnalyzer#returnExpressionsOfAnonymousFunction
at at FirCallCompleter.LambdaAnalyzerImpl#analyzeAndGetLambdaReturnArguments
This commit is contained in:
Denis.Zharkov
2021-01-18 15:13:37 +03:00
parent 4dc2653736
commit b0b7f39c75
20 changed files with 127 additions and 83 deletions
@@ -44,21 +44,14 @@ digraph lambdaAsReturnOfLambda_kt {
7 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
18 [label="Postponed exit from lambda"];
subgraph cluster_6 {
color=blue
19 [label="Enter block"];
20 [label="Exit block"];
}
21 [label="Function call: R|/run|<R|(kotlin/String) -> kotlin/Unit|>(...)"];
22 [label="Exit property" style="filled" fillcolor=red];
19 [label="Function call: R|/run|<R|(kotlin/String) -> kotlin/Unit|>(...)"];
20 [label="Exit property" style="filled" fillcolor=red];
}
16 -> {17};
17 -> {18 0};
17 -> {0} [style=dashed];
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
0 -> {1};
1 -> {2};
2 -> {3 8};
@@ -74,39 +67,39 @@ digraph lambdaAsReturnOfLambda_kt {
11 -> {12};
12 -> {13};
subgraph cluster_7 {
subgraph cluster_6 {
color=red
23 [label="Enter function bar" style="filled" fillcolor=red];
subgraph cluster_8 {
21 [label="Enter function bar" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
24 [label="Enter block"];
25 [label="Exit block"];
22 [label="Enter block"];
23 [label="Exit block"];
}
26 [label="Exit function bar" style="filled" fillcolor=red];
24 [label="Exit function bar" style="filled" fillcolor=red];
}
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
subgraph cluster_9 {
subgraph cluster_8 {
color=red
27 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_10 {
25 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
28 [label="Enter block"];
29 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|R|>|()"];
30 [label="Jump: ^run R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|R|>|()"];
31 [label="Stub" style="filled" fillcolor=gray];
32 [label="Exit block" style="filled" fillcolor=gray];
26 [label="Enter block"];
27 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|R|>|()"];
28 [label="Jump: ^run R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|R|>|()"];
29 [label="Stub" style="filled" fillcolor=gray];
30 [label="Exit block" style="filled" fillcolor=gray];
}
33 [label="Exit function run" style="filled" fillcolor=red];
31 [label="Exit function run" style="filled" fillcolor=red];
}
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {33};
28 -> {31};
28 -> {29} [style=dotted];
29 -> {30} [style=dotted];
30 -> {31} [style=dotted];
31 -> {32} [style=dotted];
32 -> {33} [style=dotted];
}