diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot index 21f9c44dc20..468049ac3b9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot @@ -6,19 +6,20 @@ digraph annotatedLocalClass_kt { subgraph cluster_0 { color=red 0 [label="Enter class Ann" style="filled" fillcolor=red]; - 1 [label="Exit class Ann" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class Ann" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red @@ -56,13 +57,13 @@ digraph annotatedLocalClass_kt { subgraph cluster_7 { color=blue 23 [label="Enter class Local" style="filled" fillcolor=red]; - 24 [label="Exit class Local" style="filled" fillcolor=red]; - } - subgraph cluster_8 { - color=blue - 25 [label="Enter function " style="filled" fillcolor=red]; - 26 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 27 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 24 [label="Enter function " style="filled" fillcolor=red]; + 25 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 26 [label="Exit function " style="filled" fillcolor=red]; + } + 27 [label="Exit class Local" style="filled" fillcolor=red]; } 5 -> {6}; 6 -> {7}; @@ -83,12 +84,12 @@ digraph annotatedLocalClass_kt { 19 -> {23} [style=dashed]; 20 -> {21}; 21 -> {22}; - 23 -> {24} [color=green]; - 23 -> {25} [color=red]; - 24 -> {25} [color=green]; - 24 -> {25} [style=dashed]; + 23 -> {24}; + 23 -> {27} [style=dotted]; + 23 -> {24} [style=dashed]; + 24 -> {25}; 25 -> {26}; - 26 -> {27}; + 26 -> {27} [color=green]; subgraph cluster_9 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot index a1581051f70..c019eaa3fe0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot @@ -8,82 +8,80 @@ digraph initBlock_kt { 0 [label="Enter class Foo" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 2 [label="Enter block"]; - 3 [label="Const: Int(1)"]; - 4 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 5 [label="Exit block"]; - } - 6 [label="Exit init block" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 7 [label="Exit class Foo" style="filled" fillcolor=red]; - } - subgraph cluster_3 { - color=blue - 8 [label="Enter function " style="filled" fillcolor=red]; - 9 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 10 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 4 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 5 [label="Enter block"]; + 6 [label="Const: Int(1)"]; + 7 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 8 [label="Exit block"]; + } + 9 [label="Exit init block" style="filled" fillcolor=red]; + } + 10 [label="Exit class Foo" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {7} [style=dotted]; - 0 -> {1} [style=dashed]; + 0 -> {10} [style=dotted]; + 0 -> {1 4} [style=dashed]; 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; 4 -> {5}; 5 -> {6}; - 6 -> {7} [color=green]; - 7 -> {8} [color=green]; - 7 -> {8} [style=dashed]; + 6 -> {7}; + 7 -> {8}; 8 -> {9}; - 9 -> {10}; + 9 -> {10} [color=green]; subgraph cluster_4 { color=red 11 [label="Enter class Bar" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 12 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 13 [label="Enter block"]; - 14 [label="Const: Int(1)"]; - 15 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 16 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; - 17 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 18 [label="Stub" style="filled" fillcolor=gray]; - 19 [label="Const: Int(2)" style="filled" fillcolor=gray]; - 20 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray]; - 21 [label="Exit block" style="filled" fillcolor=gray]; - } - 22 [label="Exit init block" style="filled" fillcolor=gray]; + 12 [label="Enter function " style="filled" fillcolor=red]; + 13 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 14 [label="Exit function " style="filled" fillcolor=red]; } - 23 [label="Exit class Bar" style="filled" fillcolor=gray]; - } - subgraph cluster_7 { - color=blue - 24 [label="Enter function " style="filled" fillcolor=gray]; - 25 [label="Delegated constructor call: super()" style="filled" fillcolor=gray]; - 26 [label="Exit function " style="filled" fillcolor=gray]; + subgraph cluster_6 { + color=blue + 15 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 16 [label="Enter block"]; + 17 [label="Const: Int(1)"]; + 18 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 19 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; + 20 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 21 [label="Stub" style="filled" fillcolor=gray]; + 22 [label="Const: Int(2)" style="filled" fillcolor=gray]; + 23 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray]; + 24 [label="Exit block" style="filled" fillcolor=gray]; + } + 25 [label="Exit init block" style="filled" fillcolor=gray]; + } + 26 [label="Exit class Bar" style="filled" fillcolor=gray]; } 11 -> {12} [color=green]; - 11 -> {23} [style=dotted]; - 11 -> {12} [style=dashed]; + 11 -> {26} [style=dotted]; + 11 -> {12 15} [style=dashed]; 12 -> {13}; 13 -> {14}; - 14 -> {15}; + 14 -> {15} [color=green]; 15 -> {16}; 16 -> {17}; - 17 -> {18} [style=dotted]; - 18 -> {19} [style=dotted]; - 19 -> {20} [style=dotted]; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; 20 -> {21} [style=dotted]; 21 -> {22} [style=dotted]; 22 -> {23} [style=dotted]; 23 -> {24} [style=dotted]; - 23 -> {24} [style=dashed]; 24 -> {25} [style=dotted]; 25 -> {26} [style=dotted]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot index 77a51c6cd0a..6bc3d707472 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot @@ -22,57 +22,57 @@ digraph initBlockAndInPlaceLambda_kt { 4 [label="Enter class C" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 5 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_4 { - color=blue - 6 [label="Enter block"]; - 7 [label="Access variable R|/a|"]; - 8 [label="Access variable R|/A.b|"]; - 9 [label="Enter safe call"]; - 10 [label="Postponed enter to lambda"]; - subgraph cluster_5 { - color=blue - 11 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 12 [label="Enter block"]; - 13 [label="Access variable R|/a|"]; - 14 [label="Access variable R|/it|"]; - 15 [label="Function call: R|/C.C|(...)" style="filled" fillcolor=yellow]; - 16 [label="Exit block"]; - } - 17 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 18 [label="Postponed exit from lambda"]; - 19 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; - 20 [label="Exit safe call"]; - 21 [label="Variable declaration: lval c: R|C?|"]; - 22 [label="Exit block"]; - } - 23 [label="Exit init block" style="filled" fillcolor=red]; + 5 [label="Enter function " style="filled" fillcolor=red]; + 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 7 [label="Exit function " style="filled" fillcolor=red]; } - 24 [label="Exit class C" style="filled" fillcolor=red]; - } - subgraph cluster_7 { - color=blue - 25 [label="Enter function " style="filled" fillcolor=red]; - 26 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 27 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 8 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 9 [label="Enter block"]; + 10 [label="Access variable R|/a|"]; + 11 [label="Access variable R|/A.b|"]; + 12 [label="Enter safe call"]; + 13 [label="Postponed enter to lambda"]; + subgraph cluster_6 { + color=blue + 14 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 15 [label="Enter block"]; + 16 [label="Access variable R|/a|"]; + 17 [label="Access variable R|/it|"]; + 18 [label="Function call: R|/C.C|(...)" style="filled" fillcolor=yellow]; + 19 [label="Exit block"]; + } + 20 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 21 [label="Postponed exit from lambda"]; + 22 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; + 23 [label="Exit safe call"]; + 24 [label="Variable declaration: lval c: R|C?|"]; + 25 [label="Exit block"]; + } + 26 [label="Exit init block" style="filled" fillcolor=red]; + } + 27 [label="Exit class C" style="filled" fillcolor=red]; } 4 -> {5} [color=green]; - 4 -> {24} [style=dotted]; - 4 -> {5} [style=dashed]; + 4 -> {27} [style=dotted]; + 4 -> {5 8} [style=dashed]; 5 -> {6}; 6 -> {7}; - 7 -> {8}; - 8 -> {9 20}; + 7 -> {8} [color=green]; + 8 -> {9}; 9 -> {10}; - 10 -> {11 19}; - 10 -> {18} [style=dotted]; - 10 -> {11} [style=dashed]; - 11 -> {12}; + 10 -> {11}; + 11 -> {12 23}; 12 -> {13}; - 13 -> {14}; + 13 -> {14 22}; + 13 -> {21} [style=dotted]; + 13 -> {14} [style=dashed]; 14 -> {15}; 15 -> {16}; 16 -> {17}; @@ -82,10 +82,9 @@ digraph initBlockAndInPlaceLambda_kt { 20 -> {21}; 21 -> {22}; 22 -> {23}; - 23 -> {24} [color=green]; - 24 -> {25} [color=green]; - 24 -> {25} [style=dashed]; + 23 -> {24}; + 24 -> {25}; 25 -> {26}; - 26 -> {27}; + 26 -> {27} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot index 9cc7fcdbe9e..270a6ac1e59 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot @@ -10,58 +10,64 @@ digraph innerClassInAnonymousObject_kt { subgraph cluster_1 { color=blue 2 [label="Enter class " style="filled" fillcolor=red]; - 3 [label="Exit class " style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 3 [label="Enter function " style="filled" fillcolor=red]; + 4 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 5 [label="Exit function " style="filled" fillcolor=red]; + } + 6 [label="Exit class " style="filled" fillcolor=red]; } - 4 [label="Exit anonymous object"]; - 5 [label="Exit anonymous object expression"]; - 6 [label="Exit property" style="filled" fillcolor=red]; - } - subgraph cluster_2 { - color=blue - 7 [label="Enter class Nested" style="filled" fillcolor=red]; - 8 [label="Exit class Nested" style="filled" fillcolor=red]; + 7 [label="Exit anonymous object"]; + 8 [label="Exit anonymous object expression"]; + 9 [label="Exit property" style="filled" fillcolor=red]; } subgraph cluster_3 { color=blue - 9 [label="Enter function foo" style="filled" fillcolor=red]; + 10 [label="Enter class Nested" style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 10 [label="Enter block"]; - 11 [label="Exit block"]; + 11 [label="Enter function " style="filled" fillcolor=red]; + 12 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 13 [label="Exit function " style="filled" fillcolor=red]; } - 12 [label="Exit function foo" style="filled" fillcolor=red]; + 14 [label="Exit class Nested" style="filled" fillcolor=red]; } subgraph cluster_5 { color=blue - 13 [label="Enter function " style="filled" fillcolor=red]; - 14 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 15 [label="Exit function " style="filled" fillcolor=red]; - } - subgraph cluster_6 { - color=blue - 16 [label="Enter function " style="filled" fillcolor=red]; - 17 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 18 [label="Exit function " style="filled" fillcolor=red]; + 15 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 16 [label="Enter block"]; + 17 [label="Exit block"]; + } + 18 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; - 1 -> {4} [color=red]; + 1 -> {7} [color=red]; 1 -> {2} [style=dashed]; - 2 -> {3} [color=green]; - 2 -> {7 16} [color=red]; - 3 -> {4 7 16} [color=green]; - 3 -> {7 16} [style=dashed]; + 2 -> {3}; + 2 -> {10} [color=red]; + 2 -> {6} [style=dotted]; + 2 -> {3} [style=dashed]; + 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 7 -> {8} [color=green]; - 7 -> {9 13} [color=red]; - 8 -> {9 13} [color=green]; - 8 -> {9 13} [style=dashed]; - 9 -> {10}; + 5 -> {6} [color=green]; + 6 -> {7 10} [color=green]; + 6 -> {10} [style=dashed]; + 7 -> {8}; + 8 -> {9}; 10 -> {11}; + 10 -> {15} [color=red]; + 10 -> {14} [style=dotted]; + 10 -> {11} [style=dashed]; 11 -> {12}; - 13 -> {14}; - 14 -> {15}; + 12 -> {13}; + 13 -> {14} [color=green]; + 14 -> {15} [color=green]; + 14 -> {15} [style=dashed]; + 15 -> {16}; 16 -> {17}; 17 -> {18}; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot index a37407c0e48..b89438469e5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot @@ -34,19 +34,20 @@ digraph lambdaReturningObject_kt { subgraph cluster_4 { color=red 8 [label="Enter class IrStarProjectionImpl" style="filled" fillcolor=red]; - 9 [label="Exit class IrStarProjectionImpl" style="filled" fillcolor=red]; - } - subgraph cluster_5 { - color=blue - 10 [label="Enter function " style="filled" fillcolor=red]; - 11 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 12 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 9 [label="Enter function " style="filled" fillcolor=red]; + 10 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 11 [label="Exit function " style="filled" fillcolor=red]; + } + 12 [label="Exit class IrStarProjectionImpl" style="filled" fillcolor=red]; } 8 -> {9} [color=green]; - 9 -> {10} [color=green]; - 9 -> {10} [style=dashed]; + 8 -> {12} [style=dotted]; + 8 -> {9} [style=dashed]; + 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 11 -> {12} [color=green]; subgraph cluster_6 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot index 8baf008fe8d..093b61ce2fa 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot @@ -57,123 +57,129 @@ digraph localClassesWithImplicit_kt { subgraph cluster_7 { color=blue 24 [label="Enter class " style="filled" fillcolor=red]; - 25 [label="Exit class " style="filled" fillcolor=red]; - } - 26 [label="Exit anonymous object"]; - 27 [label="Exit anonymous object expression"]; - 28 [label="Variable declaration: lval x: R||"]; - 29 [label="Exit block"]; - } - 30 [label="Exit function test" style="filled" fillcolor=red]; - } - subgraph cluster_8 { - color=blue - 31 [label="Enter function baz" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 32 [label="Enter block"]; - 33 [label="Const: Int(1)"]; - 34 [label="Jump: ^baz Int(1)"]; - 35 [label="Stub" style="filled" fillcolor=gray]; - 36 [label="Exit block" style="filled" fillcolor=gray]; - } - 37 [label="Exit function baz" style="filled" fillcolor=red]; - } - subgraph cluster_10 { - color=blue - 38 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 39 [label="Enter block"]; - 40 [label="Postponed enter to lambda"]; - subgraph cluster_12 { - color=blue - 41 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_13 { + subgraph cluster_8 { color=blue - 42 [label="Enter block"]; - 43 [label="Access variable R|/a|"]; - 44 [label="Smart cast: R|/a|"]; - 45 [label="Access variable R|kotlin/String.length|"]; - 46 [label="Access variable R|/b|"]; - 47 [label="Access variable #"]; - 48 [label="Function call: this@R|/|.R|/.baz|()" style="filled" fillcolor=yellow]; - 49 [label="Exit block"]; + 25 [label="Enter function " style="filled" fillcolor=red]; + 26 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 27 [label="Exit function " style="filled" fillcolor=red]; } - 50 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 28 [label="Exit class " style="filled" fillcolor=red]; } - 51 [label="Postponed exit from lambda"]; - 52 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; - 53 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { + 29 [label="Exit anonymous object"]; + 30 [label="Exit anonymous object expression"]; + 31 [label="Variable declaration: lval x: R||"]; + 32 [label="Exit block"]; + } + 33 [label="Exit function test" style="filled" fillcolor=red]; + } + subgraph cluster_9 { + color=blue + 34 [label="Enter function baz" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 35 [label="Enter block"]; + 36 [label="Const: Int(1)"]; + 37 [label="Jump: ^baz Int(1)"]; + 38 [label="Stub" style="filled" fillcolor=gray]; + 39 [label="Exit block" style="filled" fillcolor=gray]; + } + 40 [label="Exit function baz" style="filled" fillcolor=red]; + } + subgraph cluster_11 { + color=blue + 41 [label="Enter function bar" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 42 [label="Enter block"]; + 43 [label="Postponed enter to lambda"]; + subgraph cluster_13 { + color=blue + 44 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 45 [label="Enter block"]; + 46 [label="Access variable R|/a|"]; + 47 [label="Smart cast: R|/a|"]; + 48 [label="Access variable R|kotlin/String.length|"]; + 49 [label="Access variable R|/b|"]; + 50 [label="Access variable #"]; + 51 [label="Function call: this@R|/|.R|/.baz|()" style="filled" fillcolor=yellow]; + 52 [label="Exit block"]; + } + 53 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 54 [label="Postponed exit from lambda"]; + 55 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 56 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| R|/b|.# ^ this@R|/|.R|/.baz|() } )"]; - 54 [label="Stub" style="filled" fillcolor=gray]; - 55 [label="Exit block" style="filled" fillcolor=gray]; + 57 [label="Stub" style="filled" fillcolor=gray]; + 58 [label="Exit block" style="filled" fillcolor=gray]; } - 56 [label="Exit function bar" style="filled" fillcolor=red]; + 59 [label="Exit function bar" style="filled" fillcolor=red]; } - subgraph cluster_14 { + subgraph cluster_15 { color=blue - 57 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_15 { + 60 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_16 { color=blue - 58 [label="Enter block"]; - 59 [label="Postponed enter to lambda"]; - subgraph cluster_16 { + 61 [label="Enter block"]; + 62 [label="Postponed enter to lambda"]; + subgraph cluster_17 { color=blue - 60 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_17 { + 63 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_18 { color=blue - 61 [label="Enter block"]; - 62 [label="Access variable R|/a|"]; - 63 [label="Smart cast: R|/a|"]; - 64 [label="Access variable R|kotlin/String.length|"]; - subgraph cluster_18 { + 64 [label="Enter block"]; + 65 [label="Access variable R|/a|"]; + 66 [label="Smart cast: R|/a|"]; + 67 [label="Access variable R|kotlin/String.length|"]; + subgraph cluster_19 { color=blue - 65 [label="Enter when"]; - subgraph cluster_19 { - color=blue - 66 [label="Enter when branch condition "]; - 67 [label="Access variable R|/b|"]; - 68 [label="Type operator: (R|/b| is R|kotlin/String|)"]; - 69 [label="Exit when branch condition"]; - } + 68 [label="Enter when"]; subgraph cluster_20 { color=blue - 70 [label="Enter when branch condition else"]; - 71 [label="Exit when branch condition"]; + 69 [label="Enter when branch condition "]; + 70 [label="Access variable R|/b|"]; + 71 [label="Type operator: (R|/b| is R|kotlin/String|)"]; + 72 [label="Exit when branch condition"]; } - 72 [label="Enter when branch result"]; subgraph cluster_21 { color=blue - 73 [label="Enter block"]; - 74 [label="Const: Int(1)"]; - 75 [label="Exit block"]; + 73 [label="Enter when branch condition else"]; + 74 [label="Exit when branch condition"]; } - 76 [label="Exit when branch result"]; - 77 [label="Enter when branch result"]; + 75 [label="Enter when branch result"]; subgraph cluster_22 { color=blue - 78 [label="Enter block"]; - 79 [label="Access variable R|/b|"]; - 80 [label="Smart cast: R|/b|"]; - 81 [label="Access variable R|kotlin/String.length|"]; - 82 [label="Function call: this@R|/|.R|/.bar|()" style="filled" fillcolor=yellow]; - 83 [label="Exit block"]; + 76 [label="Enter block"]; + 77 [label="Const: Int(1)"]; + 78 [label="Exit block"]; } - 84 [label="Exit when branch result"]; - 85 [label="Exit when"]; + 79 [label="Exit when branch result"]; + 80 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 81 [label="Enter block"]; + 82 [label="Access variable R|/b|"]; + 83 [label="Smart cast: R|/b|"]; + 84 [label="Access variable R|kotlin/String.length|"]; + 85 [label="Function call: this@R|/|.R|/.bar|()" style="filled" fillcolor=yellow]; + 86 [label="Exit block"]; + } + 87 [label="Exit when branch result"]; + 88 [label="Exit when"]; } - 86 [label="Exit block"]; + 89 [label="Exit block"]; } - 87 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 90 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 88 [label="Postponed exit from lambda"]; - 89 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; - 90 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { + 91 [label="Postponed exit from lambda"]; + 92 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 93 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| ^ when () { (R|/b| is R|kotlin/String|) -> { @@ -187,130 +193,130 @@ digraph localClassesWithImplicit_kt { } )"]; - 91 [label="Stub" style="filled" fillcolor=gray]; - 92 [label="Exit block" style="filled" fillcolor=gray]; + 94 [label="Stub" style="filled" fillcolor=gray]; + 95 [label="Exit block" style="filled" fillcolor=gray]; } - 93 [label="Exit function foo" style="filled" fillcolor=red]; - } - subgraph cluster_23 { - color=blue - 94 [label="Enter function " style="filled" fillcolor=red]; - 95 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 96 [label="Exit function " style="filled" fillcolor=red]; + 96 [label="Exit function foo" style="filled" fillcolor=red]; } subgraph cluster_24 { color=blue 97 [label="Enter class A" style="filled" fillcolor=red]; - 98 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_25 { - color=blue - 99 [label="Enter function baz" style="filled" fillcolor=red]; - subgraph cluster_26 { + subgraph cluster_25 { color=blue - 100 [label="Enter block"]; - 101 [label="Const: Int(1)"]; - 102 [label="Jump: ^baz Int(1)"]; - 103 [label="Stub" style="filled" fillcolor=gray]; - 104 [label="Exit block" style="filled" fillcolor=gray]; + 98 [label="Enter function " style="filled" fillcolor=red]; + 99 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 100 [label="Exit function " style="filled" fillcolor=red]; } - 105 [label="Exit function baz" style="filled" fillcolor=red]; + 101 [label="Exit class A" style="filled" fillcolor=red]; } - subgraph cluster_27 { + subgraph cluster_26 { color=blue - 106 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_28 { + 102 [label="Enter function baz" style="filled" fillcolor=red]; + subgraph cluster_27 { color=blue - 107 [label="Enter block"]; - 108 [label="Postponed enter to lambda"]; - subgraph cluster_29 { + 103 [label="Enter block"]; + 104 [label="Const: Int(1)"]; + 105 [label="Jump: ^baz Int(1)"]; + 106 [label="Stub" style="filled" fillcolor=gray]; + 107 [label="Exit block" style="filled" fillcolor=gray]; + } + 108 [label="Exit function baz" style="filled" fillcolor=red]; + } + subgraph cluster_28 { + color=blue + 109 [label="Enter function bar" style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 110 [label="Enter block"]; + 111 [label="Postponed enter to lambda"]; + subgraph cluster_30 { color=blue - 109 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_30 { + 112 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_31 { color=blue - 110 [label="Enter block"]; - 111 [label="Access variable R|/b|"]; - 112 [label="Access variable #"]; - 113 [label="Access variable R|/a|"]; - 114 [label="Smart cast: R|/a|"]; - 115 [label="Access variable R|kotlin/String.length|"]; - 116 [label="Function call: this@R|/A|.R|/baz|()" style="filled" fillcolor=yellow]; - 117 [label="Exit block"]; + 113 [label="Enter block"]; + 114 [label="Access variable R|/b|"]; + 115 [label="Access variable #"]; + 116 [label="Access variable R|/a|"]; + 117 [label="Smart cast: R|/a|"]; + 118 [label="Access variable R|kotlin/String.length|"]; + 119 [label="Function call: this@R|/A|.R|/baz|()" style="filled" fillcolor=yellow]; + 120 [label="Exit block"]; } - 118 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 121 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 119 [label="Postponed exit from lambda"]; - 120 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; - 121 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { + 122 [label="Postponed exit from lambda"]; + 123 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 124 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/b|.# R|/a|.R|kotlin/String.length| ^ this@R|/A|.R|/baz|() } )"]; - 122 [label="Stub" style="filled" fillcolor=gray]; - 123 [label="Exit block" style="filled" fillcolor=gray]; + 125 [label="Stub" style="filled" fillcolor=gray]; + 126 [label="Exit block" style="filled" fillcolor=gray]; } - 124 [label="Exit function bar" style="filled" fillcolor=red]; + 127 [label="Exit function bar" style="filled" fillcolor=red]; } - subgraph cluster_31 { + subgraph cluster_32 { color=blue - 125 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_32 { + 128 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_33 { color=blue - 126 [label="Enter block"]; - 127 [label="Postponed enter to lambda"]; - subgraph cluster_33 { + 129 [label="Enter block"]; + 130 [label="Postponed enter to lambda"]; + subgraph cluster_34 { color=blue - 128 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_34 { + 131 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_35 { color=blue - 129 [label="Enter block"]; - 130 [label="Access variable R|/a|"]; - 131 [label="Smart cast: R|/a|"]; - 132 [label="Access variable R|kotlin/String.length|"]; - subgraph cluster_35 { + 132 [label="Enter block"]; + 133 [label="Access variable R|/a|"]; + 134 [label="Smart cast: R|/a|"]; + 135 [label="Access variable R|kotlin/String.length|"]; + subgraph cluster_36 { color=blue - 133 [label="Enter when"]; - subgraph cluster_36 { - color=blue - 134 [label="Enter when branch condition "]; - 135 [label="Access variable R|/b|"]; - 136 [label="Type operator: (R|/b| is R|kotlin/String|)"]; - 137 [label="Exit when branch condition"]; - } + 136 [label="Enter when"]; subgraph cluster_37 { color=blue - 138 [label="Enter when branch condition else"]; - 139 [label="Exit when branch condition"]; + 137 [label="Enter when branch condition "]; + 138 [label="Access variable R|/b|"]; + 139 [label="Type operator: (R|/b| is R|kotlin/String|)"]; + 140 [label="Exit when branch condition"]; } - 140 [label="Enter when branch result"]; subgraph cluster_38 { color=blue - 141 [label="Enter block"]; - 142 [label="Const: Int(1)"]; - 143 [label="Exit block"]; + 141 [label="Enter when branch condition else"]; + 142 [label="Exit when branch condition"]; } - 144 [label="Exit when branch result"]; - 145 [label="Enter when branch result"]; + 143 [label="Enter when branch result"]; subgraph cluster_39 { color=blue - 146 [label="Enter block"]; - 147 [label="Access variable R|/b|"]; - 148 [label="Smart cast: R|/b|"]; - 149 [label="Access variable R|kotlin/String.length|"]; - 150 [label="Function call: this@R|/A|.R|/bar|()" style="filled" fillcolor=yellow]; - 151 [label="Exit block"]; + 144 [label="Enter block"]; + 145 [label="Const: Int(1)"]; + 146 [label="Exit block"]; } - 152 [label="Exit when branch result"]; - 153 [label="Exit when"]; + 147 [label="Exit when branch result"]; + 148 [label="Enter when branch result"]; + subgraph cluster_40 { + color=blue + 149 [label="Enter block"]; + 150 [label="Access variable R|/b|"]; + 151 [label="Smart cast: R|/b|"]; + 152 [label="Access variable R|kotlin/String.length|"]; + 153 [label="Function call: this@R|/A|.R|/bar|()" style="filled" fillcolor=yellow]; + 154 [label="Exit block"]; + } + 155 [label="Exit when branch result"]; + 156 [label="Exit when"]; } - 154 [label="Exit block"]; + 157 [label="Exit block"]; } - 155 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 158 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 156 [label="Postponed exit from lambda"]; - 157 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; - 158 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { + 159 [label="Postponed exit from lambda"]; + 160 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 161 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| ^ when () { (R|/b| is R|kotlin/String|) -> { @@ -324,16 +330,10 @@ digraph localClassesWithImplicit_kt { } )"]; - 159 [label="Stub" style="filled" fillcolor=gray]; - 160 [label="Exit block" style="filled" fillcolor=gray]; + 162 [label="Stub" style="filled" fillcolor=gray]; + 163 [label="Exit block" style="filled" fillcolor=gray]; } - 161 [label="Exit function foo" style="filled" fillcolor=red]; - } - subgraph cluster_40 { - color=blue - 162 [label="Enter function " style="filled" fillcolor=red]; - 163 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 164 [label="Exit function " style="filled" fillcolor=red]; + 164 [label="Exit function foo" style="filled" fillcolor=red]; } 7 -> {8}; 8 -> {9}; @@ -345,7 +345,7 @@ digraph localClassesWithImplicit_kt { 14 -> {21}; 15 -> {16}; 16 -> {17}; - 17 -> {30}; + 17 -> {33}; 17 -> {18} [style=dotted]; 18 -> {19} [style=dotted]; 19 -> {20} [style=dotted]; @@ -354,30 +354,32 @@ digraph localClassesWithImplicit_kt { 22 -> {23 97}; 22 -> {97} [style=dashed]; 23 -> {24}; - 23 -> {26} [color=red]; + 23 -> {29} [color=red]; 23 -> {24} [style=dashed]; - 24 -> {25} [color=green]; - 24 -> {31 38 57 94} [color=red]; - 25 -> {26 31 38 57 94} [color=green]; - 25 -> {31 38 57 94} [style=dashed]; + 24 -> {25}; + 24 -> {34 41 60} [color=red]; + 24 -> {28} [style=dotted]; + 24 -> {25} [style=dashed]; + 25 -> {26}; 26 -> {27}; - 27 -> {28}; - 28 -> {29}; + 27 -> {28} [color=green]; + 28 -> {29 34 41 60} [color=green]; + 28 -> {34 41 60} [style=dashed]; 29 -> {30}; + 30 -> {31}; 31 -> {32}; 32 -> {33}; - 33 -> {34}; - 34 -> {37}; - 34 -> {35} [style=dotted]; - 35 -> {36} [style=dotted]; - 36 -> {37} [style=dotted]; - 38 -> {39}; - 39 -> {40}; - 40 -> {41 51 52}; - 40 -> {41} [style=dashed]; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {40}; + 37 -> {38} [style=dotted]; + 38 -> {39} [style=dotted]; + 39 -> {40} [style=dotted]; 41 -> {42}; 42 -> {43}; - 43 -> {44}; + 43 -> {44 54 55}; + 43 -> {44} [style=dashed]; 44 -> {45}; 45 -> {46}; 46 -> {47}; @@ -386,36 +388,36 @@ digraph localClassesWithImplicit_kt { 49 -> {50}; 50 -> {51}; 51 -> {52}; - 51 -> {40} [color=green style=dashed]; 52 -> {53}; - 53 -> {56}; - 53 -> {54} [style=dotted]; - 54 -> {55} [style=dotted]; - 55 -> {56} [style=dotted]; - 57 -> {58}; - 58 -> {59}; - 59 -> {60 88 89}; - 59 -> {60} [style=dashed]; + 53 -> {54}; + 54 -> {55}; + 54 -> {43} [color=green style=dashed]; + 55 -> {56}; + 56 -> {59}; + 56 -> {57} [style=dotted]; + 57 -> {58} [style=dotted]; + 58 -> {59} [style=dotted]; 60 -> {61}; 61 -> {62}; - 62 -> {63}; + 62 -> {63 91 92}; + 62 -> {63} [style=dashed]; 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {70 77}; + 69 -> {70}; 70 -> {71}; 71 -> {72}; - 72 -> {73}; + 72 -> {73 80}; 73 -> {74}; 74 -> {75}; 75 -> {76}; - 76 -> {85}; + 76 -> {77}; 77 -> {78}; 78 -> {79}; - 79 -> {80}; + 79 -> {88}; 80 -> {81}; 81 -> {82}; 82 -> {83}; @@ -425,32 +427,35 @@ digraph localClassesWithImplicit_kt { 86 -> {87}; 87 -> {88}; 88 -> {89}; - 88 -> {59} [color=green style=dashed]; 89 -> {90}; - 90 -> {93}; - 90 -> {91} [style=dotted]; - 91 -> {92} [style=dotted]; - 92 -> {93} [style=dotted]; - 94 -> {95}; - 95 -> {96}; - 97 -> {98} [color=green]; - 97 -> {99 106 125 162} [color=red]; - 98 -> {99 106 125 162} [color=green]; - 98 -> {99 106 125 162} [style=dashed]; + 90 -> {91}; + 91 -> {92}; + 91 -> {62} [color=green style=dashed]; + 92 -> {93}; + 93 -> {96}; + 93 -> {94} [style=dotted]; + 94 -> {95} [style=dotted]; + 95 -> {96} [style=dotted]; + 97 -> {98}; + 97 -> {102 109 128} [color=red]; + 97 -> {101} [style=dotted]; + 97 -> {98} [style=dashed]; + 98 -> {99}; 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {105}; - 102 -> {103} [style=dotted]; - 103 -> {104} [style=dotted]; - 104 -> {105} [style=dotted]; - 106 -> {107}; - 107 -> {108}; - 108 -> {109 119 120}; - 108 -> {109} [style=dashed]; + 100 -> {101} [color=green]; + 101 -> {102 109 128} [color=green]; + 101 -> {102 109 128} [style=dashed]; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {108}; + 105 -> {106} [style=dotted]; + 106 -> {107} [style=dotted]; + 107 -> {108} [style=dotted]; 109 -> {110}; 110 -> {111}; - 111 -> {112}; + 111 -> {112 122 123}; + 111 -> {112} [style=dashed]; 112 -> {113}; 113 -> {114}; 114 -> {115}; @@ -459,36 +464,36 @@ digraph localClassesWithImplicit_kt { 117 -> {118}; 118 -> {119}; 119 -> {120}; - 119 -> {108} [color=green style=dashed]; 120 -> {121}; - 121 -> {124}; - 121 -> {122} [style=dotted]; - 122 -> {123} [style=dotted]; - 123 -> {124} [style=dotted]; - 125 -> {126}; - 126 -> {127}; - 127 -> {128 156 157}; - 127 -> {128} [style=dashed]; + 121 -> {122}; + 122 -> {123}; + 122 -> {111} [color=green style=dashed]; + 123 -> {124}; + 124 -> {127}; + 124 -> {125} [style=dotted]; + 125 -> {126} [style=dotted]; + 126 -> {127} [style=dotted]; 128 -> {129}; 129 -> {130}; - 130 -> {131}; + 130 -> {131 159 160}; + 130 -> {131} [style=dashed]; 131 -> {132}; 132 -> {133}; 133 -> {134}; 134 -> {135}; 135 -> {136}; 136 -> {137}; - 137 -> {138 145}; + 137 -> {138}; 138 -> {139}; 139 -> {140}; - 140 -> {141}; + 140 -> {141 148}; 141 -> {142}; 142 -> {143}; 143 -> {144}; - 144 -> {153}; + 144 -> {145}; 145 -> {146}; 146 -> {147}; - 147 -> {148}; + 147 -> {156}; 148 -> {149}; 149 -> {150}; 150 -> {151}; @@ -498,13 +503,14 @@ digraph localClassesWithImplicit_kt { 154 -> {155}; 155 -> {156}; 156 -> {157}; - 156 -> {127} [color=green style=dashed]; 157 -> {158}; - 158 -> {161}; - 158 -> {159} [style=dotted]; - 159 -> {160} [style=dotted]; - 160 -> {161} [style=dotted]; - 162 -> {163}; - 163 -> {164}; + 158 -> {159}; + 159 -> {160}; + 159 -> {130} [color=green style=dashed]; + 160 -> {161}; + 161 -> {164}; + 161 -> {162} [style=dotted]; + 162 -> {163} [style=dotted]; + 163 -> {164} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot index bb3b56ba2c7..046e4138e92 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot @@ -6,103 +6,105 @@ digraph postponedLambdaInConstructor_kt { subgraph cluster_0 { color=red 0 [label="Enter class A" style="filled" fillcolor=red]; - 1 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class A" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red 5 [label="Enter class B" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 6 [label="Enter property" style="filled" fillcolor=red]; + 6 [label="Enter function " style="filled" fillcolor=red]; 7 [label="Access variable R|/s|"]; - 8 [label="Exit property" style="filled" fillcolor=red]; - } - 9 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_4 { - color=blue - 10 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_5 { - color=blue - 11 [label="Enter block"]; - 12 [label="Function call: this@R|/B|.R|/B.foo|()" style="filled" fillcolor=yellow]; - 13 [label="Exit block"]; - } - 14 [label="Exit function foo" style="filled" fillcolor=red]; - } - subgraph cluster_6 { - color=blue - 15 [label="Enter function " style="filled" fillcolor=red]; - 16 [label="Access variable R|/s|"]; - 17 [label="Postponed enter to lambda"]; - subgraph cluster_7 { - color=blue - 18 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_8 { + 8 [label="Postponed enter to lambda"]; + subgraph cluster_4 { color=blue - 19 [label="Enter block"]; - 20 [label="Exit anonymous function expression"]; - subgraph cluster_9 { + 9 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_5 { color=blue - 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_10 { + 10 [label="Enter block"]; + 11 [label="Exit anonymous function expression"]; + subgraph cluster_6 { color=blue - 22 [label="Enter block"]; - 23 [label="Access variable R|/it|"]; - 24 [label="Exit block"]; + 12 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 13 [label="Enter block"]; + 14 [label="Access variable R|/it|"]; + 15 [label="Exit block"]; + } + 16 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 17 [label="Exit block"]; } - 26 [label="Exit block"]; + 18 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 27 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 19 [label="Postponed exit from lambda"]; + 20 [label="Function call: R|/s|.R|kotlin/let| kotlin/String|>(...)" style="filled" fillcolor=yellow]; + 21 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; + 22 [label="Exit function " style="filled" fillcolor=red]; } - 28 [label="Postponed exit from lambda"]; - 29 [label="Function call: R|/s|.R|kotlin/let| kotlin/String|>(...)" style="filled" fillcolor=yellow]; - 30 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; - 31 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 23 [label="Enter property" style="filled" fillcolor=red]; + 24 [label="Access variable R|/s|"]; + 25 [label="Exit property" style="filled" fillcolor=red]; + } + 26 [label="Exit class B" style="filled" fillcolor=red]; + } + subgraph cluster_9 { + color=blue + 27 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 28 [label="Enter block"]; + 29 [label="Function call: this@R|/B|.R|/B.foo|()" style="filled" fillcolor=yellow]; + 30 [label="Exit block"]; + } + 31 [label="Exit function foo" style="filled" fillcolor=red]; } 5 -> {6} [color=green]; - 5 -> {9} [style=dotted]; - 5 -> {6} [style=dashed]; + 5 -> {26} [style=dotted]; + 5 -> {6 23} [style=dashed]; 6 -> {7}; 7 -> {8}; - 8 -> {9} [color=green]; - 9 -> {10 15} [color=green]; - 9 -> {10 15} [style=dashed]; + 8 -> {9 20}; + 8 -> {19} [style=dotted]; + 8 -> {9} [style=dashed]; + 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 11 -> {12 17}; + 11 -> {12} [style=dashed]; 12 -> {13}; 13 -> {14}; + 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {18 29}; - 17 -> {28} [style=dotted]; - 17 -> {18} [style=dashed]; + 17 -> {18}; 18 -> {19}; - 19 -> {20}; - 20 -> {21 26}; - 20 -> {21} [style=dashed]; + 19 -> {20} [color=green]; + 19 -> {21} [color=red]; + 20 -> {21}; 21 -> {22}; - 22 -> {23}; + 22 -> {23} [color=green]; 23 -> {24}; 24 -> {25}; - 26 -> {27}; + 25 -> {26} [color=green]; + 26 -> {27} [color=green]; + 26 -> {27} [style=dashed]; 27 -> {28}; - 28 -> {29} [color=green]; - 28 -> {30} [color=red]; + 28 -> {29}; 29 -> {30}; 30 -> {31}; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInReturn.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInReturn.dot index f6daa8a81bf..9ff8a360555 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInReturn.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInReturn.dot @@ -6,19 +6,20 @@ digraph postponedLambdaInReturn_kt { subgraph cluster_0 { color=red 0 [label="Enter class Lateinit" style="filled" fillcolor=red]; - 1 [label="Exit class Lateinit" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class Lateinit" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot index bdb45971b55..e1145631fd2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot @@ -92,24 +92,24 @@ digraph propertiesAndInitBlocks_kt { 29 [label="Enter class GetterLocalClass" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 30 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 31 [label="Enter block"]; - 32 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; - 33 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 34 [label="Stub" style="filled" fillcolor=gray]; - 35 [label="Exit block" style="filled" fillcolor=gray]; - } - 36 [label="Exit init block" style="filled" fillcolor=gray]; + 30 [label="Enter function " style="filled" fillcolor=red]; + 31 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 32 [label="Exit function " style="filled" fillcolor=red]; } - 37 [label="Exit class GetterLocalClass" style="filled" fillcolor=gray]; - } - subgraph cluster_13 { - color=blue - 38 [label="Enter function " style="filled" fillcolor=gray]; - 39 [label="Delegated constructor call: super()" style="filled" fillcolor=gray]; - 40 [label="Exit function " style="filled" fillcolor=gray]; + subgraph cluster_12 { + color=blue + 33 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 34 [label="Enter block"]; + 35 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; + 36 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 37 [label="Stub" style="filled" fillcolor=gray]; + 38 [label="Exit block" style="filled" fillcolor=gray]; + } + 39 [label="Exit init block" style="filled" fillcolor=gray]; + } + 40 [label="Exit class GetterLocalClass" style="filled" fillcolor=gray]; } 24 -> {25}; 25 -> {26}; @@ -117,18 +117,17 @@ digraph propertiesAndInitBlocks_kt { 26 -> {29} [style=dashed]; 27 -> {28}; 29 -> {30}; - 29 -> {38} [color=red]; - 29 -> {37} [style=dotted]; - 29 -> {30} [style=dashed]; + 29 -> {33} [color=red]; + 29 -> {40} [style=dotted]; + 29 -> {30 33} [style=dashed]; 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {34} [style=dotted]; - 34 -> {35} [style=dotted]; - 35 -> {36} [style=dotted]; + 32 -> {33} [color=green]; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; 36 -> {37} [style=dotted]; 37 -> {38} [style=dotted]; - 37 -> {38} [style=dashed]; 38 -> {39} [style=dotted]; 39 -> {40} [style=dotted]; @@ -156,25 +155,25 @@ digraph propertiesAndInitBlocks_kt { 52 [label="Enter class InitializerLocalClass" style="filled" fillcolor=red]; subgraph cluster_18 { color=blue - 53 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_19 { - color=blue - 54 [label="Enter block"]; - 55 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; - 56 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 57 [label="Stub" style="filled" fillcolor=gray]; - 58 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 59 [label="Exit block" style="filled" fillcolor=gray]; - } - 60 [label="Exit init block" style="filled" fillcolor=gray]; + 53 [label="Enter function " style="filled" fillcolor=red]; + 54 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 55 [label="Exit function " style="filled" fillcolor=red]; } - 61 [label="Exit class InitializerLocalClass" style="filled" fillcolor=gray]; - } - subgraph cluster_20 { - color=blue - 62 [label="Enter function " style="filled" fillcolor=gray]; - 63 [label="Delegated constructor call: super()" style="filled" fillcolor=gray]; - 64 [label="Exit function " style="filled" fillcolor=gray]; + subgraph cluster_19 { + color=blue + 56 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_20 { + color=blue + 57 [label="Enter block"]; + 58 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; + 59 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 60 [label="Stub" style="filled" fillcolor=gray]; + 61 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 62 [label="Exit block" style="filled" fillcolor=gray]; + } + 63 [label="Exit init block" style="filled" fillcolor=gray]; + } + 64 [label="Exit class InitializerLocalClass" style="filled" fillcolor=gray]; } subgraph cluster_21 { color=blue @@ -212,19 +211,18 @@ digraph propertiesAndInitBlocks_kt { 50 -> {51} [style=dotted]; 51 -> {76} [style=dotted]; 52 -> {53}; - 52 -> {62} [color=red]; - 52 -> {61} [style=dotted]; - 52 -> {53} [style=dashed]; + 52 -> {56} [color=red]; + 52 -> {64} [style=dotted]; + 52 -> {53 56} [style=dashed]; 53 -> {54}; 54 -> {55}; - 55 -> {56}; - 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 58 -> {59} [style=dotted]; + 55 -> {56} [color=green]; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; 59 -> {60} [style=dotted]; 60 -> {61} [style=dotted]; 61 -> {62} [style=dotted]; - 61 -> {62} [style=dashed]; 62 -> {63} [style=dotted]; 63 -> {64} [style=dotted]; 65 -> {66}; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot index 55575eddf3f..92345cd4971 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot @@ -13,36 +13,38 @@ digraph returnValuesFromLambda_kt { subgraph cluster_1 { color=red 2 [label="Enter class B" style="filled" fillcolor=red]; - 3 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_2 { - color=blue - 4 [label="Enter function " style="filled" fillcolor=red]; - 5 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 6 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 3 [label="Enter function " style="filled" fillcolor=red]; + 4 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 5 [label="Exit function " style="filled" fillcolor=red]; + } + 6 [label="Exit class B" style="filled" fillcolor=red]; } 2 -> {3} [color=green]; - 3 -> {4} [color=green]; - 3 -> {4} [style=dashed]; + 2 -> {6} [style=dotted]; + 2 -> {3} [style=dashed]; + 3 -> {4}; 4 -> {5}; - 5 -> {6}; + 5 -> {6} [color=green]; subgraph cluster_3 { color=red 7 [label="Enter class C" style="filled" fillcolor=red]; - 8 [label="Exit class C" style="filled" fillcolor=red]; - } - subgraph cluster_4 { - color=blue - 9 [label="Enter function " style="filled" fillcolor=red]; - 10 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 11 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 8 [label="Enter function " style="filled" fillcolor=red]; + 9 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 10 [label="Exit function " style="filled" fillcolor=red]; + } + 11 [label="Exit class C" style="filled" fillcolor=red]; } 7 -> {8} [color=green]; - 8 -> {9} [color=green]; - 8 -> {9} [style=dashed]; + 7 -> {11} [style=dotted]; + 7 -> {8} [style=dashed]; + 8 -> {9}; 9 -> {10}; - 10 -> {11}; + 10 -> {11} [color=green]; subgraph cluster_5 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot index 7fbe6445401..af04cc2f986 100644 --- a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot +++ b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot @@ -6,36 +6,38 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_0 { color=red 0 [label="Enter class SomeEnum" style="filled" fillcolor=red]; - 1 [label="Exit class SomeEnum" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class SomeEnum" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red 5 [label="Enter class B" style="filled" fillcolor=red]; - 6 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_3 { - color=blue - 7 [label="Enter function " style="filled" fillcolor=red]; - 8 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 9 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter function " style="filled" fillcolor=red]; + 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 8 [label="Exit function " style="filled" fillcolor=red]; + } + 9 [label="Exit class B" style="filled" fillcolor=red]; } 5 -> {6} [color=green]; - 6 -> {7} [color=green]; - 6 -> {7} [style=dashed]; + 5 -> {9} [style=dotted]; + 5 -> {6} [style=dashed]; + 6 -> {7}; 7 -> {8}; - 8 -> {9}; + 8 -> {9} [color=green]; subgraph cluster_4 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot b/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot index e42f2ef5da2..95fd637ffed 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot +++ b/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot @@ -8,82 +8,83 @@ digraph secondaryConstructorCfg_kt { 0 [label="Enter class B" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter property" style="filled" fillcolor=red]; - 2 [label="Access variable R|/p0|"]; - 3 [label="Exit property" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } subgraph cluster_2 { color=blue 4 [label="Enter property" style="filled" fillcolor=red]; 5 [label="Access variable R|/p0|"]; - 6 [label="Access variable R|kotlin/String.length|"]; - 7 [label="Exit property" style="filled" fillcolor=red]; + 6 [label="Exit property" style="filled" fillcolor=red]; } subgraph cluster_3 { color=blue - 8 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_4 { - color=blue - 9 [label="Enter block"]; - 10 [label="Access variable R|/p0|"]; - 11 [label="Access variable R|kotlin/String.length|"]; - 12 [label="Assignment: R|/B.p1|"]; - 13 [label="Const: String()"]; - 14 [label="Assignment: R|/B.p3|"]; - 15 [label="Exit block"]; - } - 16 [label="Exit init block" style="filled" fillcolor=red]; + 7 [label="Enter property" style="filled" fillcolor=red]; + 8 [label="Access variable R|/p0|"]; + 9 [label="Access variable R|kotlin/String.length|"]; + 10 [label="Exit property" style="filled" fillcolor=red]; } - 17 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_5 { - color=blue - 18 [label="Enter function " style="filled" fillcolor=red]; - 19 [label="Access variable R|/p0|"]; - 20 [label="Delegated constructor call: this(...)" style="filled" fillcolor=yellow]; - subgraph cluster_6 { + subgraph cluster_4 { color=blue - 21 [label="Enter block"]; - 22 [label="Access variable R|/p1|"]; - 23 [label="Assignment: R|/B.p3|"]; - 24 [label="Exit block"]; + 11 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 12 [label="Enter block"]; + 13 [label="Access variable R|/p0|"]; + 14 [label="Access variable R|kotlin/String.length|"]; + 15 [label="Assignment: R|/B.p1|"]; + 16 [label="Const: String()"]; + 17 [label="Assignment: R|/B.p3|"]; + 18 [label="Exit block"]; + } + 19 [label="Exit init block" style="filled" fillcolor=red]; } - 25 [label="Exit function " style="filled" fillcolor=red]; + 20 [label="Exit class B" style="filled" fillcolor=red]; } - subgraph cluster_7 { + subgraph cluster_6 { color=blue - 26 [label="Enter function " style="filled" fillcolor=red]; - 27 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 21 [label="Enter function " style="filled" fillcolor=red]; + 22 [label="Access variable R|/p0|"]; + 23 [label="Delegated constructor call: this(...)" style="filled" fillcolor=yellow]; + subgraph cluster_7 { + color=blue + 24 [label="Enter block"]; + 25 [label="Access variable R|/p1|"]; + 26 [label="Assignment: R|/B.p3|"]; + 27 [label="Exit block"]; + } 28 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {17} [style=dotted]; - 0 -> {1 4 8} [style=dashed]; + 0 -> {20} [style=dotted]; + 0 -> {1 4 7 11} [style=dashed]; 1 -> {2}; 2 -> {3}; 3 -> {4} [color=green]; 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {8} [color=green]; + 6 -> {7} [color=green]; + 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; + 10 -> {11} [color=green]; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17} [color=green]; - 17 -> {18 26} [color=green]; - 17 -> {18 26} [style=dashed]; + 16 -> {17}; + 17 -> {18}; 18 -> {19}; - 19 -> {20}; - 20 -> {21}; + 19 -> {20} [color=green]; + 20 -> {21} [color=green]; + 20 -> {21} [style=dashed]; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; + 25 -> {26}; 26 -> {27}; 27 -> {28}; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot index 4aa96c7e1dd..8cd226ad234 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot @@ -341,28 +341,27 @@ digraph boundSmartcasts_kt { 125 [label="Enter class D" style="filled" fillcolor=red]; subgraph cluster_28 { color=blue - 126 [label="Enter property" style="filled" fillcolor=red]; - 127 [label="Access variable R|/any|"]; - 128 [label="Exit property" style="filled" fillcolor=red]; + 126 [label="Enter function " style="filled" fillcolor=red]; + 127 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 128 [label="Exit function " style="filled" fillcolor=red]; } - 129 [label="Exit class D" style="filled" fillcolor=red]; - } - subgraph cluster_29 { - color=blue - 130 [label="Enter function " style="filled" fillcolor=red]; - 131 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 132 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 129 [label="Enter property" style="filled" fillcolor=red]; + 130 [label="Access variable R|/any|"]; + 131 [label="Exit property" style="filled" fillcolor=red]; + } + 132 [label="Exit class D" style="filled" fillcolor=red]; } 125 -> {126} [color=green]; - 125 -> {129} [style=dotted]; - 125 -> {126} [style=dashed]; + 125 -> {132} [style=dotted]; + 125 -> {126 129} [style=dashed]; 126 -> {127}; 127 -> {128}; 128 -> {129} [color=green]; - 129 -> {130} [color=green]; - 129 -> {130} [style=dashed]; + 129 -> {130}; 130 -> {131}; - 131 -> {132}; + 131 -> {132} [color=green]; subgraph cluster_30 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index 448502da12d..14d40ef87f0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -8,28 +8,27 @@ digraph boundSmartcastsInBranches_kt { 0 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter property" style="filled" fillcolor=red]; - 2 [label="Const: String()"]; - 3 [label="Exit property" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 4 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_2 { - color=blue - 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 7 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 4 [label="Enter property" style="filled" fillcolor=red]; + 5 [label="Const: String()"]; + 6 [label="Exit property" style="filled" fillcolor=red]; + } + 7 [label="Exit class A" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {4} [style=dotted]; - 0 -> {1} [style=dashed]; + 0 -> {7} [style=dotted]; + 0 -> {1 4} [style=dashed]; 1 -> {2}; 2 -> {3}; 3 -> {4} [color=green]; - 4 -> {5} [color=green]; - 4 -> {5} [style=dashed]; + 4 -> {5}; 5 -> {6}; - 6 -> {7}; + 6 -> {7} [color=green]; subgraph cluster_3 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot index fa276050b73..97a53d9673e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot @@ -6,47 +6,47 @@ digraph functionCallBound_kt { subgraph cluster_0 { color=red 0 [label="Enter class Base" style="filled" fillcolor=red]; - 1 [label="Exit class Base" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class Base" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red 5 [label="Enter class Sub" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 6 [label="Enter property" style="filled" fillcolor=red]; - 7 [label="Access variable R|/data|"]; - 8 [label="Exit property" style="filled" fillcolor=red]; + 6 [label="Enter function " style="filled" fillcolor=red]; + 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 8 [label="Exit function " style="filled" fillcolor=red]; } - 9 [label="Exit class Sub" style="filled" fillcolor=red]; - } - subgraph cluster_4 { - color=blue - 10 [label="Enter function " style="filled" fillcolor=red]; - 11 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 12 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 9 [label="Enter property" style="filled" fillcolor=red]; + 10 [label="Access variable R|/data|"]; + 11 [label="Exit property" style="filled" fillcolor=red]; + } + 12 [label="Exit class Sub" style="filled" fillcolor=red]; } 5 -> {6} [color=green]; - 5 -> {9} [style=dotted]; - 5 -> {6} [style=dashed]; + 5 -> {12} [style=dotted]; + 5 -> {6 9} [style=dashed]; 6 -> {7}; 7 -> {8}; 8 -> {9} [color=green]; - 9 -> {10} [color=green]; - 9 -> {10} [style=dashed]; + 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 11 -> {12} [color=green]; subgraph cluster_5 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot index f3f9d695d68..b33ea9cbd8f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot @@ -6,95 +6,100 @@ digraph lambdaInWhenBranch_kt { subgraph cluster_0 { color=red 0 [label="Enter class Sealed" style="filled" fillcolor=red]; - 1 [label="Exit class Sealed" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class Sealed" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red 5 [label="Enter class SubClass1" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 6 [label="Enter property" style="filled" fillcolor=red]; - 7 [label="Access variable R|/t|"]; - 8 [label="Exit property" style="filled" fillcolor=red]; + 6 [label="Enter function " style="filled" fillcolor=red]; + 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 8 [label="Exit function " style="filled" fillcolor=red]; } - 9 [label="Exit class SubClass1" style="filled" fillcolor=red]; - } - subgraph cluster_4 { - color=blue - 10 [label="Enter function copy" style="filled" fillcolor=red]; - 11 [label="Enter default value of t"]; - subgraph cluster_5 { + subgraph cluster_4 { color=blue - 12 [label="Enter default value of t" style="filled" fillcolor=red]; - 13 [label="Access variable R|/SubClass1.t|"]; - 14 [label="Exit default value of t" style="filled" fillcolor=red]; + 9 [label="Enter property" style="filled" fillcolor=red]; + 10 [label="Access variable R|/t|"]; + 11 [label="Exit property" style="filled" fillcolor=red]; } - 15 [label="Exit default value of t"]; - 16 [label="Exit function copy" style="filled" fillcolor=red]; + 12 [label="Exit class SubClass1" style="filled" fillcolor=red]; } - subgraph cluster_6 { + subgraph cluster_5 { color=blue - 17 [label="Enter function component1" style="filled" fillcolor=red]; - 18 [label="Exit function component1" style="filled" fillcolor=red]; + 13 [label="Enter function copy" style="filled" fillcolor=red]; + 14 [label="Enter default value of t"]; + subgraph cluster_6 { + color=blue + 15 [label="Enter default value of t" style="filled" fillcolor=red]; + 16 [label="Access variable R|/SubClass1.t|"]; + 17 [label="Exit default value of t" style="filled" fillcolor=red]; + } + 18 [label="Exit default value of t"]; + 19 [label="Exit function copy" style="filled" fillcolor=red]; } subgraph cluster_7 { color=blue - 19 [label="Enter function " style="filled" fillcolor=red]; - 20 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 21 [label="Exit function " style="filled" fillcolor=red]; + 20 [label="Enter function component1" style="filled" fillcolor=red]; + 21 [label="Exit function component1" style="filled" fillcolor=red]; } 5 -> {6} [color=green]; - 5 -> {9} [style=dotted]; - 5 -> {6} [style=dashed]; + 5 -> {12} [style=dotted]; + 5 -> {6 9} [style=dashed]; 6 -> {7}; 7 -> {8}; 8 -> {9} [color=green]; - 9 -> {10 17 19} [color=green]; - 9 -> {10 17 19} [style=dashed]; + 9 -> {10}; 10 -> {11}; - 11 -> {12 15}; - 11 -> {12} [style=dashed]; - 12 -> {13}; + 11 -> {12} [color=green]; + 12 -> {13 20} [color=green]; + 12 -> {13 20} [style=dashed]; 13 -> {14}; - 14 -> {15}; + 14 -> {15 18}; + 14 -> {15} [style=dashed]; 15 -> {16}; + 16 -> {17}; 17 -> {18}; - 19 -> {20}; + 18 -> {19}; 20 -> {21}; subgraph cluster_8 { color=red 22 [label="Enter class SubClass2" style="filled" fillcolor=red]; - 23 [label="Exit class SubClass2" style="filled" fillcolor=red]; - } - subgraph cluster_9 { - color=blue - 24 [label="Enter function copy" style="filled" fillcolor=red]; - 25 [label="Exit function copy" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 23 [label="Enter function " style="filled" fillcolor=red]; + 24 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 25 [label="Exit function " style="filled" fillcolor=red]; + } + 26 [label="Exit class SubClass2" style="filled" fillcolor=red]; } subgraph cluster_10 { color=blue - 26 [label="Enter function " style="filled" fillcolor=red]; - 27 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 28 [label="Exit function " style="filled" fillcolor=red]; + 27 [label="Enter function copy" style="filled" fillcolor=red]; + 28 [label="Exit function copy" style="filled" fillcolor=red]; } 22 -> {23} [color=green]; - 23 -> {24 26} [color=green]; - 23 -> {24 26} [style=dashed]; + 22 -> {26} [style=dotted]; + 22 -> {23} [style=dashed]; + 23 -> {24}; 24 -> {25}; - 26 -> {27}; + 25 -> {26} [color=green]; + 26 -> {27} [color=green]; + 26 -> {27} [style=dashed]; 27 -> {28}; subgraph cluster_11 { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot index 1650aa963b6..fd6e2268a1c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot @@ -59,153 +59,158 @@ digraph nullability_kt { 14 [label="Enter class QImpl" style="filled" fillcolor=red]; subgraph cluster_8 { color=blue - 15 [label="Enter property" style="filled" fillcolor=red]; - 16 [label="Access variable R|/data|"]; - 17 [label="Exit property" style="filled" fillcolor=red]; + 15 [label="Enter function " style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 17 [label="Exit function " style="filled" fillcolor=red]; } - 18 [label="Exit class QImpl" style="filled" fillcolor=red]; - } - subgraph cluster_9 { - color=blue - 19 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_10 { + subgraph cluster_9 { color=blue - 20 [label="Enter block"]; - 21 [label="Const: Null(null)"]; - 22 [label="Jump: ^fdata Null(null)"]; - 23 [label="Stub" style="filled" fillcolor=gray]; - 24 [label="Exit block" style="filled" fillcolor=gray]; + 18 [label="Enter property" style="filled" fillcolor=red]; + 19 [label="Access variable R|/data|"]; + 20 [label="Exit property" style="filled" fillcolor=red]; } - 25 [label="Exit function fdata" style="filled" fillcolor=red]; + 21 [label="Exit class QImpl" style="filled" fillcolor=red]; } - subgraph cluster_11 { + subgraph cluster_10 { color=blue - 26 [label="Enter function " style="filled" fillcolor=red]; - 27 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 28 [label="Exit function " style="filled" fillcolor=red]; + 22 [label="Enter function fdata" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 23 [label="Enter block"]; + 24 [label="Const: Null(null)"]; + 25 [label="Jump: ^fdata Null(null)"]; + 26 [label="Stub" style="filled" fillcolor=gray]; + 27 [label="Exit block" style="filled" fillcolor=gray]; + } + 28 [label="Exit function fdata" style="filled" fillcolor=red]; } 14 -> {15} [color=green]; - 14 -> {18} [style=dotted]; - 14 -> {15} [style=dashed]; + 14 -> {21} [style=dotted]; + 14 -> {15 18} [style=dashed]; 15 -> {16}; 16 -> {17}; 17 -> {18} [color=green]; - 18 -> {19 26} [color=green]; - 18 -> {19 26} [style=dashed]; + 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {25}; - 22 -> {23} [style=dotted]; - 23 -> {24} [style=dotted]; - 24 -> {25} [style=dotted]; - 26 -> {27}; - 27 -> {28}; + 20 -> {21} [color=green]; + 21 -> {22} [color=green]; + 21 -> {22} [style=dashed]; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {28}; + 25 -> {26} [style=dotted]; + 26 -> {27} [style=dotted]; + 27 -> {28} [style=dotted]; subgraph cluster_12 { color=red 29 [label="Enter class QImplMutable" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 30 [label="Enter property" style="filled" fillcolor=red]; - 31 [label="Access variable R|/data|"]; - 32 [label="Exit property" style="filled" fillcolor=red]; + 30 [label="Enter function " style="filled" fillcolor=red]; + 31 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 32 [label="Exit function " style="filled" fillcolor=red]; } - 33 [label="Exit class QImplMutable" style="filled" fillcolor=red]; - } - subgraph cluster_14 { - color=blue - 34 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_15 { + subgraph cluster_14 { color=blue - 35 [label="Enter block"]; - 36 [label="Const: Null(null)"]; - 37 [label="Jump: ^fdata Null(null)"]; - 38 [label="Stub" style="filled" fillcolor=gray]; - 39 [label="Exit block" style="filled" fillcolor=gray]; + 33 [label="Enter property" style="filled" fillcolor=red]; + 34 [label="Access variable R|/data|"]; + 35 [label="Exit property" style="filled" fillcolor=red]; } - 40 [label="Exit function fdata" style="filled" fillcolor=red]; + 36 [label="Exit class QImplMutable" style="filled" fillcolor=red]; } - subgraph cluster_16 { + subgraph cluster_15 { color=blue - 41 [label="Enter function " style="filled" fillcolor=red]; - 42 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 43 [label="Exit function " style="filled" fillcolor=red]; + 37 [label="Enter function fdata" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 38 [label="Enter block"]; + 39 [label="Const: Null(null)"]; + 40 [label="Jump: ^fdata Null(null)"]; + 41 [label="Stub" style="filled" fillcolor=gray]; + 42 [label="Exit block" style="filled" fillcolor=gray]; + } + 43 [label="Exit function fdata" style="filled" fillcolor=red]; } 29 -> {30} [color=green]; - 29 -> {33} [style=dotted]; - 29 -> {30} [style=dashed]; + 29 -> {36} [style=dotted]; + 29 -> {30 33} [style=dashed]; 30 -> {31}; 31 -> {32}; 32 -> {33} [color=green]; - 33 -> {34 41} [color=green]; - 33 -> {34 41} [style=dashed]; + 33 -> {34}; 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {40}; - 37 -> {38} [style=dotted]; - 38 -> {39} [style=dotted]; - 39 -> {40} [style=dotted]; - 41 -> {42}; - 42 -> {43}; + 35 -> {36} [color=green]; + 36 -> {37} [color=green]; + 36 -> {37} [style=dashed]; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {43}; + 40 -> {41} [style=dotted]; + 41 -> {42} [style=dotted]; + 42 -> {43} [style=dotted]; subgraph cluster_17 { color=red 44 [label="Enter class QImplWithCustomGetter" style="filled" fillcolor=red]; - 45 [label="Exit class QImplWithCustomGetter" style="filled" fillcolor=red]; - } - subgraph cluster_18 { - color=blue - 46 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_19 { + subgraph cluster_18 { color=blue - 47 [label="Enter block"]; - 48 [label="Const: Null(null)"]; - 49 [label="Jump: ^fdata Null(null)"]; - 50 [label="Stub" style="filled" fillcolor=gray]; - 51 [label="Exit block" style="filled" fillcolor=gray]; + 45 [label="Enter function " style="filled" fillcolor=red]; + 46 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 47 [label="Exit function " style="filled" fillcolor=red]; } - 52 [label="Exit function fdata" style="filled" fillcolor=red]; + 48 [label="Exit class QImplWithCustomGetter" style="filled" fillcolor=red]; } - subgraph cluster_20 { + subgraph cluster_19 { color=blue - 53 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_21 { + 49 [label="Enter function fdata" style="filled" fillcolor=red]; + subgraph cluster_20 { color=blue - 54 [label="Enter block"]; - 55 [label="Const: Null(null)"]; - 56 [label="Jump: ^ Null(null)"]; - 57 [label="Stub" style="filled" fillcolor=gray]; - 58 [label="Exit block" style="filled" fillcolor=gray]; + 50 [label="Enter block"]; + 51 [label="Const: Null(null)"]; + 52 [label="Jump: ^fdata Null(null)"]; + 53 [label="Stub" style="filled" fillcolor=gray]; + 54 [label="Exit block" style="filled" fillcolor=gray]; } - 59 [label="Exit function getter" style="filled" fillcolor=red]; + 55 [label="Exit function fdata" style="filled" fillcolor=red]; } - subgraph cluster_22 { + subgraph cluster_21 { color=blue - 60 [label="Enter function " style="filled" fillcolor=red]; - 61 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 62 [label="Exit function " style="filled" fillcolor=red]; + 56 [label="Enter function getter" style="filled" fillcolor=red]; + subgraph cluster_22 { + color=blue + 57 [label="Enter block"]; + 58 [label="Const: Null(null)"]; + 59 [label="Jump: ^ Null(null)"]; + 60 [label="Stub" style="filled" fillcolor=gray]; + 61 [label="Exit block" style="filled" fillcolor=gray]; + } + 62 [label="Exit function getter" style="filled" fillcolor=red]; } 44 -> {45} [color=green]; - 45 -> {46 53 60} [color=green]; - 45 -> {46 53 60} [style=dashed]; + 44 -> {48} [style=dotted]; + 44 -> {45} [style=dashed]; + 45 -> {46}; 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {52}; - 49 -> {50} [style=dotted]; - 50 -> {51} [style=dotted]; - 51 -> {52} [style=dotted]; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {59}; - 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 58 -> {59} [style=dotted]; - 60 -> {61}; - 61 -> {62}; + 47 -> {48} [color=green]; + 48 -> {49 56} [color=green]; + 48 -> {49 56} [style=dashed]; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {55}; + 52 -> {53} [style=dotted]; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {62}; + 59 -> {60} [style=dotted]; + 60 -> {61} [style=dotted]; + 61 -> {62} [style=dotted]; subgraph cluster_23 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot index 21373557a88..9b4be191d87 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot @@ -6,60 +6,66 @@ digraph implicitReceivers_kt { subgraph cluster_0 { color=red 0 [label="Enter class A" style="filled" fillcolor=red]; - 1 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { + subgraph cluster_1 { color=blue - 3 [label="Enter block"]; - 4 [label="Exit block"]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 5 [label="Exit function foo" style="filled" fillcolor=red]; + 4 [label="Exit class A" style="filled" fillcolor=red]; } - subgraph cluster_3 { + subgraph cluster_2 { color=blue - 6 [label="Enter function " style="filled" fillcolor=red]; - 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 8 [label="Exit function " style="filled" fillcolor=red]; + 5 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter block"]; + 7 [label="Exit block"]; + } + 8 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2 6} [color=green]; - 1 -> {2 6} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; - 4 -> {5}; + 3 -> {4} [color=green]; + 4 -> {5} [color=green]; + 4 -> {5} [style=dashed]; + 5 -> {6}; 6 -> {7}; 7 -> {8}; subgraph cluster_4 { color=red 9 [label="Enter class B" style="filled" fillcolor=red]; - 10 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_5 { - color=blue - 11 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_6 { + subgraph cluster_5 { color=blue - 12 [label="Enter block"]; - 13 [label="Exit block"]; + 10 [label="Enter function " style="filled" fillcolor=red]; + 11 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 12 [label="Exit function " style="filled" fillcolor=red]; } - 14 [label="Exit function bar" style="filled" fillcolor=red]; + 13 [label="Exit class B" style="filled" fillcolor=red]; } - subgraph cluster_7 { + subgraph cluster_6 { color=blue - 15 [label="Enter function " style="filled" fillcolor=red]; - 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 17 [label="Exit function " style="filled" fillcolor=red]; + 14 [label="Enter function bar" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 15 [label="Enter block"]; + 16 [label="Exit block"]; + } + 17 [label="Exit function bar" style="filled" fillcolor=red]; } 9 -> {10} [color=green]; - 10 -> {11 15} [color=green]; - 10 -> {11 15} [style=dashed]; + 9 -> {13} [style=dotted]; + 9 -> {10} [style=dashed]; + 10 -> {11}; 11 -> {12}; - 12 -> {13}; - 13 -> {14}; + 12 -> {13} [color=green]; + 13 -> {14} [color=green]; + 13 -> {14} [style=dashed]; + 14 -> {15}; 15 -> {16}; 16 -> {17}; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot index cfd5292c418..9930c1e5068 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot @@ -8,61 +8,62 @@ digraph assignSafeCall_kt { 0 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter property" style="filled" fillcolor=red]; - 2 [label="Const: Int(1)"]; - 3 [label="Exit property" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 4 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_2 { - color=blue - 5 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_3 { + subgraph cluster_2 { color=blue - 6 [label="Enter block"]; - 7 [label="Exit block"]; + 4 [label="Enter property" style="filled" fillcolor=red]; + 5 [label="Const: Int(1)"]; + 6 [label="Exit property" style="filled" fillcolor=red]; } - 8 [label="Exit function bar" style="filled" fillcolor=red]; + 7 [label="Exit class A" style="filled" fillcolor=red]; } - subgraph cluster_4 { + subgraph cluster_3 { color=blue - 9 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_5 { + 8 [label="Enter function bar" style="filled" fillcolor=red]; + subgraph cluster_4 { color=blue - 10 [label="Enter block"]; - 11 [label="Const: Int(1)"]; - 12 [label="Jump: ^foo Int(1)"]; - 13 [label="Stub" style="filled" fillcolor=gray]; - 14 [label="Exit block" style="filled" fillcolor=gray]; + 9 [label="Enter block"]; + 10 [label="Exit block"]; } - 15 [label="Exit function foo" style="filled" fillcolor=red]; + 11 [label="Exit function bar" style="filled" fillcolor=red]; } - subgraph cluster_6 { + subgraph cluster_5 { color=blue - 16 [label="Enter function " style="filled" fillcolor=red]; - 17 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 18 [label="Exit function " style="filled" fillcolor=red]; + 12 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 13 [label="Enter block"]; + 14 [label="Const: Int(1)"]; + 15 [label="Jump: ^foo Int(1)"]; + 16 [label="Stub" style="filled" fillcolor=gray]; + 17 [label="Exit block" style="filled" fillcolor=gray]; + } + 18 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {4} [style=dotted]; - 0 -> {1} [style=dashed]; + 0 -> {7} [style=dotted]; + 0 -> {1 4} [style=dashed]; 1 -> {2}; 2 -> {3}; 3 -> {4} [color=green]; - 4 -> {5 9 16} [color=green]; - 4 -> {5 9 16} [style=dashed]; + 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {8}; + 6 -> {7} [color=green]; + 7 -> {8 12} [color=green]; + 7 -> {8 12} [style=dashed]; + 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; - 12 -> {15}; - 12 -> {13} [style=dotted]; - 13 -> {14} [style=dotted]; - 14 -> {15} [style=dotted]; - 16 -> {17}; - 17 -> {18}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {18}; + 15 -> {16} [style=dotted]; + 16 -> {17} [style=dotted]; + 17 -> {18} [style=dotted]; subgraph cluster_7 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot index fcc19e38c3b..ecdddb4e329 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot @@ -52,42 +52,41 @@ digraph smartCastInInit_kt { 14 [label="Enter class Main" style="filled" fillcolor=red]; subgraph cluster_6 { color=blue - 15 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 16 [label="Enter block"]; - 17 [label="Function call: R|/s|()" style="filled" fillcolor=yellow]; - 18 [label="Assignment: R|/Main.x|"]; - 19 [label="Access variable R|/Main.x|"]; - 20 [label="Smart cast: this@R|/Main|.R|/Main.x|"]; - 21 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()" style="filled" fillcolor=yellow]; - 22 [label="Exit block"]; - } - 23 [label="Exit init block" style="filled" fillcolor=red]; + 15 [label="Enter function " style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 17 [label="Exit function " style="filled" fillcolor=red]; } - 24 [label="Exit class Main" style="filled" fillcolor=red]; - } - subgraph cluster_8 { - color=blue - 25 [label="Enter function " style="filled" fillcolor=red]; - 26 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 27 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 18 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 19 [label="Enter block"]; + 20 [label="Function call: R|/s|()" style="filled" fillcolor=yellow]; + 21 [label="Assignment: R|/Main.x|"]; + 22 [label="Access variable R|/Main.x|"]; + 23 [label="Smart cast: this@R|/Main|.R|/Main.x|"]; + 24 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()" style="filled" fillcolor=yellow]; + 25 [label="Exit block"]; + } + 26 [label="Exit init block" style="filled" fillcolor=red]; + } + 27 [label="Exit class Main" style="filled" fillcolor=red]; } 14 -> {15} [color=green]; - 14 -> {24} [style=dotted]; - 14 -> {15} [style=dashed]; + 14 -> {27} [style=dotted]; + 14 -> {15 18} [style=dashed]; 15 -> {16}; 16 -> {17}; - 17 -> {18}; + 17 -> {18} [color=green]; 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; - 23 -> {24} [color=green]; - 24 -> {25} [color=green]; - 24 -> {25} [style=dashed]; + 23 -> {24}; + 24 -> {25}; 25 -> {26}; - 26 -> {27}; + 26 -> {27} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot index fa0bc5ee2ba..9b789ce4326 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot @@ -8,37 +8,36 @@ digraph smartcastInByClause_kt { 0 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter property" style="filled" fillcolor=red]; - 2 [label="Access variable R|/path|"]; - 3 [label="Exit property" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } subgraph cluster_2 { color=blue 4 [label="Enter property" style="filled" fillcolor=red]; - 5 [label="Access variable R|/index|"]; + 5 [label="Access variable R|/path|"]; 6 [label="Exit property" style="filled" fillcolor=red]; } - 7 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_3 { - color=blue - 8 [label="Enter function " style="filled" fillcolor=red]; - 9 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 10 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 7 [label="Enter property" style="filled" fillcolor=red]; + 8 [label="Access variable R|/index|"]; + 9 [label="Exit property" style="filled" fillcolor=red]; + } + 10 [label="Exit class A" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {7} [style=dotted]; - 0 -> {1 4} [style=dashed]; + 0 -> {10} [style=dotted]; + 0 -> {1 4 7} [style=dashed]; 1 -> {2}; 2 -> {3}; 3 -> {4} [color=green]; 4 -> {5}; 5 -> {6}; 6 -> {7} [color=green]; - 7 -> {8} [color=green]; - 7 -> {8} [style=dashed]; + 7 -> {8}; 8 -> {9}; - 9 -> {10}; + 9 -> {10} [color=green]; subgraph cluster_4 { color=red @@ -52,28 +51,27 @@ digraph smartcastInByClause_kt { 13 [label="Enter class Derived" style="filled" fillcolor=red]; subgraph cluster_6 { color=blue - 14 [label="Enter property" style="filled" fillcolor=red]; - 15 [label="Access variable R|/index|"]; - 16 [label="Exit property" style="filled" fillcolor=red]; + 14 [label="Enter function " style="filled" fillcolor=red]; + 15 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 16 [label="Exit function " style="filled" fillcolor=red]; } - 17 [label="Exit class Derived" style="filled" fillcolor=red]; - } - subgraph cluster_7 { - color=blue - 18 [label="Enter function " style="filled" fillcolor=red]; - 19 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 20 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 17 [label="Enter property" style="filled" fillcolor=red]; + 18 [label="Access variable R|/index|"]; + 19 [label="Exit property" style="filled" fillcolor=red]; + } + 20 [label="Exit class Derived" style="filled" fillcolor=red]; } 13 -> {14} [color=green]; - 13 -> {17} [style=dotted]; - 13 -> {14} [style=dashed]; + 13 -> {20} [style=dotted]; + 13 -> {14 17} [style=dashed]; 14 -> {15}; 15 -> {16}; 16 -> {17} [color=green]; - 17 -> {18} [color=green]; - 17 -> {18} [style=dashed]; + 17 -> {18}; 18 -> {19}; - 19 -> {20}; + 19 -> {20} [color=green]; subgraph cluster_8 { color=red @@ -103,26 +101,32 @@ digraph smartcastInByClause_kt { 40 [label="Enter class " style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 41 [label="Enter field" style="filled" fillcolor=red]; - 42 [label="Access variable R|/a|"]; - 43 [label="Smart cast: R|/a|"]; - 44 [label="Access variable R|/A.index|"]; - 45 [label="Function call: R|/Derived.Derived|(...)" style="filled" fillcolor=yellow]; - 46 [label="Exit field" style="filled" fillcolor=red]; + 41 [label="Enter function " style="filled" fillcolor=red]; + 42 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 43 [label="Exit function " style="filled" fillcolor=red]; } subgraph cluster_12 { color=blue - 47 [label="Enter property" style="filled" fillcolor=red]; - 48 [label="Access variable R|/a|"]; - 49 [label="Smart cast: R|/a|"]; - 50 [label="Access variable R|/A.index|"]; - 51 [label="Exit property" style="filled" fillcolor=red]; + 44 [label="Enter field" style="filled" fillcolor=red]; + 45 [label="Access variable R|/a|"]; + 46 [label="Smart cast: R|/a|"]; + 47 [label="Access variable R|/A.index|"]; + 48 [label="Function call: R|/Derived.Derived|(...)" style="filled" fillcolor=yellow]; + 49 [label="Exit field" style="filled" fillcolor=red]; } - 52 [label="Exit class " style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 50 [label="Enter property" style="filled" fillcolor=red]; + 51 [label="Access variable R|/a|"]; + 52 [label="Smart cast: R|/a|"]; + 53 [label="Access variable R|/A.index|"]; + 54 [label="Exit property" style="filled" fillcolor=red]; + } + 55 [label="Exit class " style="filled" fillcolor=red]; } - 53 [label="Exit anonymous object"]; - 54 [label="Exit anonymous object expression"]; - 55 [label="Jump: ^test object : R|Base| { + 56 [label="Exit anonymous object"]; + 57 [label="Exit anonymous object expression"]; + 58 [label="Jump: ^test object : R|Base| { private constructor(): R|| { super() } @@ -138,30 +142,24 @@ digraph smartcastInByClause_kt { } "]; - 56 [label="Stub" style="filled" fillcolor=gray]; - 57 [label="Exit block" style="filled" fillcolor=gray]; + 59 [label="Stub" style="filled" fillcolor=gray]; + 60 [label="Exit block" style="filled" fillcolor=gray]; } - 58 [label="Exit function test" style="filled" fillcolor=red]; + 61 [label="Exit function test" style="filled" fillcolor=red]; } - subgraph cluster_13 { + subgraph cluster_14 { color=blue - 59 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_14 { + 62 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_15 { color=blue - 60 [label="Enter block"]; - 61 [label="Access variable R|/a|"]; - 62 [label="Smart cast: R|/a|"]; - 63 [label="Access variable R|/A.index|"]; - 64 [label="Function call: R|/takeInt|(...)" style="filled" fillcolor=yellow]; - 65 [label="Exit block"]; + 63 [label="Enter block"]; + 64 [label="Access variable R|/a|"]; + 65 [label="Smart cast: R|/a|"]; + 66 [label="Access variable R|/A.index|"]; + 67 [label="Function call: R|/takeInt|(...)" style="filled" fillcolor=yellow]; + 68 [label="Exit block"]; } - 66 [label="Exit function foo" style="filled" fillcolor=red]; - } - subgraph cluster_15 { - color=blue - 67 [label="Enter function " style="filled" fillcolor=red]; - 68 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 69 [label="Exit function " style="filled" fillcolor=red]; + 69 [label="Exit function foo" style="filled" fillcolor=red]; } 21 -> {22}; 22 -> {23}; @@ -172,7 +170,7 @@ digraph smartcastInByClause_kt { 27 -> {28 32}; 28 -> {29}; 29 -> {30}; - 30 -> {58}; + 30 -> {61}; 30 -> {31} [style=dotted]; 31 -> {33} [style=dotted]; 32 -> {33}; @@ -183,38 +181,39 @@ digraph smartcastInByClause_kt { 37 -> {38}; 38 -> {39}; 39 -> {40}; - 39 -> {53} [color=red]; + 39 -> {56} [color=red]; 39 -> {40} [style=dashed]; 40 -> {41}; - 40 -> {47 59 67} [color=red]; - 40 -> {52} [style=dotted]; - 40 -> {41 47} [style=dashed]; + 40 -> {44 50 62} [color=red]; + 40 -> {55} [style=dotted]; + 40 -> {41 44 50} [style=dashed]; 41 -> {42}; 42 -> {43}; - 43 -> {44}; + 43 -> {44} [color=green]; 44 -> {45}; 45 -> {46}; - 46 -> {47} [color=green]; + 46 -> {47}; 47 -> {48}; 48 -> {49}; - 49 -> {50}; + 49 -> {50} [color=green]; 50 -> {51}; - 51 -> {52} [color=green]; - 52 -> {53 59 67} [color=green]; - 52 -> {59 67} [style=dashed]; + 51 -> {52}; + 52 -> {53}; 53 -> {54}; - 54 -> {55}; - 55 -> {58}; - 55 -> {56} [style=dotted]; - 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; + 54 -> {55} [color=green]; + 55 -> {56 62} [color=green]; + 55 -> {62} [style=dashed]; + 56 -> {57}; + 57 -> {58}; + 58 -> {61}; + 58 -> {59} [style=dotted]; + 59 -> {60} [style=dotted]; + 60 -> {61} [style=dotted]; 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; + 66 -> {67}; 67 -> {68}; 68 -> {69}; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 0558c9bc139..80c2ca7461f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -119,37 +119,36 @@ digraph smartcastToNothing_kt { 39 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 40 [label="Enter property" style="filled" fillcolor=red]; - 41 [label="Const: Int(1)"]; - 42 [label="Exit property" style="filled" fillcolor=red]; + 40 [label="Enter function " style="filled" fillcolor=red]; + 41 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 42 [label="Exit function " style="filled" fillcolor=red]; } subgraph cluster_12 { color=blue 43 [label="Enter property" style="filled" fillcolor=red]; - 44 [label="Const: Boolean(true)"]; + 44 [label="Const: Int(1)"]; 45 [label="Exit property" style="filled" fillcolor=red]; } - 46 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_13 { - color=blue - 47 [label="Enter function " style="filled" fillcolor=red]; - 48 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 49 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 46 [label="Enter property" style="filled" fillcolor=red]; + 47 [label="Const: Boolean(true)"]; + 48 [label="Exit property" style="filled" fillcolor=red]; + } + 49 [label="Exit class A" style="filled" fillcolor=red]; } 39 -> {40} [color=green]; - 39 -> {46} [style=dotted]; - 39 -> {40 43} [style=dashed]; + 39 -> {49} [style=dotted]; + 39 -> {40 43 46} [style=dashed]; 40 -> {41}; 41 -> {42}; 42 -> {43} [color=green]; 43 -> {44}; 44 -> {45}; 45 -> {46} [color=green]; - 46 -> {47} [color=green]; - 46 -> {47} [style=dashed]; + 46 -> {47}; 47 -> {48}; - 48 -> {49}; + 48 -> {49} [color=green]; subgraph cluster_14 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot index 32377e5774e..6707f8dd0f0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot @@ -8,94 +8,96 @@ digraph overridenOpenVal_kt { 0 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter property" style="filled" fillcolor=red]; - 2 [label="Access variable R|/x|"]; - 3 [label="Exit property" style="filled" fillcolor=red]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 4 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_2 { - color=blue - 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 7 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 4 [label="Enter property" style="filled" fillcolor=red]; + 5 [label="Access variable R|/x|"]; + 6 [label="Exit property" style="filled" fillcolor=red]; + } + 7 [label="Exit class A" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 0 -> {4} [style=dotted]; - 0 -> {1} [style=dashed]; + 0 -> {7} [style=dotted]; + 0 -> {1 4} [style=dashed]; 1 -> {2}; 2 -> {3}; 3 -> {4} [color=green]; - 4 -> {5} [color=green]; - 4 -> {5} [style=dashed]; + 4 -> {5}; 5 -> {6}; - 6 -> {7}; + 6 -> {7} [color=green]; subgraph cluster_3 { color=red 8 [label="Enter class B" style="filled" fillcolor=red]; - 9 [label="Exit class B" style="filled" fillcolor=red]; - } - subgraph cluster_4 { - color=blue - 10 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_5 { + subgraph cluster_4 { color=blue - 11 [label="Enter block"]; - subgraph cluster_6 { + 9 [label="Enter function " style="filled" fillcolor=red]; + 10 [label="Access variable R|/x|"]; + 11 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; + 12 [label="Exit function " style="filled" fillcolor=red]; + } + 13 [label="Exit class B" style="filled" fillcolor=red]; + } + subgraph cluster_5 { + color=blue + 14 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 15 [label="Enter block"]; + subgraph cluster_7 { color=blue - 12 [label="Enter when"]; - subgraph cluster_7 { - color=blue - 13 [label="Enter when branch condition "]; - 14 [label="Access variable R|/A.x|"]; - 15 [label="Type operator: (this@R|/B|.R|/A.x| is R|kotlin/String|)"]; - 16 [label="Exit when branch condition"]; - } - 17 [label="Synthetic else branch"]; - 18 [label="Enter when branch result"]; + 16 [label="Enter when"]; subgraph cluster_8 { color=blue - 19 [label="Enter block"]; - 20 [label="Access variable R|/A.x|"]; - 21 [label="Smart cast: this@R|/B|.R|/A.x|"]; - 22 [label="Access variable R|kotlin/String.length|"]; - 23 [label="Exit block"]; + 17 [label="Enter when branch condition "]; + 18 [label="Access variable R|/A.x|"]; + 19 [label="Type operator: (this@R|/B|.R|/A.x| is R|kotlin/String|)"]; + 20 [label="Exit when branch condition"]; } - 24 [label="Exit when branch result"]; - 25 [label="Exit when"]; + 21 [label="Synthetic else branch"]; + 22 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 23 [label="Enter block"]; + 24 [label="Access variable R|/A.x|"]; + 25 [label="Smart cast: this@R|/B|.R|/A.x|"]; + 26 [label="Access variable R|kotlin/String.length|"]; + 27 [label="Exit block"]; + } + 28 [label="Exit when branch result"]; + 29 [label="Exit when"]; } - 26 [label="Exit block"]; + 30 [label="Exit block"]; } - 27 [label="Exit function test_1" style="filled" fillcolor=red]; - } - subgraph cluster_9 { - color=blue - 28 [label="Enter function " style="filled" fillcolor=red]; - 29 [label="Access variable R|/x|"]; - 30 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; - 31 [label="Exit function " style="filled" fillcolor=red]; + 31 [label="Exit function test_1" style="filled" fillcolor=red]; } 8 -> {9} [color=green]; - 9 -> {10 28} [color=green]; - 9 -> {10 28} [style=dashed]; + 8 -> {13} [style=dotted]; + 8 -> {9} [style=dashed]; + 9 -> {10}; 10 -> {11}; 11 -> {12}; - 12 -> {13}; - 13 -> {14}; + 12 -> {13} [color=green]; + 13 -> {14} [color=green]; + 13 -> {14} [style=dashed]; 14 -> {15}; 15 -> {16}; - 16 -> {17 18}; - 17 -> {25}; + 16 -> {17}; + 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {22}; + 20 -> {21 22}; + 21 -> {29}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; + 27 -> {28}; 28 -> {29}; 29 -> {30}; 30 -> {31}; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot index 46f9cd32fbe..0321b928282 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot @@ -6,30 +6,33 @@ digraph delayedAssignment_kt { subgraph cluster_0 { color=red 0 [label="Enter class A" style="filled" fillcolor=red]; - 1 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { + subgraph cluster_1 { color=blue - 3 [label="Enter block"]; - 4 [label="Exit block"]; + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; } - 5 [label="Exit function foo" style="filled" fillcolor=red]; + 4 [label="Exit class A" style="filled" fillcolor=red]; } - subgraph cluster_3 { + subgraph cluster_2 { color=blue - 6 [label="Enter function " style="filled" fillcolor=red]; - 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 8 [label="Exit function " style="filled" fillcolor=red]; + 5 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter block"]; + 7 [label="Exit block"]; + } + 8 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2 6} [color=green]; - 1 -> {2 6} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; - 4 -> {5}; + 3 -> {4} [color=green]; + 4 -> {5} [color=green]; + 4 -> {5} [style=dashed]; + 5 -> {6}; 6 -> {7}; 7 -> {8}; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot index 4033a9baa88..f9cb5406af6 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot @@ -20,84 +20,85 @@ digraph inAnonymousObject_kt { 5 [label="Enter class " style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 6 [label="Enter property" style="filled" fillcolor=red]; - 7 [label="Access variable R|/a|"]; - 8 [label="Exit property" style="filled" fillcolor=red]; + 6 [label="Enter function " style="filled" fillcolor=red]; + 7 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 8 [label="Exit function " style="filled" fillcolor=red]; } subgraph cluster_5 { color=blue - 9 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 10 [label="Enter block"]; - 11 [label="Access variable R|/b|"]; - 12 [label="Assignment: R|/.leaked|"]; - 13 [label="Exit block"]; - } - 14 [label="Exit init block" style="filled" fillcolor=red]; + 9 [label="Enter property" style="filled" fillcolor=red]; + 10 [label="Access variable R|/a|"]; + 11 [label="Exit property" style="filled" fillcolor=red]; } - 15 [label="Exit class " style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 12 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 13 [label="Enter block"]; + 14 [label="Access variable R|/b|"]; + 15 [label="Assignment: R|/.leaked|"]; + 16 [label="Exit block"]; + } + 17 [label="Exit init block" style="filled" fillcolor=red]; + } + 18 [label="Exit class " style="filled" fillcolor=red]; } - 16 [label="Exit anonymous object"]; - 17 [label="Exit anonymous object expression"]; - 18 [label="Variable declaration: lval obj: R||"]; - 19 [label="Access variable R|/obj|"]; - 20 [label="Function call: R|/obj|.R|/.run|()" style="filled" fillcolor=yellow]; - 21 [label="Function call: R|/d|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; - 22 [label="Exit block"]; + 19 [label="Exit anonymous object"]; + 20 [label="Exit anonymous object expression"]; + 21 [label="Variable declaration: lval obj: R||"]; + 22 [label="Access variable R|/obj|"]; + 23 [label="Function call: R|/obj|.R|/.run|()" style="filled" fillcolor=yellow]; + 24 [label="Function call: R|/d|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 25 [label="Exit block"]; } - 23 [label="Exit function foo" style="filled" fillcolor=red]; + 26 [label="Exit function foo" style="filled" fillcolor=red]; } - subgraph cluster_7 { + subgraph cluster_8 { color=blue - 24 [label="Enter function run" style="filled" fillcolor=red]; - subgraph cluster_8 { + 27 [label="Enter function run" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 25 [label="Enter block"]; - 26 [label="Function call: R|/c|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; - 27 [label="Exit block"]; + 28 [label="Enter block"]; + 29 [label="Function call: R|/c|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 30 [label="Exit block"]; } - 28 [label="Exit function run" style="filled" fillcolor=red]; - } - subgraph cluster_9 { - color=blue - 29 [label="Enter function " style="filled" fillcolor=red]; - 30 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 31 [label="Exit function " style="filled" fillcolor=red]; + 31 [label="Exit function run" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; 2 -> {3}; 3 -> {4}; 4 -> {5}; - 4 -> {16} [color=red]; + 4 -> {19} [color=red]; 4 -> {5} [style=dashed]; 5 -> {6}; - 5 -> {9 24 29} [color=red]; - 5 -> {15} [style=dotted]; - 5 -> {6 9} [style=dashed]; + 5 -> {9 12 27} [color=red]; + 5 -> {18} [style=dotted]; + 5 -> {6 9 12} [style=dashed]; 6 -> {7}; 7 -> {8}; 8 -> {9} [color=green]; 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 11 -> {12} [color=green]; 12 -> {13}; 13 -> {14}; - 14 -> {15} [color=green]; - 15 -> {16 24 29} [color=green]; - 15 -> {24 29} [style=dashed]; + 14 -> {15}; + 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; + 17 -> {18} [color=green]; + 18 -> {19 27} [color=green]; + 18 -> {27} [style=dashed]; 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; - 26 -> {27}; 27 -> {28}; + 28 -> {29}; 29 -> {30}; 30 -> {31}; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index 7a6f656d53a..2ee2b7b73e0 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -6,19 +6,20 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_0 { color=red 0 [label="Enter class DelegateProvider" style="filled" fillcolor=red]; - 1 [label="Exit class DelegateProvider" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 4 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function " style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + 4 [label="Exit class DelegateProvider" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red @@ -47,30 +48,33 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_4 { color=red 14 [label="Enter class IssueListView" style="filled" fillcolor=red]; - 15 [label="Exit class IssueListView" style="filled" fillcolor=red]; - } - subgraph cluster_5 { - color=blue - 16 [label="Enter function updateFrom" style="filled" fillcolor=red]; - subgraph cluster_6 { + subgraph cluster_5 { color=blue - 17 [label="Enter block"]; - 18 [label="Exit block"]; + 15 [label="Enter function " style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; + 17 [label="Exit function " style="filled" fillcolor=red]; } - 19 [label="Exit function updateFrom" style="filled" fillcolor=red]; + 18 [label="Exit class IssueListView" style="filled" fillcolor=red]; } - subgraph cluster_7 { + subgraph cluster_6 { color=blue - 20 [label="Enter function " style="filled" fillcolor=red]; - 21 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; - 22 [label="Exit function " style="filled" fillcolor=red]; + 19 [label="Enter function updateFrom" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 20 [label="Enter block"]; + 21 [label="Exit block"]; + } + 22 [label="Exit function updateFrom" style="filled" fillcolor=red]; } 14 -> {15} [color=green]; - 15 -> {16 20} [color=green]; - 15 -> {16 20} [style=dashed]; + 14 -> {18} [style=dotted]; + 14 -> {15} [style=dashed]; + 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; + 17 -> {18} [color=green]; + 18 -> {19} [color=green]; + 18 -> {19} [style=dashed]; + 19 -> {20}; 20 -> {21}; 21 -> {22}; @@ -79,166 +83,170 @@ digraph delegateWithAnonymousObject_kt { 23 [label="Enter class IssuesListUserProfile" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 24 [label="Enter property" style="filled" fillcolor=red]; - 25 [label="Postponed enter to lambda"]; - subgraph cluster_10 { + 24 [label="Enter function " style="filled" fillcolor=red]; + 25 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; + 26 [label="Exit function " style="filled" fillcolor=red]; + } + subgraph cluster_10 { + color=blue + 27 [label="Enter property" style="filled" fillcolor=red]; + 28 [label="Postponed enter to lambda"]; + subgraph cluster_11 { color=blue - 26 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_11 { + 29 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_12 { color=blue - 27 [label="Enter block"]; - 28 [label="Enter anonymous object"]; - subgraph cluster_12 { + 30 [label="Enter block"]; + 31 [label="Enter anonymous object"]; + subgraph cluster_13 { color=blue - 29 [label="Enter class " style="filled" fillcolor=red]; - 30 [label="Exit class " style="filled" fillcolor=red]; + 32 [label="Enter class " style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 33 [label="Enter function " style="filled" fillcolor=red]; + 34 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 35 [label="Exit function " style="filled" fillcolor=red]; + } + 36 [label="Exit class " style="filled" fillcolor=red]; } - 31 [label="Exit anonymous object"]; - 32 [label="Exit anonymous object expression"]; - 33 [label="Exit block"]; + 37 [label="Exit anonymous object"]; + 38 [label="Exit anonymous object expression"]; + 39 [label="Exit block"]; } - 34 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - subgraph cluster_13 { - color=blue - 35 [label="Enter function setValue" style="filled" fillcolor=red]; - subgraph cluster_14 { - color=blue - 36 [label="Enter block"]; - 37 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; - 38 [label="Access variable R|/value|"]; - 39 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)" style="filled" fillcolor=yellow]; - 40 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|)"]; - 41 [label="Stub" style="filled" fillcolor=gray]; - 42 [label="Exit block" style="filled" fillcolor=gray]; - } - 43 [label="Exit function setValue" style="filled" fillcolor=red]; + 40 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } subgraph cluster_15 { color=blue - 44 [label="Enter function getValue" style="filled" fillcolor=red]; + 41 [label="Enter function setValue" style="filled" fillcolor=red]; subgraph cluster_16 { color=blue - 45 [label="Enter block"]; - 46 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; - 47 [label="Jump: ^getValue R|/IssueListView.IssueListView|()"]; - 48 [label="Stub" style="filled" fillcolor=gray]; - 49 [label="Exit block" style="filled" fillcolor=gray]; + 42 [label="Enter block"]; + 43 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; + 44 [label="Access variable R|/value|"]; + 45 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)" style="filled" fillcolor=yellow]; + 46 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|)"]; + 47 [label="Stub" style="filled" fillcolor=gray]; + 48 [label="Exit block" style="filled" fillcolor=gray]; } - 50 [label="Exit function getValue" style="filled" fillcolor=red]; + 49 [label="Exit function setValue" style="filled" fillcolor=red]; } subgraph cluster_17 { color=blue - 51 [label="Enter function " style="filled" fillcolor=red]; - 52 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 53 [label="Exit function " style="filled" fillcolor=red]; + 50 [label="Enter function getValue" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 51 [label="Enter block"]; + 52 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; + 53 [label="Jump: ^getValue R|/IssueListView.IssueListView|()"]; + 54 [label="Stub" style="filled" fillcolor=gray]; + 55 [label="Exit block" style="filled" fillcolor=gray]; + } + 56 [label="Exit function getValue" style="filled" fillcolor=red]; } - 54 [label="Postponed exit from lambda"]; - 55 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)" style="filled" fillcolor=yellow]; - 56 [label="Access variable this@R|/IssuesListUserProfile|"]; - 57 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)" style="filled" fillcolor=yellow]; - 58 [label="Exit property delegate" style="filled" fillcolor=yellow]; - 59 [label="Exit property" style="filled" fillcolor=red]; + 57 [label="Postponed exit from lambda"]; + 58 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)" style="filled" fillcolor=yellow]; + 59 [label="Access variable this@R|/IssuesListUserProfile|"]; + 60 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)" style="filled" fillcolor=yellow]; + 61 [label="Exit property delegate" style="filled" fillcolor=yellow]; + 62 [label="Exit property" style="filled" fillcolor=red]; } - 60 [label="Exit class IssuesListUserProfile" style="filled" fillcolor=red]; + 63 [label="Exit class IssuesListUserProfile" style="filled" fillcolor=red]; } - subgraph cluster_18 { + subgraph cluster_19 { color=blue - 61 [label="Enter function setter" style="filled" fillcolor=red]; - subgraph cluster_19 { + 64 [label="Enter function setter" style="filled" fillcolor=red]; + subgraph cluster_20 { color=blue - 62 [label="Enter block"]; - 63 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; - 64 [label="Access variable this@R|/IssuesListUserProfile|"]; - 65 [label="Access variable R|/issueListView|"]; - 66 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; - 67 [label="Exit block"]; + 65 [label="Enter block"]; + 66 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; + 67 [label="Access variable this@R|/IssuesListUserProfile|"]; + 68 [label="Access variable R|/issueListView|"]; + 69 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; + 70 [label="Exit block"]; } - 68 [label="Exit function setter" style="filled" fillcolor=red]; + 71 [label="Exit function setter" style="filled" fillcolor=red]; } - subgraph cluster_20 { + subgraph cluster_21 { color=blue - 69 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_21 { + 72 [label="Enter function getter" style="filled" fillcolor=red]; + subgraph cluster_22 { color=blue - 70 [label="Enter block"]; - 71 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; - 72 [label="Access variable this@R|/IssuesListUserProfile|"]; - 73 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; - 74 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; - 75 [label="Stub" style="filled" fillcolor=gray]; - 76 [label="Exit block" style="filled" fillcolor=gray]; + 73 [label="Enter block"]; + 74 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; + 75 [label="Access variable this@R|/IssuesListUserProfile|"]; + 76 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; + 77 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; + 78 [label="Stub" style="filled" fillcolor=gray]; + 79 [label="Exit block" style="filled" fillcolor=gray]; } - 77 [label="Exit function getter" style="filled" fillcolor=red]; - } - subgraph cluster_22 { - color=blue - 78 [label="Enter function " style="filled" fillcolor=red]; - 79 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; - 80 [label="Exit function " style="filled" fillcolor=red]; + 80 [label="Exit function getter" style="filled" fillcolor=red]; } 23 -> {24} [color=green]; - 23 -> {60} [style=dotted]; - 23 -> {24} [style=dashed]; + 23 -> {63} [style=dotted]; + 23 -> {24 27} [style=dashed]; 24 -> {25}; - 25 -> {26 54 55}; - 25 -> {26} [style=dashed]; - 26 -> {27}; + 25 -> {26}; + 26 -> {27} [color=green]; 27 -> {28}; - 28 -> {29}; - 28 -> {31} [color=red]; + 28 -> {29 57 58}; 28 -> {29} [style=dashed]; - 29 -> {30} [color=green]; - 29 -> {35 44 51} [color=red]; - 30 -> {31 35 44 51} [color=green]; - 30 -> {35 44 51} [style=dashed]; + 29 -> {30}; + 30 -> {31}; 31 -> {32}; + 31 -> {37} [color=red]; + 31 -> {32} [style=dashed]; 32 -> {33}; + 32 -> {41 50} [color=red]; + 32 -> {36} [style=dotted]; + 32 -> {33} [style=dashed]; 33 -> {34}; - 35 -> {36}; - 36 -> {37}; + 34 -> {35}; + 35 -> {36} [color=green]; + 36 -> {37 41 50} [color=green]; + 36 -> {41 50} [style=dashed]; 37 -> {38}; 38 -> {39}; 39 -> {40}; - 40 -> {43}; - 40 -> {41} [style=dotted]; - 41 -> {42} [style=dotted]; - 42 -> {43} [style=dotted]; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {47}; - 47 -> {50}; + 46 -> {49}; + 46 -> {47} [style=dotted]; 47 -> {48} [style=dotted]; 48 -> {49} [style=dotted]; - 49 -> {50} [style=dotted]; + 50 -> {51}; 51 -> {52}; 52 -> {53}; - 54 -> {55} [color=green]; - 54 -> {58} [color=red]; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; + 53 -> {56}; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; + 55 -> {56} [style=dotted]; + 57 -> {58} [color=green]; + 57 -> {61} [color=red]; 58 -> {59}; - 59 -> {60} [color=green]; - 60 -> {61 69 78} [color=green]; - 60 -> {61 69 78} [style=dashed]; + 59 -> {60}; + 60 -> {61}; 61 -> {62}; - 62 -> {63}; - 63 -> {64}; + 62 -> {63} [color=green]; + 63 -> {64 72} [color=green]; + 63 -> {64 72} [style=dashed]; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; + 68 -> {69}; 69 -> {70}; 70 -> {71}; - 71 -> {72}; 72 -> {73}; 73 -> {74}; - 74 -> {77}; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; - 76 -> {77} [style=dotted]; - 78 -> {79}; - 79 -> {80}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {80}; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot index 8f21213b410..6d7b8f586a4 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot @@ -54,28 +54,27 @@ digraph plusAssignWithLambdaInRhs_kt { 17 [label="Enter class A" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 18 [label="Enter property" style="filled" fillcolor=red]; - 19 [label="Access variable R|/executor|"]; - 20 [label="Exit property" style="filled" fillcolor=red]; + 18 [label="Enter function " style="filled" fillcolor=red]; + 19 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; + 20 [label="Exit function " style="filled" fillcolor=red]; } - 21 [label="Exit class A" style="filled" fillcolor=red]; - } - subgraph cluster_6 { - color=blue - 22 [label="Enter function " style="filled" fillcolor=red]; - 23 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; - 24 [label="Exit function " style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 21 [label="Enter property" style="filled" fillcolor=red]; + 22 [label="Access variable R|/executor|"]; + 23 [label="Exit property" style="filled" fillcolor=red]; + } + 24 [label="Exit class A" style="filled" fillcolor=red]; } 17 -> {18} [color=green]; - 17 -> {21} [style=dotted]; - 17 -> {18} [style=dashed]; + 17 -> {24} [style=dotted]; + 17 -> {18 21} [style=dashed]; 18 -> {19}; 19 -> {20}; 20 -> {21} [color=green]; - 21 -> {22} [color=green]; - 21 -> {22} [style=dashed]; + 21 -> {22}; 22 -> {23}; - 23 -> {24}; + 23 -> {24} [color=green]; subgraph cluster_7 { color=red diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt index ef0e4ee632c..1ed757105b2 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt @@ -365,14 +365,14 @@ class ControlFlowGraphBuilder { } private inline fun FirClass.forEachGraphOwner(block: (FirControlFlowGraphOwner, isInPlace: Boolean) -> Unit) { - for (declaration in declarations) { - // TODO: constructors are also called-in-place, but after everything else, and only one of them is chosen. - if (declaration is FirControlFlowGraphOwner && declaration.memberShouldHaveGraph) { - block(declaration, declaration !is FirFunction && declaration !is FirClass) + for (member in declarations) { + if (member is FirControlFlowGraphOwner && member.memberShouldHaveGraph) { + // TODO: class secondary constructors are called-in-place after everything else, and at most one is chosen. + block(member, (member is FirConstructor && member.isPrimary) || (member !is FirFunction && member !is FirClass)) } - if (declaration is FirProperty) { - declaration.getter?.let { block(it, false) } - declaration.setter?.let { block(it, false) } + if (member is FirProperty) { + member.getter?.let { block(it, false) } + member.setter?.let { block(it, false) } } } } @@ -417,6 +417,9 @@ class ControlFlowGraphBuilder { if (enterNode.previousNodes.isNotEmpty()) { klass.forEachGraphOwner { member, isInPlace -> val kind = if (!isInPlace || foundInPlace) { + assert(member !is FirConstructor || !member.isPrimary) { + "primary constructor of $name not first called-in-place member, CFG will be wrong" + } EdgeKind.DfgForward } else { EdgeKind.Forward.also { foundInPlace = true } diff --git a/compiler/testData/codegen/box/smartCasts/kt44814.dot b/compiler/testData/codegen/box/smartCasts/kt44814.dot index 4cadef9c550..284ac9754d9 100644 --- a/compiler/testData/codegen/box/smartCasts/kt44814.dot +++ b/compiler/testData/codegen/box/smartCasts/kt44814.dot @@ -6,69 +6,71 @@ digraph kt44814_kt { subgraph cluster_0 { color=red 0 [label="Enter class FlyweightCapableTreeStructure [1]" style="filled" fillcolor=red]; - 1 [label="Exit class FlyweightCapableTreeStructure [1]" style="filled" fillcolor=red]; - } - subgraph cluster_1 { - color=blue - 2 [label="Enter function [2]" style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 4 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter function [2]" style="filled" fillcolor=red]; + 2 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 3 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 4 [label="Exit class FlyweightCapableTreeStructure [1]" style="filled" fillcolor=red]; } 0 -> {1} [color=green]; - 1 -> {2} [color=green]; - 1 -> {2} [style=dashed]; + 0 -> {4} [style=dotted]; + 0 -> {1} [style=dashed]; + 1 -> {2}; 2 -> {3}; - 3 -> {4}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red 5 [label="Enter class FirSourceElement [1]" style="filled" fillcolor=red]; - 6 [label="Exit class FirSourceElement [1]" style="filled" fillcolor=red]; - } - subgraph cluster_3 { - color=blue - 7 [label="Enter function [2]" style="filled" fillcolor=red]; - 8 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 9 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter function [2]" style="filled" fillcolor=red]; + 7 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 8 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 9 [label="Exit class FirSourceElement [1]" style="filled" fillcolor=red]; } 5 -> {6} [color=green]; - 6 -> {7} [color=green]; - 6 -> {7} [style=dashed]; + 5 -> {9} [style=dotted]; + 5 -> {6} [style=dashed]; + 6 -> {7}; 7 -> {8}; - 8 -> {9}; + 8 -> {9} [color=green]; subgraph cluster_4 { color=red 10 [label="Enter class FirPsiSourceElement [1]" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 11 [label="Enter property [2]" style="filled" fillcolor=red]; - 12 [label="Access variable R|/psi| [2]"]; - 13 [label="Exit property [2]" style="filled" fillcolor=red]; + 11 [label="Enter function [2]" style="filled" fillcolor=red]; + 12 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 13 [label="Exit function [2]" style="filled" fillcolor=red]; } subgraph cluster_6 { color=blue 14 [label="Enter property [2]" style="filled" fillcolor=red]; - 15 [label="Access variable R|/lighterASTNode| [2]"]; + 15 [label="Access variable R|/psi| [2]"]; 16 [label="Exit property [2]" style="filled" fillcolor=red]; } subgraph cluster_7 { color=blue 17 [label="Enter property [2]" style="filled" fillcolor=red]; - 18 [label="Access variable R|/treeStructure| [2]"]; + 18 [label="Access variable R|/lighterASTNode| [2]"]; 19 [label="Exit property [2]" style="filled" fillcolor=red]; } - 20 [label="Exit class FirPsiSourceElement [1]" style="filled" fillcolor=red]; - } - subgraph cluster_8 { - color=blue - 21 [label="Enter function [2]" style="filled" fillcolor=red]; - 22 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 23 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 20 [label="Enter property [2]" style="filled" fillcolor=red]; + 21 [label="Access variable R|/treeStructure| [2]"]; + 22 [label="Exit property [2]" style="filled" fillcolor=red]; + } + 23 [label="Exit class FirPsiSourceElement [1]" style="filled" fillcolor=red]; } 10 -> {11} [color=green]; - 10 -> {20} [style=dotted]; - 10 -> {11 14 17} [style=dashed]; + 10 -> {23} [style=dotted]; + 10 -> {11 14 17 20} [style=dashed]; 11 -> {12}; 12 -> {13}; 13 -> {14} [color=green]; @@ -78,414 +80,431 @@ digraph kt44814_kt { 17 -> {18}; 18 -> {19}; 19 -> {20} [color=green]; - 20 -> {21} [color=green]; - 20 -> {21} [style=dashed]; + 20 -> {21}; 21 -> {22}; - 22 -> {23}; + 22 -> {23} [color=green]; subgraph cluster_9 { color=red 24 [label="Enter class FirLightSourceElement [1]" style="filled" fillcolor=red]; subgraph cluster_10 { color=blue - 25 [label="Enter property [2]" style="filled" fillcolor=red]; - 26 [label="Access variable R|/lighterASTNode| [2]"]; - 27 [label="Exit property [2]" style="filled" fillcolor=red]; + 25 [label="Enter function [2]" style="filled" fillcolor=red]; + 26 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 27 [label="Exit function [2]" style="filled" fillcolor=red]; } subgraph cluster_11 { color=blue 28 [label="Enter property [2]" style="filled" fillcolor=red]; - 29 [label="Access variable R|/treeStructure| [2]"]; + 29 [label="Access variable R|/lighterASTNode| [2]"]; 30 [label="Exit property [2]" style="filled" fillcolor=red]; } - 31 [label="Exit class FirLightSourceElement [1]" style="filled" fillcolor=red]; - } - subgraph cluster_12 { - color=blue - 32 [label="Enter function [2]" style="filled" fillcolor=red]; - 33 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 34 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 31 [label="Enter property [2]" style="filled" fillcolor=red]; + 32 [label="Access variable R|/treeStructure| [2]"]; + 33 [label="Exit property [2]" style="filled" fillcolor=red]; + } + 34 [label="Exit class FirLightSourceElement [1]" style="filled" fillcolor=red]; } 24 -> {25} [color=green]; - 24 -> {31} [style=dotted]; - 24 -> {25 28} [style=dashed]; + 24 -> {34} [style=dotted]; + 24 -> {25 28 31} [style=dashed]; 25 -> {26}; 26 -> {27}; 27 -> {28} [color=green]; 28 -> {29}; 29 -> {30}; 30 -> {31} [color=green]; - 31 -> {32} [color=green]; - 31 -> {32} [style=dashed]; + 31 -> {32}; 32 -> {33}; - 33 -> {34}; + 33 -> {34} [color=green]; subgraph cluster_13 { color=red 35 [label="Enter class PsiElement [1]" style="filled" fillcolor=red]; - 36 [label="Exit class PsiElement [1]" style="filled" fillcolor=red]; - } - subgraph cluster_14 { - color=blue - 37 [label="Enter function [2]" style="filled" fillcolor=red]; - 38 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 39 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 36 [label="Enter function [2]" style="filled" fillcolor=red]; + 37 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 38 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 39 [label="Exit class PsiElement [1]" style="filled" fillcolor=red]; } 35 -> {36} [color=green]; - 36 -> {37} [color=green]; - 36 -> {37} [style=dashed]; + 35 -> {39} [style=dotted]; + 35 -> {36} [style=dashed]; + 36 -> {37}; 37 -> {38}; - 38 -> {39}; + 38 -> {39} [color=green]; subgraph cluster_15 { color=red 40 [label="Enter class ASTNode [1]" style="filled" fillcolor=red]; - 41 [label="Exit class ASTNode [1]" style="filled" fillcolor=red]; - } - subgraph cluster_16 { - color=blue - 42 [label="Enter function [2]" style="filled" fillcolor=red]; - 43 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 44 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 41 [label="Enter function [2]" style="filled" fillcolor=red]; + 42 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 43 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 44 [label="Exit class ASTNode [1]" style="filled" fillcolor=red]; } 40 -> {41} [color=green]; - 41 -> {42} [color=green]; - 41 -> {42} [style=dashed]; + 40 -> {44} [style=dotted]; + 40 -> {41} [style=dashed]; + 41 -> {42}; 42 -> {43}; - 43 -> {44}; + 43 -> {44} [color=green]; subgraph cluster_17 { color=red 45 [label="Enter class LighterASTNode [1]" style="filled" fillcolor=red]; subgraph cluster_18 { color=blue - 46 [label="Enter property [2]" style="filled" fillcolor=red]; - 47 [label="Access variable R|/_children| [2]"]; - 48 [label="Exit property [2]" style="filled" fillcolor=red]; + 46 [label="Enter function [2]" style="filled" fillcolor=red]; + 47 [label="Enter default value of _children [2]"]; + subgraph cluster_19 { + color=blue + 48 [label="Enter default value of _children [3]" style="filled" fillcolor=red]; + 49 [label="Function call: R|kotlin/collections/emptyList|() [3]" style="filled" fillcolor=yellow]; + 50 [label="Exit default value of _children [3]" style="filled" fillcolor=red]; + } + 51 [label="Exit default value of _children [2]"]; + 52 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 53 [label="Exit function [2]" style="filled" fillcolor=red]; } - subgraph cluster_19 { + subgraph cluster_20 { color=blue - 49 [label="Enter property [2]" style="filled" fillcolor=red]; - 50 [label="Access qualifier /TokenType [2]"]; - 51 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [2]"]; - 52 [label="Exit property [2]" style="filled" fillcolor=red]; + 54 [label="Enter property [2]" style="filled" fillcolor=red]; + 55 [label="Access variable R|/_children| [2]"]; + 56 [label="Exit property [2]" style="filled" fillcolor=red]; } - 53 [label="Exit class LighterASTNode [1]" style="filled" fillcolor=red]; - } - subgraph cluster_20 { - color=blue - 54 [label="Enter function getChildren [2]" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 55 [label="Enter block [2]"]; - 56 [label="Access variable R|/LighterASTNode._children| [2]"]; - 57 [label="Jump: ^getChildren this@R|/LighterASTNode|.R|/LighterASTNode._children| [2]"]; - 58 [label="Stub [2]" style="filled" fillcolor=gray]; - 59 [label="Exit block [2]" style="filled" fillcolor=gray]; + 57 [label="Enter property [2]" style="filled" fillcolor=red]; + 58 [label="Access qualifier /TokenType [2]"]; + 59 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [2]"]; + 60 [label="Exit property [2]" style="filled" fillcolor=red]; } - 60 [label="Exit function getChildren [2]" style="filled" fillcolor=red]; + 61 [label="Exit class LighterASTNode [1]" style="filled" fillcolor=red]; } subgraph cluster_22 { color=blue - 61 [label="Enter function [2]" style="filled" fillcolor=red]; - 62 [label="Enter default value of _children [2]"]; + 62 [label="Enter function getChildren [2]" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 63 [label="Enter default value of _children [3]" style="filled" fillcolor=red]; - 64 [label="Function call: R|kotlin/collections/emptyList|() [3]" style="filled" fillcolor=yellow]; - 65 [label="Exit default value of _children [3]" style="filled" fillcolor=red]; + 63 [label="Enter block [2]"]; + 64 [label="Access variable R|/LighterASTNode._children| [2]"]; + 65 [label="Jump: ^getChildren this@R|/LighterASTNode|.R|/LighterASTNode._children| [2]"]; + 66 [label="Stub [2]" style="filled" fillcolor=gray]; + 67 [label="Exit block [2]" style="filled" fillcolor=gray]; } - 66 [label="Exit default value of _children [2]"]; - 67 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 68 [label="Exit function [2]" style="filled" fillcolor=red]; + 68 [label="Exit function getChildren [2]" style="filled" fillcolor=red]; } 45 -> {46} [color=green]; - 45 -> {53} [style=dotted]; - 45 -> {46 49} [style=dashed]; + 45 -> {61} [style=dotted]; + 45 -> {46 54 57} [style=dashed]; 46 -> {47}; - 47 -> {48}; - 48 -> {49} [color=green]; + 47 -> {48 51}; + 47 -> {48} [style=dashed]; + 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; - 52 -> {53} [color=green]; - 53 -> {54 61} [color=green]; - 53 -> {54 61} [style=dashed]; + 52 -> {53}; + 53 -> {54} [color=green]; 54 -> {55}; 55 -> {56}; - 56 -> {57}; - 57 -> {60}; - 57 -> {58} [style=dotted]; - 58 -> {59} [style=dotted]; - 59 -> {60} [style=dotted]; - 61 -> {62}; - 62 -> {63 66}; - 62 -> {63} [style=dashed]; + 56 -> {57} [color=green]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61} [color=green]; + 61 -> {62} [color=green]; + 61 -> {62} [style=dashed]; + 62 -> {63}; 63 -> {64}; 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; + 65 -> {68}; + 65 -> {66} [style=dotted]; + 66 -> {67} [style=dotted]; + 67 -> {68} [style=dotted]; subgraph cluster_24 { color=red 69 [label="Enter class TokenType [1]" style="filled" fillcolor=red]; - 70 [label="Exit class TokenType [1]" style="filled" fillcolor=red]; - } - subgraph cluster_25 { - color=blue - 71 [label="Enter class Companion [2]" style="filled" fillcolor=red]; - subgraph cluster_26 { + subgraph cluster_25 { color=blue - 72 [label="Enter property [3]" style="filled" fillcolor=red]; - 73 [label="Function call: R|/TokenType.TokenType|() [3]" style="filled" fillcolor=yellow]; - 74 [label="Exit property [3]" style="filled" fillcolor=red]; + 70 [label="Enter function [2]" style="filled" fillcolor=red]; + 71 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 72 [label="Exit function [2]" style="filled" fillcolor=red]; } - 75 [label="Exit class Companion [2]" style="filled" fillcolor=red]; + 73 [label="Exit class TokenType [1]" style="filled" fillcolor=red]; } - subgraph cluster_27 { + subgraph cluster_26 { color=blue - 76 [label="Enter function [3]" style="filled" fillcolor=red]; - 77 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; - 78 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_28 { - color=blue - 79 [label="Enter function [2]" style="filled" fillcolor=red]; - 80 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 81 [label="Exit function [2]" style="filled" fillcolor=red]; + 74 [label="Enter class Companion [2]" style="filled" fillcolor=red]; + subgraph cluster_27 { + color=blue + 75 [label="Enter function [3]" style="filled" fillcolor=red]; + 76 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; + 77 [label="Exit function [3]" style="filled" fillcolor=red]; + } + subgraph cluster_28 { + color=blue + 78 [label="Enter property [3]" style="filled" fillcolor=red]; + 79 [label="Function call: R|/TokenType.TokenType|() [3]" style="filled" fillcolor=yellow]; + 80 [label="Exit property [3]" style="filled" fillcolor=red]; + } + 81 [label="Exit class Companion [2]" style="filled" fillcolor=red]; } 69 -> {70} [color=green]; - 70 -> {71 79} [color=green]; - 70 -> {71 79} [style=dashed]; - 71 -> {72} [color=green]; - 71 -> {75} [style=dotted]; - 71 -> {72} [style=dashed]; - 72 -> {73}; - 73 -> {74}; + 69 -> {73} [style=dotted]; + 69 -> {70} [style=dashed]; + 70 -> {71}; + 71 -> {72}; + 72 -> {73} [color=green]; + 73 -> {74} [color=green]; + 73 -> {74} [style=dashed]; 74 -> {75} [color=green]; - 75 -> {76} [color=green]; - 75 -> {76} [style=dashed]; + 74 -> {81} [style=dotted]; + 74 -> {75 78} [style=dashed]; + 75 -> {76}; 76 -> {77}; - 77 -> {78}; + 77 -> {78} [color=green]; + 78 -> {79}; 79 -> {80}; - 80 -> {81}; + 80 -> {81} [color=green]; subgraph cluster_29 { color=red 82 [label="Enter class KtModifierKeywordToken [1]" style="filled" fillcolor=red]; - 83 [label="Exit class KtModifierKeywordToken [1]" style="filled" fillcolor=red]; - } - subgraph cluster_30 { - color=blue - 84 [label="Enter function [2]" style="filled" fillcolor=red]; - 85 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 86 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_30 { + color=blue + 83 [label="Enter function [2]" style="filled" fillcolor=red]; + 84 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 85 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 86 [label="Exit class KtModifierKeywordToken [1]" style="filled" fillcolor=red]; } 82 -> {83} [color=green]; - 83 -> {84} [color=green]; - 83 -> {84} [style=dashed]; + 82 -> {86} [style=dotted]; + 82 -> {83} [style=dashed]; + 83 -> {84}; 84 -> {85}; - 85 -> {86}; + 85 -> {86} [color=green]; subgraph cluster_31 { color=red 87 [label="Enter class KtModifierList [1]" style="filled" fillcolor=red]; - 88 [label="Exit class KtModifierList [1]" style="filled" fillcolor=red]; - } - subgraph cluster_32 { - color=blue - 89 [label="Enter function [2]" style="filled" fillcolor=red]; - 90 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 91 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 88 [label="Enter function [2]" style="filled" fillcolor=red]; + 89 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 90 [label="Exit function [2]" style="filled" fillcolor=red]; + } + 91 [label="Exit class KtModifierList [1]" style="filled" fillcolor=red]; } 87 -> {88} [color=green]; - 88 -> {89} [color=green]; - 88 -> {89} [style=dashed]; + 87 -> {91} [style=dotted]; + 87 -> {88} [style=dashed]; + 88 -> {89}; 89 -> {90}; - 90 -> {91}; + 90 -> {91} [color=green]; subgraph cluster_33 { color=red 92 [label="Enter class KtModifierListOwner [1]" style="filled" fillcolor=red]; subgraph cluster_34 { color=blue - 93 [label="Enter property [2]" style="filled" fillcolor=red]; - 94 [label="Function call: R|/KtModifierList.KtModifierList|() [2]" style="filled" fillcolor=yellow]; - 95 [label="Exit property [2]" style="filled" fillcolor=red]; + 93 [label="Enter function [2]" style="filled" fillcolor=red]; + 94 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 95 [label="Exit function [2]" style="filled" fillcolor=red]; } - 96 [label="Exit class KtModifierListOwner [1]" style="filled" fillcolor=red]; - } - subgraph cluster_35 { - color=blue - 97 [label="Enter function [2]" style="filled" fillcolor=red]; - 98 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 99 [label="Exit function [2]" style="filled" fillcolor=red]; + subgraph cluster_35 { + color=blue + 96 [label="Enter property [2]" style="filled" fillcolor=red]; + 97 [label="Function call: R|/KtModifierList.KtModifierList|() [2]" style="filled" fillcolor=yellow]; + 98 [label="Exit property [2]" style="filled" fillcolor=red]; + } + 99 [label="Exit class KtModifierListOwner [1]" style="filled" fillcolor=red]; } 92 -> {93} [color=green]; - 92 -> {96} [style=dotted]; - 92 -> {93} [style=dashed]; + 92 -> {99} [style=dotted]; + 92 -> {93 96} [style=dashed]; 93 -> {94}; 94 -> {95}; 95 -> {96} [color=green]; - 96 -> {97} [color=green]; - 96 -> {97} [style=dashed]; + 96 -> {97}; 97 -> {98}; - 98 -> {99}; + 98 -> {99} [color=green]; subgraph cluster_36 { color=red 100 [label="Enter class FirModifier [1]" style="filled" fillcolor=red]; subgraph cluster_37 { color=blue - 101 [label="Enter property [2]" style="filled" fillcolor=red]; - 102 [label="Access variable R|/node| [2]"]; - 103 [label="Exit property [2]" style="filled" fillcolor=red]; + 101 [label="Enter function [2]" style="filled" fillcolor=red]; + 102 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 103 [label="Exit function [2]" style="filled" fillcolor=red]; } subgraph cluster_38 { color=blue 104 [label="Enter property [2]" style="filled" fillcolor=red]; - 105 [label="Access variable R|/token| [2]"]; + 105 [label="Access variable R|/node| [2]"]; 106 [label="Exit property [2]" style="filled" fillcolor=red]; } - 107 [label="Exit class FirModifier [1]" style="filled" fillcolor=red]; - } - subgraph cluster_39 { - color=blue - 108 [label="Enter class FirLightModifier [2]" style="filled" fillcolor=red]; - subgraph cluster_40 { + subgraph cluster_39 { color=blue - 109 [label="Enter property [3]" style="filled" fillcolor=red]; - 110 [label="Access variable R|/tree| [3]"]; - 111 [label="Exit property [3]" style="filled" fillcolor=red]; + 107 [label="Enter property [2]" style="filled" fillcolor=red]; + 108 [label="Access variable R|/token| [2]"]; + 109 [label="Exit property [2]" style="filled" fillcolor=red]; } - 112 [label="Exit class FirLightModifier [2]" style="filled" fillcolor=red]; + 110 [label="Exit class FirModifier [1]" style="filled" fillcolor=red]; } - subgraph cluster_41 { + subgraph cluster_40 { color=blue - 113 [label="Enter function [3]" style="filled" fillcolor=red]; - 114 [label="Access variable R|/node| [4]"]; - 115 [label="Access variable R|/token| [4]"]; - 116 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; - 117 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_42 { - color=blue - 118 [label="Enter class FirPsiModifier [2]" style="filled" fillcolor=red]; - 119 [label="Exit class FirPsiModifier [2]" style="filled" fillcolor=red]; + 111 [label="Enter class FirLightModifier [2]" style="filled" fillcolor=red]; + subgraph cluster_41 { + color=blue + 112 [label="Enter function [3]" style="filled" fillcolor=red]; + 113 [label="Access variable R|/node| [4]"]; + 114 [label="Access variable R|/token| [4]"]; + 115 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; + 116 [label="Exit function [3]" style="filled" fillcolor=red]; + } + subgraph cluster_42 { + color=blue + 117 [label="Enter property [3]" style="filled" fillcolor=red]; + 118 [label="Access variable R|/tree| [3]"]; + 119 [label="Exit property [3]" style="filled" fillcolor=red]; + } + 120 [label="Exit class FirLightModifier [2]" style="filled" fillcolor=red]; } subgraph cluster_43 { color=blue - 120 [label="Enter function [3]" style="filled" fillcolor=red]; - 121 [label="Access variable R|/node| [4]"]; - 122 [label="Access variable R|/token| [4]"]; - 123 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; - 124 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_44 { - color=blue - 125 [label="Enter function [2]" style="filled" fillcolor=red]; - 126 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 127 [label="Exit function [2]" style="filled" fillcolor=red]; + 121 [label="Enter class FirPsiModifier [2]" style="filled" fillcolor=red]; + subgraph cluster_44 { + color=blue + 122 [label="Enter function [3]" style="filled" fillcolor=red]; + 123 [label="Access variable R|/node| [4]"]; + 124 [label="Access variable R|/token| [4]"]; + 125 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; + 126 [label="Exit function [3]" style="filled" fillcolor=red]; + } + 127 [label="Exit class FirPsiModifier [2]" style="filled" fillcolor=red]; } 100 -> {101} [color=green]; - 100 -> {107} [style=dotted]; - 100 -> {101 104} [style=dashed]; + 100 -> {110} [style=dotted]; + 100 -> {101 104 107} [style=dashed]; 101 -> {102}; 102 -> {103}; 103 -> {104} [color=green]; 104 -> {105}; 105 -> {106}; 106 -> {107} [color=green]; - 107 -> {108 118 125} [color=green]; - 107 -> {108 118 125} [style=dashed]; - 108 -> {109} [color=green]; - 108 -> {112} [style=dotted]; - 108 -> {109} [style=dashed]; - 109 -> {110}; - 110 -> {111}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110} [color=green]; + 110 -> {111 121} [color=green]; + 110 -> {111 121} [style=dashed]; 111 -> {112} [color=green]; - 112 -> {113} [color=green]; - 112 -> {113} [style=dashed]; + 111 -> {120} [style=dotted]; + 111 -> {112 117} [style=dashed]; + 112 -> {113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; - 116 -> {117}; - 118 -> {119} [color=green]; + 116 -> {117} [color=green]; + 117 -> {118}; + 118 -> {119}; 119 -> {120} [color=green]; - 119 -> {120} [style=dashed]; - 120 -> {121}; - 121 -> {122}; + 121 -> {122} [color=green]; + 121 -> {127} [style=dotted]; + 121 -> {122} [style=dashed]; 122 -> {123}; 123 -> {124}; + 124 -> {125}; 125 -> {126}; - 126 -> {127}; + 126 -> {127} [color=green]; subgraph cluster_45 { color=red 128 [label="Enter class FirModifierList [1]" style="filled" fillcolor=red]; subgraph cluster_46 { color=blue - 129 [label="Enter property [2]" style="filled" fillcolor=red]; - 130 [label="Function call: R|kotlin/collections/emptyList||>() [2]" style="filled" fillcolor=yellow]; - 131 [label="Exit property [2]" style="filled" fillcolor=red]; + 129 [label="Enter function [2]" style="filled" fillcolor=red]; + 130 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; + 131 [label="Exit function [2]" style="filled" fillcolor=red]; } - 132 [label="Exit class FirModifierList [1]" style="filled" fillcolor=red]; - } - subgraph cluster_47 { - color=blue - 133 [label="Enter class Companion [2]" style="filled" fillcolor=red]; - 134 [label="Exit class Companion [2]" style="filled" fillcolor=red]; + subgraph cluster_47 { + color=blue + 132 [label="Enter property [2]" style="filled" fillcolor=red]; + 133 [label="Function call: R|kotlin/collections/emptyList||>() [2]" style="filled" fillcolor=yellow]; + 134 [label="Exit property [2]" style="filled" fillcolor=red]; + } + 135 [label="Exit class FirModifierList [1]" style="filled" fillcolor=red]; } subgraph cluster_48 { color=blue - 135 [label="Enter function boxImpl [3]" style="filled" fillcolor=red]; + 136 [label="Enter class Companion [2]" style="filled" fillcolor=red]; subgraph cluster_49 { color=blue - 136 [label="Enter block [3]"]; - 137 [label="Function call: R|/LighterASTNode.LighterASTNode|() [6]" style="filled" fillcolor=yellow]; - 138 [label="Function call: R|kotlin/collections/listOf|(...) [5]" style="filled" fillcolor=yellow]; - 139 [label="Function call: R|/LighterASTNode.LighterASTNode|(...) [4]" style="filled" fillcolor=yellow]; - 140 [label="Function call: R|/FlyweightCapableTreeStructure.FlyweightCapableTreeStructure|() [4]" style="filled" fillcolor=yellow]; - 141 [label="Function call: R|/FirLightSourceElement.FirLightSourceElement|(...) [3]" style="filled" fillcolor=yellow]; - 142 [label="Variable declaration: lval sourceElement: R|FirSourceElement?| [3]"]; - 143 [label="Access variable R|/sourceElement| [4]"]; - 144 [label="Function call: (this@R|/FirModifierList.Companion|, R|/sourceElement|).R|/FirModifierList.Companion.getModifierList|() [3]" style="filled" fillcolor=yellow]; - 145 [label="Variable declaration: lval result: R|FirModifierList?| [3]"]; - subgraph cluster_50 { + 137 [label="Enter function [3]" style="filled" fillcolor=red]; + 138 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; + 139 [label="Exit function [3]" style="filled" fillcolor=red]; + } + 140 [label="Exit class Companion [2]" style="filled" fillcolor=red]; + } + subgraph cluster_50 { + color=blue + 141 [label="Enter function boxImpl [3]" style="filled" fillcolor=red]; + subgraph cluster_51 { + color=blue + 142 [label="Enter block [3]"]; + 143 [label="Function call: R|/LighterASTNode.LighterASTNode|() [6]" style="filled" fillcolor=yellow]; + 144 [label="Function call: R|kotlin/collections/listOf|(...) [5]" style="filled" fillcolor=yellow]; + 145 [label="Function call: R|/LighterASTNode.LighterASTNode|(...) [4]" style="filled" fillcolor=yellow]; + 146 [label="Function call: R|/FlyweightCapableTreeStructure.FlyweightCapableTreeStructure|() [4]" style="filled" fillcolor=yellow]; + 147 [label="Function call: R|/FirLightSourceElement.FirLightSourceElement|(...) [3]" style="filled" fillcolor=yellow]; + 148 [label="Variable declaration: lval sourceElement: R|FirSourceElement?| [3]"]; + 149 [label="Access variable R|/sourceElement| [4]"]; + 150 [label="Function call: (this@R|/FirModifierList.Companion|, R|/sourceElement|).R|/FirModifierList.Companion.getModifierList|() [3]" style="filled" fillcolor=yellow]; + 151 [label="Variable declaration: lval result: R|FirModifierList?| [3]"]; + subgraph cluster_52 { color=blue - 146 [label="Enter when [3]"]; - subgraph cluster_51 { - color=blue - 147 [label="Enter when branch condition [4]"]; - 148 [label="Access variable R|/result| [5]"]; - 149 [label="Type operator: (R|/result| is R|FirModifierList.FirLightModifierList|) [5]"]; - 150 [label="Exit when branch condition [4]"]; - } - subgraph cluster_52 { - color=blue - 151 [label="Enter when branch condition else [5]"]; - 152 [label="Exit when branch condition [5]"]; - } - 153 [label="Enter when branch result [6]"]; + 152 [label="Enter when [3]"]; subgraph cluster_53 { color=blue - 154 [label="Enter block [6]"]; - 155 [label="Const: String(Fail) [6]"]; - 156 [label="Exit block [6]"]; + 153 [label="Enter when branch condition [4]"]; + 154 [label="Access variable R|/result| [5]"]; + 155 [label="Type operator: (R|/result| is R|FirModifierList.FirLightModifierList|) [5]"]; + 156 [label="Exit when branch condition [4]"]; } - 157 [label="Exit when branch result [5]"]; - 158 [label="Enter when branch result [5]"]; subgraph cluster_54 { color=blue - 159 [label="Enter block [5]"]; - 160 [label="Const: String(OK) [5]"]; - 161 [label="Exit block [5]"]; + 157 [label="Enter when branch condition else [5]"]; + 158 [label="Exit when branch condition [5]"]; } - 162 [label="Exit when branch result [4]"]; - 163 [label="Exit when [3]"]; + 159 [label="Enter when branch result [6]"]; + subgraph cluster_55 { + color=blue + 160 [label="Enter block [6]"]; + 161 [label="Const: String(Fail) [6]"]; + 162 [label="Exit block [6]"]; + } + 163 [label="Exit when branch result [5]"]; + 164 [label="Enter when branch result [5]"]; + subgraph cluster_56 { + color=blue + 165 [label="Enter block [5]"]; + 166 [label="Const: String(OK) [5]"]; + 167 [label="Exit block [5]"]; + } + 168 [label="Exit when branch result [4]"]; + 169 [label="Exit when [3]"]; } - 164 [label="Jump: ^boxImpl when () { + 170 [label="Jump: ^boxImpl when () { (R|/result| is R|FirModifierList.FirLightModifierList|) -> { String(OK) } @@ -494,125 +513,125 @@ digraph kt44814_kt { } } [3]"]; - 165 [label="Stub [3]" style="filled" fillcolor=gray]; - 166 [label="Exit block [3]" style="filled" fillcolor=gray]; + 171 [label="Stub [3]" style="filled" fillcolor=gray]; + 172 [label="Exit block [3]" style="filled" fillcolor=gray]; } - 167 [label="Exit function boxImpl [3]" style="filled" fillcolor=red]; + 173 [label="Exit function boxImpl [3]" style="filled" fillcolor=red]; } - subgraph cluster_55 { + subgraph cluster_57 { color=blue - 168 [label="Enter function getModifierList [3]" style="filled" fillcolor=red]; - subgraph cluster_56 { + 174 [label="Enter function getModifierList [3]" style="filled" fillcolor=red]; + subgraph cluster_58 { color=blue - 169 [label="Enter block [3]"]; - subgraph cluster_57 { + 175 [label="Enter block [3]"]; + subgraph cluster_59 { color=blue - 170 [label="Enter when [3]"]; - 171 [label="Access variable this@R|/FirModifierList.Companion.getModifierList| [4]"]; - subgraph cluster_58 { - color=blue - 172 [label="Enter when branch condition [4]"]; - 173 [label="Exit $subj [5]"]; - 174 [label="Const: Null(null) [5]"]; - 175 [label="Equality operator == [5]"]; - 176 [label="Exit when branch condition [4]"]; - } - subgraph cluster_59 { - color=blue - 177 [label="Enter when branch condition [5]"]; - 178 [label="Exit $subj [6]"]; - 179 [label="Type operator: ($subj$ is R|FirPsiSourceElement|) [6]"]; - 180 [label="Exit when branch condition [5]"]; - } + 176 [label="Enter when [3]"]; + 177 [label="Access variable this@R|/FirModifierList.Companion.getModifierList| [4]"]; subgraph cluster_60 { color=blue - 181 [label="Enter when branch condition [6]"]; - 182 [label="Exit $subj [7]"]; - 183 [label="Type operator: ($subj$ is R|FirLightSourceElement|) [7]"]; - 184 [label="Exit when branch condition [6]"]; + 178 [label="Enter when branch condition [4]"]; + 179 [label="Exit $subj [5]"]; + 180 [label="Const: Null(null) [5]"]; + 181 [label="Equality operator == [5]"]; + 182 [label="Exit when branch condition [4]"]; } - 185 [label="Enter when branch result [7]"]; subgraph cluster_61 { color=blue - 186 [label="Enter block [7]"]; - 187 [label="Access variable R|/FirLightSourceElement.lighterASTNode| [9]"]; - 188 [label="Access variable R|/FirLightSourceElement.treeStructure| [9]"]; - 189 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...) [8]" style="filled" fillcolor=yellow]; - 190 [label="Postponed enter to lambda [8]"]; - subgraph cluster_62 { - color=blue - 191 [label="Enter function anonymousFunction [9]" style="filled" fillcolor=red]; - subgraph cluster_63 { - color=blue - 192 [label="Enter block [9]"]; - 193 [label="Access variable R|/it| [9]"]; - 194 [label="Enter safe call [9]"]; - 195 [label="Access variable R|/LighterASTNode.tokenType| [9]"]; - 196 [label="Exit safe call [9]"]; - 197 [label="Access qualifier /TokenType [9]"]; - 198 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [9]"]; - 199 [label="Equality operator == [9]"]; - 200 [label="Exit block [9]"]; - } - 201 [label="Exit function anonymousFunction [9]" style="filled" fillcolor=red]; - } - 202 [label="Postponed exit from lambda [8]"]; - 203 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...).R|kotlin/collections/find|(...) [7]" style="filled" fillcolor=yellow]; - 204 [label="Exit lhs of ?: [7]"]; - 205 [label="Enter rhs of ?: [7]"]; - 206 [label="Const: Null(null) [7]"]; - 207 [label="Jump: ^getModifierList Null(null) [7]"]; - 208 [label="Stub [7]" style="filled" fillcolor=gray]; - 209 [label="Lhs of ?: is not null [7]"]; - 210 [label="Exit ?: [7]"]; - 211 [label="Variable declaration: lval modifierListNode: R|LighterASTNode| [7]"]; - 212 [label="Access variable R|/modifierListNode| [8]"]; - 213 [label="Access variable R|/FirLightSourceElement.treeStructure| [8]"]; - 214 [label="Function call: R|/FirModifierList.FirLightModifierList.FirLightModifierList|(...) [7]" style="filled" fillcolor=yellow]; - 215 [label="Exit block [7]"]; + 183 [label="Enter when branch condition [5]"]; + 184 [label="Exit $subj [6]"]; + 185 [label="Type operator: ($subj$ is R|FirPsiSourceElement|) [6]"]; + 186 [label="Exit when branch condition [5]"]; } - 216 [label="Exit when branch result [6]"]; - 217 [label="Enter when branch result [6]"]; - subgraph cluster_64 { + subgraph cluster_62 { color=blue - 218 [label="Enter block [6]"]; - 219 [label="Access variable R|/FirPsiSourceElement.psi| [6]"]; - 220 [label="Type operator: (this@R|/FirModifierList.Companion.getModifierList|.R|/FirPsiSourceElement.psi| as? R|KtModifierListOwner|) [6]"]; - 221 [label="Enter safe call [6]"]; - 222 [label="Access variable R|/KtModifierListOwner.modifierList| [6]"]; - 223 [label="Enter safe call [6]"]; - 224 [label="Postponed enter to lambda [7]"]; - subgraph cluster_65 { - color=blue - 225 [label="Enter function anonymousFunction [8]" style="filled" fillcolor=red]; - subgraph cluster_66 { - color=blue - 226 [label="Enter block [8]"]; - 227 [label="Access variable R|/it| [9]"]; - 228 [label="Function call: R|/FirModifierList.FirPsiModifierList.FirPsiModifierList|(...) [8]" style="filled" fillcolor=yellow]; - 229 [label="Exit block [8]"]; - } - 230 [label="Exit function anonymousFunction [8]" style="filled" fillcolor=red]; - } - 231 [label="Postponed exit from lambda [7]"]; - 232 [label="Function call: $subj$.R|kotlin/let|(...) [6]" style="filled" fillcolor=yellow]; - 233 [label="Exit safe call [6]"]; - 234 [label="Exit safe call [6]"]; - 235 [label="Exit block [6]"]; + 187 [label="Enter when branch condition [6]"]; + 188 [label="Exit $subj [7]"]; + 189 [label="Type operator: ($subj$ is R|FirLightSourceElement|) [7]"]; + 190 [label="Exit when branch condition [6]"]; } - 236 [label="Exit when branch result [5]"]; - 237 [label="Merge postponed lambda exits [6]"]; - 238 [label="Enter when branch result [5]"]; - subgraph cluster_67 { + 191 [label="Enter when branch result [7]"]; + subgraph cluster_63 { color=blue - 239 [label="Enter block [5]"]; - 240 [label="Const: Null(null) [5]"]; - 241 [label="Exit block [5]"]; + 192 [label="Enter block [7]"]; + 193 [label="Access variable R|/FirLightSourceElement.lighterASTNode| [9]"]; + 194 [label="Access variable R|/FirLightSourceElement.treeStructure| [9]"]; + 195 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...) [8]" style="filled" fillcolor=yellow]; + 196 [label="Postponed enter to lambda [8]"]; + subgraph cluster_64 { + color=blue + 197 [label="Enter function anonymousFunction [9]" style="filled" fillcolor=red]; + subgraph cluster_65 { + color=blue + 198 [label="Enter block [9]"]; + 199 [label="Access variable R|/it| [9]"]; + 200 [label="Enter safe call [9]"]; + 201 [label="Access variable R|/LighterASTNode.tokenType| [9]"]; + 202 [label="Exit safe call [9]"]; + 203 [label="Access qualifier /TokenType [9]"]; + 204 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [9]"]; + 205 [label="Equality operator == [9]"]; + 206 [label="Exit block [9]"]; + } + 207 [label="Exit function anonymousFunction [9]" style="filled" fillcolor=red]; + } + 208 [label="Postponed exit from lambda [8]"]; + 209 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...).R|kotlin/collections/find|(...) [7]" style="filled" fillcolor=yellow]; + 210 [label="Exit lhs of ?: [7]"]; + 211 [label="Enter rhs of ?: [7]"]; + 212 [label="Const: Null(null) [7]"]; + 213 [label="Jump: ^getModifierList Null(null) [7]"]; + 214 [label="Stub [7]" style="filled" fillcolor=gray]; + 215 [label="Lhs of ?: is not null [7]"]; + 216 [label="Exit ?: [7]"]; + 217 [label="Variable declaration: lval modifierListNode: R|LighterASTNode| [7]"]; + 218 [label="Access variable R|/modifierListNode| [8]"]; + 219 [label="Access variable R|/FirLightSourceElement.treeStructure| [8]"]; + 220 [label="Function call: R|/FirModifierList.FirLightModifierList.FirLightModifierList|(...) [7]" style="filled" fillcolor=yellow]; + 221 [label="Exit block [7]"]; } - 242 [label="Exit when branch result [4]"]; - 243 [label="Exit when [3]"]; + 222 [label="Exit when branch result [6]"]; + 223 [label="Enter when branch result [6]"]; + subgraph cluster_66 { + color=blue + 224 [label="Enter block [6]"]; + 225 [label="Access variable R|/FirPsiSourceElement.psi| [6]"]; + 226 [label="Type operator: (this@R|/FirModifierList.Companion.getModifierList|.R|/FirPsiSourceElement.psi| as? R|KtModifierListOwner|) [6]"]; + 227 [label="Enter safe call [6]"]; + 228 [label="Access variable R|/KtModifierListOwner.modifierList| [6]"]; + 229 [label="Enter safe call [6]"]; + 230 [label="Postponed enter to lambda [7]"]; + subgraph cluster_67 { + color=blue + 231 [label="Enter function anonymousFunction [8]" style="filled" fillcolor=red]; + subgraph cluster_68 { + color=blue + 232 [label="Enter block [8]"]; + 233 [label="Access variable R|/it| [9]"]; + 234 [label="Function call: R|/FirModifierList.FirPsiModifierList.FirPsiModifierList|(...) [8]" style="filled" fillcolor=yellow]; + 235 [label="Exit block [8]"]; + } + 236 [label="Exit function anonymousFunction [8]" style="filled" fillcolor=red]; + } + 237 [label="Postponed exit from lambda [7]"]; + 238 [label="Function call: $subj$.R|kotlin/let|(...) [6]" style="filled" fillcolor=yellow]; + 239 [label="Exit safe call [6]"]; + 240 [label="Exit safe call [6]"]; + 241 [label="Exit block [6]"]; + } + 242 [label="Exit when branch result [5]"]; + 243 [label="Merge postponed lambda exits [6]"]; + 244 [label="Enter when branch result [5]"]; + subgraph cluster_69 { + color=blue + 245 [label="Enter block [5]"]; + 246 [label="Const: Null(null) [5]"]; + 247 [label="Exit block [5]"]; + } + 248 [label="Exit when branch result [4]"]; + 249 [label="Exit when [3]"]; } - 244 [label="Jump: ^getModifierList when (this@R|/FirModifierList.Companion.getModifierList|) { + 250 [label="Jump: ^getModifierList when (this@R|/FirModifierList.Companion.getModifierList|) { ==($subj$, Null(null)) -> { Null(null) } @@ -631,80 +650,70 @@ digraph kt44814_kt { } } [3]"]; - 245 [label="Stub [3]" style="filled" fillcolor=gray]; - 246 [label="Exit block [3]" style="filled" fillcolor=gray]; + 251 [label="Stub [3]" style="filled" fillcolor=gray]; + 252 [label="Exit block [3]" style="filled" fillcolor=gray]; } - 247 [label="Exit function getModifierList [3]" style="filled" fillcolor=red]; + 253 [label="Exit function getModifierList [3]" style="filled" fillcolor=red]; } - subgraph cluster_68 { + subgraph cluster_70 { color=blue - 248 [label="Enter function [3]" style="filled" fillcolor=red]; - 249 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; - 250 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_69 { - color=blue - 251 [label="Enter class FirLightModifierList [2]" style="filled" fillcolor=red]; - subgraph cluster_70 { - color=blue - 252 [label="Enter property [3]" style="filled" fillcolor=red]; - 253 [label="Access variable R|/modifierList| [3]"]; - 254 [label="Exit property [3]" style="filled" fillcolor=red]; - } + 254 [label="Enter class FirLightModifierList [2]" style="filled" fillcolor=red]; subgraph cluster_71 { color=blue - 255 [label="Enter property [3]" style="filled" fillcolor=red]; - 256 [label="Access variable R|/tree| [3]"]; - 257 [label="Exit property [3]" style="filled" fillcolor=red]; + 255 [label="Enter function [3]" style="filled" fillcolor=red]; + 256 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; + 257 [label="Exit function [3]" style="filled" fillcolor=red]; } - 258 [label="Exit class FirLightModifierList [2]" style="filled" fillcolor=red]; - } - subgraph cluster_72 { - color=blue - 259 [label="Enter function [3]" style="filled" fillcolor=red]; - 260 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; - 261 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_73 { - color=blue - 262 [label="Enter class FirPsiModifierList [2]" style="filled" fillcolor=red]; - subgraph cluster_74 { + subgraph cluster_72 { color=blue - 263 [label="Enter property [3]" style="filled" fillcolor=red]; - 264 [label="Access variable R|/modifierList| [3]"]; - 265 [label="Exit property [3]" style="filled" fillcolor=red]; + 258 [label="Enter property [3]" style="filled" fillcolor=red]; + 259 [label="Access variable R|/modifierList| [3]"]; + 260 [label="Exit property [3]" style="filled" fillcolor=red]; } - 266 [label="Exit class FirPsiModifierList [2]" style="filled" fillcolor=red]; + subgraph cluster_73 { + color=blue + 261 [label="Enter property [3]" style="filled" fillcolor=red]; + 262 [label="Access variable R|/tree| [3]"]; + 263 [label="Exit property [3]" style="filled" fillcolor=red]; + } + 264 [label="Exit class FirLightModifierList [2]" style="filled" fillcolor=red]; } - subgraph cluster_75 { + subgraph cluster_74 { color=blue - 267 [label="Enter function [3]" style="filled" fillcolor=red]; - 268 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; - 269 [label="Exit function [3]" style="filled" fillcolor=red]; - } - subgraph cluster_76 { - color=blue - 270 [label="Enter function [2]" style="filled" fillcolor=red]; - 271 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; - 272 [label="Exit function [2]" style="filled" fillcolor=red]; + 265 [label="Enter class FirPsiModifierList [2]" style="filled" fillcolor=red]; + subgraph cluster_75 { + color=blue + 266 [label="Enter function [3]" style="filled" fillcolor=red]; + 267 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; + 268 [label="Exit function [3]" style="filled" fillcolor=red]; + } + subgraph cluster_76 { + color=blue + 269 [label="Enter property [3]" style="filled" fillcolor=red]; + 270 [label="Access variable R|/modifierList| [3]"]; + 271 [label="Exit property [3]" style="filled" fillcolor=red]; + } + 272 [label="Exit class FirPsiModifierList [2]" style="filled" fillcolor=red]; } 128 -> {129} [color=green]; - 128 -> {132} [style=dotted]; - 128 -> {129} [style=dashed]; + 128 -> {135} [style=dotted]; + 128 -> {129 132} [style=dashed]; 129 -> {130}; 130 -> {131}; 131 -> {132} [color=green]; - 132 -> {133 251 262 270} [color=green]; - 132 -> {133 251 262 270} [style=dashed]; - 133 -> {134} [color=green]; - 134 -> {135 168 248} [color=green]; - 134 -> {135 168 248} [style=dashed]; - 135 -> {136}; - 136 -> {137}; + 132 -> {133}; + 133 -> {134}; + 134 -> {135} [color=green]; + 135 -> {136 254 265} [color=green]; + 135 -> {136 254 265} [style=dashed]; + 136 -> {137} [color=green]; + 136 -> {140} [style=dotted]; + 136 -> {137} [style=dashed]; 137 -> {138}; 138 -> {139}; - 139 -> {140}; - 140 -> {141}; + 139 -> {140} [color=green]; + 140 -> {141 174} [color=green]; + 140 -> {141 174} [style=dashed]; 141 -> {142}; 142 -> {143}; 143 -> {144}; @@ -714,137 +723,137 @@ digraph kt44814_kt { 147 -> {148}; 148 -> {149}; 149 -> {150}; - 150 -> {151 158}; + 150 -> {151}; 151 -> {152}; 152 -> {153}; 153 -> {154}; 154 -> {155}; 155 -> {156}; - 156 -> {157}; - 157 -> {163}; + 156 -> {157 164}; + 157 -> {158}; 158 -> {159}; 159 -> {160}; 160 -> {161}; 161 -> {162}; 162 -> {163}; - 163 -> {164}; - 164 -> {167}; - 164 -> {165} [style=dotted]; - 165 -> {166} [style=dotted]; - 166 -> {167} [style=dotted]; + 163 -> {169}; + 164 -> {165}; + 165 -> {166}; + 166 -> {167}; + 167 -> {168}; 168 -> {169}; 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {173}; - 173 -> {174}; + 170 -> {173}; + 170 -> {171} [style=dotted]; + 171 -> {172} [style=dotted]; + 172 -> {173} [style=dotted]; 174 -> {175}; 175 -> {176}; - 176 -> {177 238}; + 176 -> {177}; 177 -> {178}; 178 -> {179}; 179 -> {180}; - 180 -> {181 217}; + 180 -> {181}; 181 -> {182}; - 182 -> {183}; + 182 -> {183 244}; 183 -> {184}; 184 -> {185}; 185 -> {186}; - 186 -> {187}; + 186 -> {187 223}; 187 -> {188}; 188 -> {189}; 189 -> {190}; - 190 -> {191 202 203}; - 190 -> {191} [style=dashed]; + 190 -> {191}; 191 -> {192}; 192 -> {193}; - 193 -> {194 196}; + 193 -> {194}; 194 -> {195}; 195 -> {196}; - 196 -> {197}; + 196 -> {197 208 209}; + 196 -> {197} [style=dashed]; 197 -> {198}; 198 -> {199}; - 199 -> {200}; + 199 -> {200 202}; 200 -> {201}; 201 -> {202}; 202 -> {203}; - 202 -> {190} [color=green style=dashed]; 203 -> {204}; - 204 -> {205 209}; + 204 -> {205}; 205 -> {206}; 206 -> {207}; - 207 -> {247}; - 207 -> {208} [style=dotted]; - 208 -> {210} [style=dotted]; + 207 -> {208}; + 208 -> {209}; + 208 -> {196} [color=green style=dashed]; 209 -> {210}; - 210 -> {211}; + 210 -> {211 215}; 211 -> {212}; 212 -> {213}; - 213 -> {214}; - 214 -> {215}; + 213 -> {253}; + 213 -> {214} [style=dotted]; + 214 -> {216} [style=dotted]; 215 -> {216}; - 216 -> {243}; + 216 -> {217}; 217 -> {218}; 218 -> {219}; 219 -> {220}; - 220 -> {221 233}; + 220 -> {221}; 221 -> {222}; - 222 -> {223 233}; + 222 -> {249}; 223 -> {224}; - 224 -> {225 232}; - 224 -> {231} [style=dotted]; - 224 -> {225} [style=dashed]; + 224 -> {225}; 225 -> {226}; - 226 -> {227}; + 226 -> {227 239}; 227 -> {228}; - 228 -> {229}; + 228 -> {229 239}; 229 -> {230}; - 230 -> {231}; - 231 -> {232} [color=green]; - 231 -> {237} [color=red]; - 232 -> {234}; + 230 -> {231 238}; + 230 -> {237} [style=dotted]; + 230 -> {231} [style=dashed]; + 231 -> {232}; + 232 -> {233}; 233 -> {234}; - 234 -> {235 237}; + 234 -> {235}; 235 -> {236}; - 236 -> {243}; + 236 -> {237}; + 237 -> {238} [color=green]; 237 -> {243} [color=red]; - 238 -> {239}; + 238 -> {240}; 239 -> {240}; - 240 -> {241}; + 240 -> {241 243}; 241 -> {242}; - 242 -> {243}; - 243 -> {244}; - 244 -> {247}; - 244 -> {245} [style=dotted]; - 245 -> {246} [style=dotted]; - 246 -> {247} [style=dotted]; + 242 -> {249}; + 243 -> {249} [color=red]; + 244 -> {245}; + 245 -> {246}; + 246 -> {247}; + 247 -> {248}; 248 -> {249}; 249 -> {250}; - 251 -> {252} [color=green]; - 251 -> {258} [style=dotted]; - 251 -> {252 255} [style=dashed]; - 252 -> {253}; - 253 -> {254}; + 250 -> {253}; + 250 -> {251} [style=dotted]; + 251 -> {252} [style=dotted]; + 252 -> {253} [style=dotted]; 254 -> {255} [color=green]; + 254 -> {264} [style=dotted]; + 254 -> {255 258 261} [style=dashed]; 255 -> {256}; 256 -> {257}; 257 -> {258} [color=green]; - 258 -> {259} [color=green]; - 258 -> {259} [style=dashed]; + 258 -> {259}; 259 -> {260}; - 260 -> {261}; - 262 -> {263} [color=green]; - 262 -> {266} [style=dotted]; - 262 -> {263} [style=dashed]; - 263 -> {264}; - 264 -> {265}; + 260 -> {261} [color=green]; + 261 -> {262}; + 262 -> {263}; + 263 -> {264} [color=green]; 265 -> {266} [color=green]; - 266 -> {267} [color=green]; - 266 -> {267} [style=dashed]; + 265 -> {272} [style=dotted]; + 265 -> {266 269} [style=dashed]; + 266 -> {267}; 267 -> {268}; - 268 -> {269}; + 268 -> {269} [color=green]; + 269 -> {270}; 270 -> {271}; - 271 -> {272}; + 271 -> {272} [color=green]; subgraph cluster_77 { color=red diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.fir.kt deleted file mode 100644 index c7e460d1228..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun testObject() { - object : Foo(todo()) { - fun foo() = 1 - } -} - -fun testObjectExpression() { - val a = object : Foo(todo()) { - fun foo() = 1 - } -} - -fun testObjectExpression1() { - fun bar(i: Int, x: Any) {} - - bar(1, object : Foo(todo()) { - fun foo() = 1 - }) -} - -fun testClassDeclaration() { - class C : Foo(todo()) {} - - bar() -} - -fun testFunctionDefaultArgument() { - fun foo(x: Int = todo()) { bar() } -} - -open class Foo(i: Int) {} - -fun todo(): Nothing = throw Exception() -fun bar() {} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.kt index 81a3ac5df54..0636ce00edf 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLocalDeclarations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun testObject() {