diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot index e25617f64db..704fe6d4b4f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot @@ -5,19 +5,19 @@ digraph annotatedLocalClass_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class Ann" style="filled" fillcolor=red]; + 1 [label="Exit class Ann" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter class Ann" style="filled" fillcolor=red]; - 4 [label="Exit class Ann" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } - 3 -> {4} [color=green]; + 2 -> {3}; + 3 -> {4}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot index cc38073fd76..5c67c177bdf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot @@ -5,17 +5,17 @@ digraph complex_kt { subgraph cluster_0 { color=red - 0 [label="Enter function close" style="filled" fillcolor=red]; - 1 [label="Exit function close" style="filled" fillcolor=red]; + 0 [label="Enter class AutoCloseable" style="filled" fillcolor=red]; + 1 [label="Exit class AutoCloseable" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class AutoCloseable" style="filled" fillcolor=red]; - 3 [label="Exit class AutoCloseable" style="filled" fillcolor=red]; + 2 [label="Enter function close" style="filled" fillcolor=red]; + 3 [label="Exit function close" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { 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 d19679b4341..93036524e26 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot @@ -5,81 +5,81 @@ digraph initBlock_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - - subgraph cluster_1 { - color=red - 9 [label="Enter class Foo" style="filled" fillcolor=red]; - subgraph cluster_2 { + 0 [label="Enter class Foo" style="filled" fillcolor=red]; + subgraph cluster_1 { color=blue - 3 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_3 { + 2 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_2 { color=blue - 4 [label="Enter block"]; - 5 [label="Const: Int(1)"]; - 6 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 7 [label="Exit block"]; + 3 [label="Enter block"]; + 4 [label="Const: Int(1)"]; + 5 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 6 [label="Exit block"]; } - 8 [label="Exit init block" style="filled" fillcolor=red]; + 7 [label="Exit init block" style="filled" fillcolor=red]; } - 10 [label="Exit class Foo" style="filled" fillcolor=red]; + 1 [label="Exit class Foo" style="filled" fillcolor=red]; } - 9 -> {3} [color=green]; + 0 -> {2} [color=green]; + 2 -> {3}; 3 -> {4}; 4 -> {5}; 5 -> {6}; 6 -> {7}; - 7 -> {8}; - 8 -> {10} [color=green]; + 7 -> {1} [color=green]; + + subgraph cluster_3 { + color=red + 8 [label="Enter function " style="filled" fillcolor=red]; + 9 [label="Delegated constructor call: super()"]; + 10 [label="Exit function " style="filled" fillcolor=red]; + } + 8 -> {9}; + 9 -> {10}; subgraph cluster_4 { color=red - 11 [label="Enter function " style="filled" fillcolor=red]; - 12 [label="Delegated constructor call: super()"]; - 13 [label="Exit function " style="filled" fillcolor=red]; - } - 11 -> {12}; - 12 -> {13}; - - subgraph cluster_5 { - color=red - 25 [label="Enter class Bar" style="filled" fillcolor=red]; - subgraph cluster_6 { + 11 [label="Enter class Bar" style="filled" fillcolor=red]; + subgraph cluster_5 { color=blue - 14 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_7 { + 13 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 15 [label="Enter block"]; - 16 [label="Const: Int(1)"]; - 17 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 18 [label="Function call: R|java/lang/Exception.Exception|()"]; - 19 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 20 [label="Stub" style="filled" fillcolor=gray]; - 21 [label="Const: Int(2)" style="filled" fillcolor=gray]; - 22 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray]; - 23 [label="Exit block" style="filled" fillcolor=gray]; + 14 [label="Enter block"]; + 15 [label="Const: Int(1)"]; + 16 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 17 [label="Function call: R|java/lang/Exception.Exception|()"]; + 18 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 19 [label="Stub" style="filled" fillcolor=gray]; + 20 [label="Const: Int(2)" style="filled" fillcolor=gray]; + 21 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray]; + 22 [label="Exit block" style="filled" fillcolor=gray]; } - 24 [label="Exit init block" style="filled" fillcolor=red]; + 23 [label="Exit init block" style="filled" fillcolor=red]; } - 26 [label="Exit class Bar" style="filled" fillcolor=red]; + 12 [label="Exit class Bar" style="filled" fillcolor=red]; } - 25 -> {14} [color=green]; + 11 -> {13} [color=green]; + 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {18}; - 18 -> {19}; - 19 -> {24}; + 18 -> {23}; + 18 -> {19} [style=dotted]; 19 -> {20} [style=dotted]; 20 -> {21} [style=dotted]; 21 -> {22} [style=dotted]; 22 -> {23} [style=dotted]; - 23 -> {24} [style=dotted]; - 24 -> {26} [color=green]; + 23 -> {12} [color=green]; + + subgraph cluster_7 { + color=red + 24 [label="Enter function " style="filled" fillcolor=red]; + 25 [label="Delegated constructor call: super()"]; + 26 [label="Exit function " style="filled" fillcolor=red]; + } + 24 -> {25}; + 25 -> {26}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot index 61de6cb5954..cae6522cc40 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot @@ -12,86 +12,86 @@ digraph initBlockAndInPlaceLambda_kt { subgraph cluster_1 { color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; + 2 [label="Enter class A" style="filled" fillcolor=red]; + 3 [label="Exit class A" style="filled" fillcolor=red]; } - 2 -> {3}; + 2 -> {3} [color=green]; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red - 6 [label="Enter function " style="filled" fillcolor=red]; - 7 [label="Delegated constructor call: super()"]; - 8 [label="Exit function " style="filled" fillcolor=red]; - } - 6 -> {7}; - 7 -> {8}; - - subgraph cluster_4 { - color=red - 29 [label="Enter class C" style="filled" fillcolor=red]; - subgraph cluster_5 { + 6 [label="Enter class C" style="filled" fillcolor=red]; + subgraph cluster_4 { color=blue - 16 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_6 { + 8 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_5 { color=blue - 17 [label="Enter block"]; - 18 [label="Access variable R|/a|"]; - 19 [label="Access variable R|/A.b|"]; - 20 [label="Enter safe call"]; - 21 [label="Postponed enter to lambda"]; - subgraph cluster_7 { + 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 - 9 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_8 { + 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_7 { color=blue - 10 [label="Enter block"]; - 11 [label="Access variable R|/a|"]; - 12 [label="Access variable R|/it|"]; - 13 [label="Function call: R|/C.C|(...)"]; - 14 [label="Exit block"]; + 22 [label="Enter block"]; + 23 [label="Access variable R|/a|"]; + 24 [label="Access variable R|/it|"]; + 25 [label="Function call: R|/C.C|(...)"]; + 26 [label="Exit block"]; } - 15 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 27 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 22 [label="Call arguments union" style="filled" fillcolor=yellow]; - 23 [label="Postponed exit from lambda"]; - 24 [label="Function call: $subj$.R|kotlin/let|(...)"]; - 25 [label="Exit safe call"]; - 26 [label="Variable declaration: lval c: R|C?|"]; - 27 [label="Exit block"]; + 14 [label="Call arguments union" style="filled" fillcolor=yellow]; + 15 [label="Postponed exit from lambda"]; + 16 [label="Function call: $subj$.R|kotlin/let|(...)"]; + 17 [label="Exit safe call"]; + 18 [label="Variable declaration: lval c: R|C?|"]; + 19 [label="Exit block"]; } - 28 [label="Exit init block" style="filled" fillcolor=red]; + 20 [label="Exit init block" style="filled" fillcolor=red]; } - 30 [label="Exit class C" style="filled" fillcolor=red]; + 7 [label="Exit class C" style="filled" fillcolor=red]; } - 29 -> {16} [color=green]; + 6 -> {8} [color=green]; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12 17}; + 12 -> {13}; + 13 -> {21}; + 13 -> {15} [color=red]; + 14 -> {16} [color=red]; + 15 -> {16} [color=green]; 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20 25}; - 20 -> {21}; - 21 -> {9}; - 21 -> {23} [color=red]; - 22 -> {24} [color=red]; - 23 -> {24} [color=green]; + 19 -> {20}; + 20 -> {7} [color=green]; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28}; - 28 -> {30} [color=green]; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {23} [color=green]; - 15 -> {22} [color=red]; + 27 -> {15} [color=green]; + 27 -> {14} [color=red]; + + subgraph cluster_8 { + color=red + 28 [label="Enter function " style="filled" fillcolor=red]; + 29 [label="Delegated constructor call: super()"]; + 30 [label="Exit function " style="filled" fillcolor=red]; + } + 28 -> {29}; + 29 -> {30}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot index 61a9287632f..36ed09e0ffa 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot @@ -14,33 +14,33 @@ digraph innerClassInAnonymousObject_kt { subgraph cluster_1 { color=red - 3 [label="Enter function " style="filled" fillcolor=red]; - 4 [label="Delegated constructor call: super()"]; - 5 [label="Exit function " style="filled" fillcolor=red]; + 3 [label="Enter class Nested" style="filled" fillcolor=red]; + 4 [label="Exit class Nested" style="filled" fillcolor=red]; } - 3 -> {4}; - 4 -> {5}; + 3 -> {4} [color=green]; subgraph cluster_2 { color=red - 6 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 7 [label="Enter block"]; - 8 [label="Exit block"]; - } - 9 [label="Exit function foo" style="filled" fillcolor=red]; + 5 [label="Enter function " style="filled" fillcolor=red]; + 6 [label="Delegated constructor call: super()"]; + 7 [label="Exit function " style="filled" fillcolor=red]; } + 5 -> {6}; 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - subgraph cluster_4 { + subgraph cluster_3 { color=red - 10 [label="Enter class Nested" style="filled" fillcolor=red]; - 11 [label="Exit class Nested" style="filled" fillcolor=red]; + 8 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 9 [label="Enter block"]; + 10 [label="Exit block"]; + } + 11 [label="Exit function foo" style="filled" fillcolor=red]; } - 10 -> {11} [color=green]; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; subgraph cluster_5 { color=red @@ -61,7 +61,7 @@ digraph innerClassInAnonymousObject_kt { 18 [label="Exit property" style="filled" fillcolor=red]; } 16 -> {17}; - 16 -> {0 3 6} [color=red]; + 16 -> {0 5 8} [color=red]; 17 -> {18}; 12 -> {13} [color=green]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot index a93a01801ac..1819b901f0f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot @@ -33,19 +33,19 @@ digraph lambdaReturningObject_kt { subgraph cluster_4 { color=red - 8 [label="Enter function " style="filled" fillcolor=red]; - 9 [label="Delegated constructor call: super()"]; - 10 [label="Exit function " style="filled" fillcolor=red]; + 8 [label="Enter class IrStarProjectionImpl" style="filled" fillcolor=red]; + 9 [label="Exit class IrStarProjectionImpl" style="filled" fillcolor=red]; } - 8 -> {9}; - 9 -> {10}; + 8 -> {9} [color=green]; subgraph cluster_5 { color=red - 11 [label="Enter class IrStarProjectionImpl" style="filled" fillcolor=red]; - 12 [label="Exit class IrStarProjectionImpl" style="filled" fillcolor=red]; + 10 [label="Enter function " style="filled" fillcolor=red]; + 11 [label="Delegated constructor call: super()"]; + 12 [label="Exit function " style="filled" fillcolor=red]; } - 11 -> {12} [color=green]; + 10 -> {11}; + 11 -> {12}; subgraph cluster_6 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot index 3fbad3a172f..4bf19286af6 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot @@ -5,111 +5,111 @@ digraph postponedLambdaInConstructor_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter class A" style="filled" fillcolor=red]; - 4 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } - 3 -> {4} [color=green]; + 2 -> {3}; + 3 -> {4}; subgraph cluster_2 { color=red - 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Access variable R|/s|"]; - 7 [label="Postponed enter to lambda"]; + 5 [label="Enter class B" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 13 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_4 { - color=blue - 14 [label="Enter block"]; - 15 [label="Postponed enter to lambda"]; - subgraph cluster_5 { - color=blue - 19 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 20 [label="Enter block"]; - 21 [label="Access variable R|/it|"]; - 22 [label="Exit block"]; - } - 23 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 16 [label="Postponed exit from lambda"]; - 17 [label="Exit block"]; - } - 18 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 7 [label="Enter property" style="filled" fillcolor=red]; + 8 [label="Access variable R|/s|"]; + 9 [label="Exit property" style="filled" fillcolor=red]; } - 8 [label="Postponed exit from lambda"]; - 9 [label="Function call: R|/s|.R|kotlin/let| kotlin/String|>(...)"]; - 10 [label="Call arguments union" style="filled" fillcolor=yellow]; - 11 [label="Delegated constructor call: super(...)"]; - 12 [label="Exit function " style="filled" fillcolor=red]; + 6 [label="Exit class B" style="filled" fillcolor=red]; } - 5 -> {6}; - 6 -> {7}; - 7 -> {13}; - 7 -> {8} [color=red]; + 5 -> {7} [color=green]; + 7 -> {8}; 8 -> {9}; - 9 -> {10}; + 9 -> {6} [color=green]; + + subgraph cluster_4 { + color=red + 10 [label="Enter function " style="filled" fillcolor=red]; + 11 [label="Access variable R|/s|"]; + 12 [label="Postponed enter to lambda"]; + subgraph cluster_5 { + color=blue + 18 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 19 [label="Enter block"]; + 20 [label="Postponed enter to lambda"]; + subgraph cluster_7 { + color=blue + 24 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 25 [label="Enter block"]; + 26 [label="Access variable R|/it|"]; + 27 [label="Exit block"]; + } + 28 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 21 [label="Postponed exit from lambda"]; + 22 [label="Exit block"]; + } + 23 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 13 [label="Postponed exit from lambda"]; + 14 [label="Function call: R|/s|.R|kotlin/let| kotlin/String|>(...)"]; + 15 [label="Call arguments union" style="filled" fillcolor=yellow]; + 16 [label="Delegated constructor call: super(...)"]; + 17 [label="Exit function " style="filled" fillcolor=red]; + } 10 -> {11}; 11 -> {12}; + 12 -> {18}; + 12 -> {13} [color=red]; 13 -> {14}; 14 -> {15}; - 15 -> {16 19}; + 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {8} [color=green]; - 18 -> {10} [color=red]; + 18 -> {19}; 19 -> {20}; - 20 -> {21}; + 20 -> {21 24}; 21 -> {22}; 22 -> {23}; - - subgraph cluster_7 { - color=red - 24 [label="Enter function getter" style="filled" fillcolor=red]; - 25 [label="Exit function getter" style="filled" fillcolor=red]; - } + 23 -> {13} [color=green]; + 23 -> {15} [color=red]; 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; - subgraph cluster_8 { + subgraph cluster_9 { color=red - 29 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 30 [label="Enter block"]; - 31 [label="Function call: this@R|/B|.R|/B.foo|()"]; - 32 [label="Exit block"]; - } - 33 [label="Exit function foo" style="filled" fillcolor=red]; + 29 [label="Enter function getter" style="filled" fillcolor=red]; + 30 [label="Exit function getter" style="filled" fillcolor=red]; } 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; subgraph cluster_10 { color=red - 34 [label="Enter class B" style="filled" fillcolor=red]; + 31 [label="Enter function foo" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 26 [label="Enter property" style="filled" fillcolor=red]; - 27 [label="Access variable R|/s|"]; - 28 [label="Exit property" style="filled" fillcolor=red]; + 32 [label="Enter block"]; + 33 [label="Function call: this@R|/B|.R|/B.foo|()"]; + 34 [label="Exit block"]; } - 35 [label="Exit class B" style="filled" fillcolor=red]; + 35 [label="Exit function foo" style="filled" fillcolor=red]; } - 34 -> {26} [color=green]; - 26 -> {27}; - 27 -> {28}; - 28 -> {35} [color=green]; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot index fd3afaec721..97022fa06b4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot @@ -12,35 +12,35 @@ digraph returnValuesFromLambda_kt { subgraph cluster_1 { color=red - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()"]; - 4 [label="Exit function " style="filled" fillcolor=red]; + 2 [label="Enter class B" style="filled" fillcolor=red]; + 3 [label="Exit class B" style="filled" fillcolor=red]; } - 2 -> {3}; - 3 -> {4}; + 2 -> {3} [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]; + 4 [label="Enter function " style="filled" fillcolor=red]; + 5 [label="Delegated constructor call: super()"]; + 6 [label="Exit function " style="filled" fillcolor=red]; } - 5 -> {6} [color=green]; + 4 -> {5}; + 5 -> {6}; subgraph cluster_3 { color=red - 7 [label="Enter function " style="filled" fillcolor=red]; - 8 [label="Delegated constructor call: super()"]; - 9 [label="Exit function " style="filled" fillcolor=red]; + 7 [label="Enter class C" style="filled" fillcolor=red]; + 8 [label="Exit class C" style="filled" fillcolor=red]; } - 7 -> {8}; - 8 -> {9}; + 7 -> {8} [color=green]; subgraph cluster_4 { color=red - 10 [label="Enter class C" style="filled" fillcolor=red]; - 11 [label="Exit class C" style="filled" fillcolor=red]; + 9 [label="Enter function " style="filled" fillcolor=red]; + 10 [label="Delegated constructor call: super()"]; + 11 [label="Exit function " style="filled" fillcolor=red]; } - 10 -> {11} [color=green]; + 9 -> {10}; + 10 -> {11}; subgraph cluster_5 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot index 04989d11b3d..42d5e4b48bb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot @@ -5,31 +5,31 @@ digraph safeCalls_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter function bar" style="filled" fillcolor=red]; - 3 [label="Exit function bar" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function bar" style="filled" fillcolor=red]; + 5 [label="Exit function bar" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red - 6 [label="Enter function getter" style="filled" fillcolor=red]; - 7 [label="Exit function getter" style="filled" fillcolor=red]; + 6 [label="Enter class B" style="filled" fillcolor=red]; + 7 [label="Exit class B" style="filled" fillcolor=red]; } - 6 -> {7}; + 6 -> {7} [color=green]; subgraph cluster_4 { color=red @@ -40,10 +40,10 @@ digraph safeCalls_kt { subgraph cluster_5 { color=red - 10 [label="Enter class B" style="filled" fillcolor=red]; - 11 [label="Exit class B" style="filled" fillcolor=red]; + 10 [label="Enter function getter" style="filled" fillcolor=red]; + 11 [label="Exit function getter" style="filled" fillcolor=red]; } - 10 -> {11} [color=green]; + 10 -> {11}; subgraph cluster_6 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.dot b/compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.dot index e07695c3687..f74c6d1b349 100644 --- a/compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.dot +++ b/compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.dot @@ -5,63 +5,63 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super|>()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class SomeEnum" style="filled" fillcolor=red]; + 1 [label="Exit class SomeEnum" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter function values" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 4 [label="Enter block"]; - 5 [label="Exit block"]; - } - 6 [label="Exit function values" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super|>()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } + 2 -> {3}; 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 7 [label="Enter function valueOf" style="filled" fillcolor=red]; - subgraph cluster_4 { + 5 [label="Enter function values" style="filled" fillcolor=red]; + subgraph cluster_3 { color=blue - 8 [label="Enter block"]; - 9 [label="Exit block"]; + 6 [label="Enter block"]; + 7 [label="Exit block"]; } - 10 [label="Exit function valueOf" style="filled" fillcolor=red]; + 8 [label="Exit function values" style="filled" fillcolor=red]; } + 5 -> {6}; + 6 -> {7}; 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - subgraph cluster_5 { + subgraph cluster_4 { color=red - 11 [label="Enter class SomeEnum" style="filled" fillcolor=red]; - 12 [label="Exit class SomeEnum" style="filled" fillcolor=red]; + 9 [label="Enter function valueOf" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 10 [label="Enter block"]; + 11 [label="Exit block"]; + } + 12 [label="Exit function valueOf" style="filled" fillcolor=red]; } - 11 -> {12} [color=green]; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; subgraph cluster_6 { color=red - 13 [label="Enter function " style="filled" fillcolor=red]; - 14 [label="Delegated constructor call: super()"]; - 15 [label="Exit function " style="filled" fillcolor=red]; + 13 [label="Enter class B" style="filled" fillcolor=red]; + 14 [label="Exit class B" style="filled" fillcolor=red]; } - 13 -> {14}; - 14 -> {15}; + 13 -> {14} [color=green]; subgraph cluster_7 { color=red - 16 [label="Enter class B" style="filled" fillcolor=red]; - 17 [label="Exit class B" style="filled" fillcolor=red]; + 15 [label="Enter function " style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super()"]; + 17 [label="Exit function " style="filled" fillcolor=red]; } - 16 -> {17} [color=green]; + 15 -> {16}; + 16 -> {17}; subgraph cluster_8 { 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 41efb8cc01f..a1d857b8371 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot +++ b/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot @@ -5,112 +5,112 @@ digraph secondaryConstructorCfg_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - - subgraph cluster_1 { - color=red - 3 [label="Enter function getter" style="filled" fillcolor=red]; - 4 [label="Exit function getter" style="filled" fillcolor=red]; + 0 [label="Enter class B" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 2 [label="Enter property" style="filled" fillcolor=red]; + 3 [label="Access variable R|/p0|"]; + 4 [label="Exit property" style="filled" fillcolor=red]; + } + subgraph cluster_2 { + color=blue + 5 [label="Enter property" style="filled" fillcolor=red]; + 6 [label="Access variable R|/p0|"]; + 7 [label="Access variable R|kotlin/String.length|"]; + 8 [label="Exit property" style="filled" fillcolor=red]; + } + subgraph cluster_3 { + color=blue + 9 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 10 [label="Enter block"]; + 11 [label="Access variable R|/p0|"]; + 12 [label="Access variable R|kotlin/String.length|"]; + 13 [label="Assignment: R|/B.p1|"]; + 14 [label="Const: String()"]; + 15 [label="Assignment: R|/B.p3|"]; + 16 [label="Exit block"]; + } + 17 [label="Exit init block" style="filled" fillcolor=red]; + } + 1 [label="Exit class B" style="filled" fillcolor=red]; } + 0 -> {2} [color=green]; + 2 -> {3}; 3 -> {4}; - - subgraph cluster_2 { - color=red - 8 [label="Enter function getter" style="filled" fillcolor=red]; - 9 [label="Exit function getter" style="filled" fillcolor=red]; - } - 8 -> {9}; - - subgraph cluster_3 { - color=red - 14 [label="Enter function getter" style="filled" fillcolor=red]; - 15 [label="Exit function getter" style="filled" fillcolor=red]; - } + 4 -> {5} [color=green]; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9} [color=green]; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; 14 -> {15}; - - subgraph cluster_4 { - color=red - 16 [label="Enter function setter" style="filled" fillcolor=red]; - 17 [label="Exit function setter" style="filled" fillcolor=red]; - } + 15 -> {16}; 16 -> {17}; + 17 -> {1} [color=green]; subgraph cluster_5 { color=red 18 [label="Enter function " style="filled" fillcolor=red]; - 19 [label="Access variable R|/p0|"]; - 20 [label="Delegated constructor call: this(...)"]; - subgraph cluster_6 { - color=blue - 21 [label="Enter block"]; - 22 [label="Access variable R|/p1|"]; - 23 [label="Assignment: R|/B.p3|"]; - 24 [label="Exit block"]; - } - 25 [label="Exit function " style="filled" fillcolor=red]; + 19 [label="Delegated constructor call: super()"]; + 20 [label="Exit function " style="filled" fillcolor=red]; } 18 -> {19}; 19 -> {20}; - 20 -> {21}; + + subgraph cluster_6 { + color=red + 21 [label="Enter function getter" style="filled" fillcolor=red]; + 22 [label="Exit function getter" style="filled" fillcolor=red]; + } 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; subgraph cluster_7 { color=red - 35 [label="Enter class B" style="filled" fillcolor=red]; - subgraph cluster_8 { - color=blue - 5 [label="Enter property" style="filled" fillcolor=red]; - 6 [label="Access variable R|/p0|"]; - 7 [label="Exit property" style="filled" fillcolor=red]; - } - subgraph cluster_9 { - color=blue - 10 [label="Enter property" style="filled" fillcolor=red]; - 11 [label="Access variable R|/p0|"]; - 12 [label="Access variable R|kotlin/String.length|"]; - 13 [label="Exit property" style="filled" fillcolor=red]; - } - subgraph cluster_10 { - color=blue - 26 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 27 [label="Enter block"]; - 28 [label="Access variable R|/p0|"]; - 29 [label="Access variable R|kotlin/String.length|"]; - 30 [label="Assignment: R|/B.p1|"]; - 31 [label="Const: String()"]; - 32 [label="Assignment: R|/B.p3|"]; - 33 [label="Exit block"]; - } - 34 [label="Exit init block" style="filled" fillcolor=red]; - } - 36 [label="Exit class B" style="filled" fillcolor=red]; + 23 [label="Enter function getter" style="filled" fillcolor=red]; + 24 [label="Exit function getter" style="filled" fillcolor=red]; + } + 23 -> {24}; + + subgraph cluster_8 { + color=red + 25 [label="Enter function getter" style="filled" fillcolor=red]; + 26 [label="Exit function getter" style="filled" fillcolor=red]; + } + 25 -> {26}; + + subgraph cluster_9 { + color=red + 27 [label="Enter function setter" style="filled" fillcolor=red]; + 28 [label="Exit function setter" style="filled" fillcolor=red]; } - 35 -> {5} [color=green]; - 5 -> {6}; - 6 -> {7}; - 7 -> {10} [color=green]; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {26} [color=green]; - 26 -> {27}; 27 -> {28}; - 28 -> {29}; + + subgraph cluster_10 { + color=red + 29 [label="Enter function " style="filled" fillcolor=red]; + 30 [label="Access variable R|/p0|"]; + 31 [label="Delegated constructor call: this(...)"]; + subgraph cluster_11 { + color=blue + 32 [label="Enter block"]; + 33 [label="Access variable R|/p1|"]; + 34 [label="Assignment: R|/B.p3|"]; + 35 [label="Exit block"]; + } + 36 [label="Exit function " style="filled" fillcolor=red]; + } 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; 33 -> {34}; - 34 -> {36} [color=green]; + 34 -> {35}; + 35 -> {36}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot index 02f4bdc21a4..61d9f031287 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot @@ -5,17 +5,17 @@ digraph bangbang_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot index d47c6243474..83709958aba 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot @@ -5,52 +5,52 @@ digraph booleanOperators_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter function bool" style="filled" fillcolor=red]; - 3 [label="Exit function bool" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function bool" style="filled" fillcolor=red]; + 5 [label="Exit function bool" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red - 6 [label="Enter function bar" style="filled" fillcolor=red]; - 7 [label="Exit function bar" style="filled" fillcolor=red]; + 6 [label="Enter class B" style="filled" fillcolor=red]; + 7 [label="Exit class B" style="filled" fillcolor=red]; } - 6 -> {7}; + 6 -> {7} [color=green]; subgraph cluster_4 { color=red - 8 [label="Enter class B" style="filled" fillcolor=red]; - 9 [label="Exit class B" style="filled" fillcolor=red]; + 8 [label="Enter function bar" style="filled" fillcolor=red]; + 9 [label="Exit function bar" style="filled" fillcolor=red]; } - 8 -> {9} [color=green]; + 8 -> {9}; subgraph cluster_5 { color=red - 10 [label="Enter function baz" style="filled" fillcolor=red]; - 11 [label="Exit function baz" style="filled" fillcolor=red]; + 10 [label="Enter class C" style="filled" fillcolor=red]; + 11 [label="Exit class C" style="filled" fillcolor=red]; } - 10 -> {11}; + 10 -> {11} [color=green]; subgraph cluster_6 { color=red - 12 [label="Enter class C" style="filled" fillcolor=red]; - 13 [label="Exit class C" style="filled" fillcolor=red]; + 12 [label="Enter function baz" style="filled" fillcolor=red]; + 13 [label="Exit function baz" style="filled" fillcolor=red]; } - 12 -> {13} [color=green]; + 12 -> {13}; subgraph cluster_7 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot index 64279d206c8..32932dc8a45 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot @@ -5,24 +5,24 @@ digraph equalsToBoolean_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot index 4419b441f1d..bef19c451a3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot @@ -5,17 +5,17 @@ digraph jumpFromRhsOfOperator_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red 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 b03a55ede1c..700f035fefd 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot @@ -5,31 +5,31 @@ digraph boundSmartcasts_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter function bar" style="filled" fillcolor=red]; - 5 [label="Exit function bar" style="filled" fillcolor=red]; + 4 [label="Enter class B" style="filled" fillcolor=red]; + 5 [label="Exit class B" style="filled" fillcolor=red]; } - 4 -> {5}; + 4 -> {5} [color=green]; subgraph cluster_3 { color=red - 6 [label="Enter class B" style="filled" fillcolor=red]; - 7 [label="Exit class B" style="filled" fillcolor=red]; + 6 [label="Enter function bar" style="filled" fillcolor=red]; + 7 [label="Exit function bar" style="filled" fillcolor=red]; } - 6 -> {7} [color=green]; + 6 -> {7}; subgraph cluster_4 { color=red @@ -316,35 +316,35 @@ digraph boundSmartcasts_kt { subgraph cluster_27 { color=red - 115 [label="Enter function " style="filled" fillcolor=red]; - 116 [label="Delegated constructor call: super()"]; - 117 [label="Exit function " style="filled" fillcolor=red]; - } - 115 -> {116}; - 116 -> {117}; - - subgraph cluster_28 { - color=red - 118 [label="Enter function getter" style="filled" fillcolor=red]; - 119 [label="Exit function getter" style="filled" fillcolor=red]; + 115 [label="Enter class D" style="filled" fillcolor=red]; + subgraph cluster_28 { + color=blue + 117 [label="Enter property" style="filled" fillcolor=red]; + 118 [label="Access variable R|/any|"]; + 119 [label="Exit property" style="filled" fillcolor=red]; + } + 116 [label="Exit class D" style="filled" fillcolor=red]; } + 115 -> {117} [color=green]; + 117 -> {118}; 118 -> {119}; + 119 -> {116} [color=green]; subgraph cluster_29 { color=red - 123 [label="Enter class D" style="filled" fillcolor=red]; - subgraph cluster_30 { - color=blue - 120 [label="Enter property" style="filled" fillcolor=red]; - 121 [label="Access variable R|/any|"]; - 122 [label="Exit property" style="filled" fillcolor=red]; - } - 124 [label="Exit class D" style="filled" fillcolor=red]; + 120 [label="Enter function " style="filled" fillcolor=red]; + 121 [label="Delegated constructor call: super()"]; + 122 [label="Exit function " style="filled" fillcolor=red]; } - 123 -> {120} [color=green]; 120 -> {121}; 121 -> {122}; - 122 -> {124} [color=green]; + + subgraph cluster_30 { + color=red + 123 [label="Enter function getter" style="filled" fillcolor=red]; + 124 [label="Exit function getter" style="filled" fillcolor=red]; + } + 123 -> {124}; subgraph cluster_31 { 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 8dc25b68e0e..7a9ee6b4860 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -5,35 +5,35 @@ digraph boundSmartcastsInBranches_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - - subgraph cluster_1 { - color=red - 3 [label="Enter function getter" style="filled" fillcolor=red]; - 4 [label="Exit function getter" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 2 [label="Enter property" style="filled" fillcolor=red]; + 3 [label="Const: String()"]; + 4 [label="Exit property" style="filled" fillcolor=red]; + } + 1 [label="Exit class A" style="filled" fillcolor=red]; } + 0 -> {2} [color=green]; + 2 -> {3}; 3 -> {4}; + 4 -> {1} [color=green]; subgraph cluster_2 { color=red - 8 [label="Enter class A" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 5 [label="Enter property" style="filled" fillcolor=red]; - 6 [label="Const: String()"]; - 7 [label="Exit property" style="filled" fillcolor=red]; - } - 9 [label="Exit class A" style="filled" fillcolor=red]; + 5 [label="Enter function " style="filled" fillcolor=red]; + 6 [label="Delegated constructor call: super()"]; + 7 [label="Exit function " style="filled" fillcolor=red]; } - 8 -> {5} [color=green]; 5 -> {6}; 6 -> {7}; - 7 -> {9} [color=green]; + + subgraph cluster_3 { + color=red + 8 [label="Enter function getter" style="filled" fillcolor=red]; + 9 [label="Exit function getter" style="filled" fillcolor=red]; + } + 8 -> {9}; subgraph cluster_4 { 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 454abb27023..3d156931027 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot @@ -5,51 +5,51 @@ digraph functionCallBound_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class Base" style="filled" fillcolor=red]; + 1 [label="Exit class Base" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter class Base" style="filled" fillcolor=red]; - 4 [label="Exit class Base" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } - 3 -> {4} [color=green]; + 2 -> {3}; + 3 -> {4}; subgraph cluster_2 { color=red - 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()"]; - 7 [label="Exit function " style="filled" fillcolor=red]; - } - 5 -> {6}; - 6 -> {7}; - - subgraph cluster_3 { - color=red - 8 [label="Enter function getter" style="filled" fillcolor=red]; - 9 [label="Exit function getter" style="filled" fillcolor=red]; + 5 [label="Enter class Sub" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 7 [label="Enter property" style="filled" fillcolor=red]; + 8 [label="Access variable R|/data|"]; + 9 [label="Exit property" style="filled" fillcolor=red]; + } + 6 [label="Exit class Sub" style="filled" fillcolor=red]; } + 5 -> {7} [color=green]; + 7 -> {8}; 8 -> {9}; + 9 -> {6} [color=green]; subgraph cluster_4 { color=red - 13 [label="Enter class Sub" style="filled" fillcolor=red]; - subgraph cluster_5 { - color=blue - 10 [label="Enter property" style="filled" fillcolor=red]; - 11 [label="Access variable R|/data|"]; - 12 [label="Exit property" style="filled" fillcolor=red]; - } - 14 [label="Exit class Sub" style="filled" fillcolor=red]; + 10 [label="Enter function " style="filled" fillcolor=red]; + 11 [label="Delegated constructor call: super()"]; + 12 [label="Exit function " style="filled" fillcolor=red]; } - 13 -> {10} [color=green]; 10 -> {11}; 11 -> {12}; - 12 -> {14} [color=green]; + + subgraph cluster_5 { + color=red + 13 [label="Enter function getter" style="filled" fillcolor=red]; + 14 [label="Exit function getter" style="filled" fillcolor=red]; + } + 13 -> {14}; subgraph cluster_6 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot index e9507d162c2..0c7adb0ee8b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot @@ -5,24 +5,24 @@ digraph elvis_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot index fe13d7098d5..b3b74fb28f1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot @@ -148,45 +148,45 @@ digraph returns_kt { subgraph cluster_14 { color=red - 50 [label="Enter function foo" style="filled" fillcolor=red]; - 51 [label="Exit function foo" style="filled" fillcolor=red]; + 50 [label="Enter class A" style="filled" fillcolor=red]; + 51 [label="Exit class A" style="filled" fillcolor=red]; } - 50 -> {51}; + 50 -> {51} [color=green]; subgraph cluster_15 { color=red - 52 [label="Enter class A" style="filled" fillcolor=red]; - 53 [label="Exit class A" style="filled" fillcolor=red]; + 52 [label="Enter function foo" style="filled" fillcolor=red]; + 53 [label="Exit function foo" style="filled" fillcolor=red]; } - 52 -> {53} [color=green]; + 52 -> {53}; subgraph cluster_16 { color=red - 54 [label="Enter function bar" style="filled" fillcolor=red]; - 55 [label="Exit function bar" style="filled" fillcolor=red]; + 54 [label="Enter class B" style="filled" fillcolor=red]; + 55 [label="Exit class B" style="filled" fillcolor=red]; } - 54 -> {55}; + 54 -> {55} [color=green]; subgraph cluster_17 { color=red - 56 [label="Enter class B" style="filled" fillcolor=red]; - 57 [label="Exit class B" style="filled" fillcolor=red]; + 56 [label="Enter function bar" style="filled" fillcolor=red]; + 57 [label="Exit function bar" style="filled" fillcolor=red]; } - 56 -> {57} [color=green]; + 56 -> {57}; subgraph cluster_18 { color=red - 58 [label="Enter function baz" style="filled" fillcolor=red]; - 59 [label="Exit function baz" style="filled" fillcolor=red]; + 58 [label="Enter class C" style="filled" fillcolor=red]; + 59 [label="Exit class C" style="filled" fillcolor=red]; } - 58 -> {59}; + 58 -> {59} [color=green]; subgraph cluster_19 { color=red - 60 [label="Enter class C" style="filled" fillcolor=red]; - 61 [label="Exit class C" style="filled" fillcolor=red]; + 60 [label="Enter function baz" style="filled" fillcolor=red]; + 61 [label="Exit function baz" style="filled" fillcolor=red]; } - 60 -> {61} [color=green]; + 60 -> {61}; subgraph cluster_20 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot index 08b3f7525de..f396aa30071 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot @@ -5,17 +5,17 @@ digraph smartcastFromArgument_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot index 57ac9ba236d..82dcf7a11b9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot @@ -5,31 +5,31 @@ digraph when_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter function bar" style="filled" fillcolor=red]; - 5 [label="Exit function bar" style="filled" fillcolor=red]; + 4 [label="Enter class B" style="filled" fillcolor=red]; + 5 [label="Exit class B" style="filled" fillcolor=red]; } - 4 -> {5}; + 4 -> {5} [color=green]; subgraph cluster_3 { color=red - 6 [label="Enter class B" style="filled" fillcolor=red]; - 7 [label="Exit class B" style="filled" fillcolor=red]; + 6 [label="Enter function bar" style="filled" fillcolor=red]; + 7 [label="Exit function bar" style="filled" fillcolor=red]; } - 6 -> {7} [color=green]; + 6 -> {7}; subgraph cluster_4 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot index 2a20a0f620e..3cefed555ff 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot @@ -5,17 +5,17 @@ digraph equalsAndIdentity_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot index fb1bf868e39..5458bfa962b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot @@ -5,31 +5,31 @@ digraph inPlaceLambdas_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter function bar" style="filled" fillcolor=red]; - 5 [label="Exit function bar" style="filled" fillcolor=red]; + 4 [label="Enter class B" style="filled" fillcolor=red]; + 5 [label="Exit class B" style="filled" fillcolor=red]; } - 4 -> {5}; + 4 -> {5} [color=green]; subgraph cluster_3 { color=red - 6 [label="Enter class B" style="filled" fillcolor=red]; - 7 [label="Exit class B" style="filled" fillcolor=red]; + 6 [label="Enter function bar" style="filled" fillcolor=red]; + 7 [label="Exit function bar" style="filled" fillcolor=red]; } - 6 -> {7} [color=green]; + 6 -> {7}; subgraph cluster_4 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot index 4074a02264f..5c0ffc0310d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot @@ -5,17 +5,17 @@ digraph dataFlowInfoFromWhileCondition_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot index 822e9ea2cdf..9a15a7db83b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot @@ -5,17 +5,17 @@ digraph endlessLoops_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot index 8e474e97a09..d129b08df4a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot @@ -5,31 +5,31 @@ digraph multipleCasts_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter class A" style="filled" fillcolor=red]; - 3 [label="Exit class A" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 2 -> {3} [color=green]; + 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter function foo" style="filled" fillcolor=red]; - 5 [label="Exit function foo" style="filled" fillcolor=red]; + 4 [label="Enter class B" style="filled" fillcolor=red]; + 5 [label="Exit class B" style="filled" fillcolor=red]; } - 4 -> {5}; + 4 -> {5} [color=green]; subgraph cluster_3 { color=red - 6 [label="Enter class B" style="filled" fillcolor=red]; - 7 [label="Exit class B" style="filled" fillcolor=red]; + 6 [label="Enter function foo" style="filled" fillcolor=red]; + 7 [label="Exit function foo" style="filled" fillcolor=red]; } - 6 -> {7} [color=green]; + 6 -> {7}; subgraph cluster_4 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot index 31f6c2749b4..15bc6731fc8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot @@ -5,237 +5,237 @@ digraph nullability_kt { subgraph cluster_0 { color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 2 [label="Enter function getA" style="filled" fillcolor=red]; - 3 [label="Exit function getA" style="filled" fillcolor=red]; + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; subgraph cluster_2 { color=red - 4 [label="Enter class A" style="filled" fillcolor=red]; - 5 [label="Exit class A" style="filled" fillcolor=red]; + 4 [label="Enter function getA" style="filled" fillcolor=red]; + 5 [label="Exit function getA" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red - 6 [label="Enter function getter" style="filled" fillcolor=red]; - 7 [label="Exit function getter" style="filled" fillcolor=red]; + 6 [label="Enter class MyData" style="filled" fillcolor=red]; + 7 [label="Exit class MyData" style="filled" fillcolor=red]; } - 6 -> {7}; + 6 -> {7} [color=green]; subgraph cluster_4 { color=red - 8 [label="Enter function fs" style="filled" fillcolor=red]; - 9 [label="Exit function fs" style="filled" fillcolor=red]; + 8 [label="Enter function getter" style="filled" fillcolor=red]; + 9 [label="Exit function getter" style="filled" fillcolor=red]; } 8 -> {9}; subgraph cluster_5 { color=red - 10 [label="Enter class MyData" style="filled" fillcolor=red]; - 11 [label="Exit class MyData" style="filled" fillcolor=red]; + 10 [label="Enter function fs" style="filled" fillcolor=red]; + 11 [label="Exit function fs" style="filled" fillcolor=red]; } - 10 -> {11} [color=green]; + 10 -> {11}; subgraph cluster_6 { color=red - 12 [label="Enter function getter" style="filled" fillcolor=red]; - 13 [label="Exit function getter" style="filled" fillcolor=red]; + 12 [label="Enter class Q" style="filled" fillcolor=red]; + 13 [label="Exit class Q" style="filled" fillcolor=red]; } - 12 -> {13}; + 12 -> {13} [color=green]; subgraph cluster_7 { color=red - 14 [label="Enter function fdata" style="filled" fillcolor=red]; - 15 [label="Exit function fdata" style="filled" fillcolor=red]; + 14 [label="Enter function getter" style="filled" fillcolor=red]; + 15 [label="Exit function getter" style="filled" fillcolor=red]; } 14 -> {15}; subgraph cluster_8 { color=red - 16 [label="Enter class Q" style="filled" fillcolor=red]; - 17 [label="Exit class Q" style="filled" fillcolor=red]; + 16 [label="Enter function fdata" style="filled" fillcolor=red]; + 17 [label="Exit function fdata" style="filled" fillcolor=red]; } - 16 -> {17} [color=green]; + 16 -> {17}; subgraph cluster_9 { color=red - 18 [label="Enter function " style="filled" fillcolor=red]; - 19 [label="Delegated constructor call: super()"]; - 20 [label="Exit function " style="filled" fillcolor=red]; - } - 18 -> {19}; - 19 -> {20}; - - subgraph cluster_10 { - color=red - 21 [label="Enter function getter" style="filled" fillcolor=red]; - 22 [label="Exit function getter" style="filled" fillcolor=red]; + 18 [label="Enter class QImpl" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 20 [label="Enter property" style="filled" fillcolor=red]; + 21 [label="Access variable R|/data|"]; + 22 [label="Exit property" style="filled" fillcolor=red]; + } + 19 [label="Exit class QImpl" style="filled" fillcolor=red]; } + 18 -> {20} [color=green]; + 20 -> {21}; 21 -> {22}; + 22 -> {19} [color=green]; subgraph cluster_11 { color=red - 26 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 27 [label="Enter block"]; - 28 [label="Const: Null(null)"]; - 29 [label="Jump: ^fdata Null(null)"]; - 30 [label="Stub" style="filled" fillcolor=gray]; - 31 [label="Exit block" style="filled" fillcolor=gray]; - } - 32 [label="Exit function fdata" style="filled" fillcolor=red]; + 23 [label="Enter function " style="filled" fillcolor=red]; + 24 [label="Delegated constructor call: super()"]; + 25 [label="Exit function " style="filled" fillcolor=red]; + } + 23 -> {24}; + 24 -> {25}; + + subgraph cluster_12 { + color=red + 26 [label="Enter function getter" style="filled" fillcolor=red]; + 27 [label="Exit function getter" style="filled" fillcolor=red]; } 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {32}; - 29 -> {30} [style=dotted]; - 30 -> {31} [style=dotted]; - 31 -> {32} [style=dotted]; subgraph cluster_13 { color=red - 33 [label="Enter class QImpl" style="filled" fillcolor=red]; + 28 [label="Enter function fdata" style="filled" fillcolor=red]; subgraph cluster_14 { color=blue - 23 [label="Enter property" style="filled" fillcolor=red]; - 24 [label="Access variable R|/data|"]; - 25 [label="Exit property" style="filled" fillcolor=red]; + 29 [label="Enter block"]; + 30 [label="Const: Null(null)"]; + 31 [label="Jump: ^fdata Null(null)"]; + 32 [label="Stub" style="filled" fillcolor=gray]; + 33 [label="Exit block" style="filled" fillcolor=gray]; } - 34 [label="Exit class QImpl" style="filled" fillcolor=red]; + 34 [label="Exit function fdata" style="filled" fillcolor=red]; } - 33 -> {23} [color=green]; - 23 -> {24}; - 24 -> {25}; - 25 -> {34} [color=green]; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {34}; + 31 -> {32} [style=dotted]; + 32 -> {33} [style=dotted]; + 33 -> {34} [style=dotted]; subgraph cluster_15 { color=red - 35 [label="Enter function " style="filled" fillcolor=red]; - 36 [label="Delegated constructor call: super()"]; - 37 [label="Exit function " style="filled" fillcolor=red]; - } - 35 -> {36}; - 36 -> {37}; - - subgraph cluster_16 { - color=red - 38 [label="Enter function getter" style="filled" fillcolor=red]; - 39 [label="Exit function getter" style="filled" fillcolor=red]; + 35 [label="Enter class QImplMutable" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 37 [label="Enter property" style="filled" fillcolor=red]; + 38 [label="Access variable R|/data|"]; + 39 [label="Exit property" style="filled" fillcolor=red]; + } + 36 [label="Exit class QImplMutable" style="filled" fillcolor=red]; } + 35 -> {37} [color=green]; + 37 -> {38}; 38 -> {39}; + 39 -> {36} [color=green]; subgraph cluster_17 { color=red - 40 [label="Enter function setter" style="filled" fillcolor=red]; - 41 [label="Exit function setter" style="filled" fillcolor=red]; + 40 [label="Enter function " style="filled" fillcolor=red]; + 41 [label="Delegated constructor call: super()"]; + 42 [label="Exit function " style="filled" fillcolor=red]; } 40 -> {41}; + 41 -> {42}; subgraph cluster_18 { color=red - 45 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_19 { - color=blue - 46 [label="Enter block"]; - 47 [label="Const: Null(null)"]; - 48 [label="Jump: ^fdata Null(null)"]; - 49 [label="Stub" style="filled" fillcolor=gray]; - 50 [label="Exit block" style="filled" fillcolor=gray]; - } - 51 [label="Exit function fdata" style="filled" fillcolor=red]; + 43 [label="Enter function getter" style="filled" fillcolor=red]; + 44 [label="Exit function getter" style="filled" fillcolor=red]; + } + 43 -> {44}; + + subgraph cluster_19 { + color=red + 45 [label="Enter function setter" style="filled" fillcolor=red]; + 46 [label="Exit function setter" style="filled" fillcolor=red]; } 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {51}; - 48 -> {49} [style=dotted]; - 49 -> {50} [style=dotted]; - 50 -> {51} [style=dotted]; subgraph cluster_20 { color=red - 52 [label="Enter class QImplMutable" style="filled" fillcolor=red]; + 47 [label="Enter function fdata" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 42 [label="Enter property" style="filled" fillcolor=red]; - 43 [label="Access variable R|/data|"]; - 44 [label="Exit property" style="filled" fillcolor=red]; + 48 [label="Enter block"]; + 49 [label="Const: Null(null)"]; + 50 [label="Jump: ^fdata Null(null)"]; + 51 [label="Stub" style="filled" fillcolor=gray]; + 52 [label="Exit block" style="filled" fillcolor=gray]; } - 53 [label="Exit class QImplMutable" style="filled" fillcolor=red]; + 53 [label="Exit function fdata" style="filled" fillcolor=red]; } - 52 -> {42} [color=green]; - 42 -> {43}; - 43 -> {44}; - 44 -> {53} [color=green]; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {53}; + 50 -> {51} [style=dotted]; + 51 -> {52} [style=dotted]; + 52 -> {53} [style=dotted]; subgraph cluster_22 { color=red - 54 [label="Enter function " style="filled" fillcolor=red]; - 55 [label="Delegated constructor call: super()"]; - 56 [label="Exit function " style="filled" fillcolor=red]; + 54 [label="Enter class QImplWithCustomGetter" style="filled" fillcolor=red]; + 55 [label="Exit class QImplWithCustomGetter" style="filled" fillcolor=red]; } - 54 -> {55}; - 55 -> {56}; + 54 -> {55} [color=green]; subgraph cluster_23 { color=red - 57 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_24 { - color=blue - 58 [label="Enter block"]; - 59 [label="Const: Null(null)"]; - 60 [label="Jump: ^ Null(null)"]; - 61 [label="Stub" style="filled" fillcolor=gray]; - 62 [label="Exit block" style="filled" fillcolor=gray]; - } - 63 [label="Exit function getter" style="filled" fillcolor=red]; + 56 [label="Enter function " style="filled" fillcolor=red]; + 57 [label="Delegated constructor call: super()"]; + 58 [label="Exit function " style="filled" fillcolor=red]; } + 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {63}; - 60 -> {61} [style=dotted]; - 61 -> {62} [style=dotted]; - 62 -> {63} [style=dotted]; - subgraph cluster_25 { + subgraph cluster_24 { color=red - 64 [label="Enter function fdata" style="filled" fillcolor=red]; - subgraph cluster_26 { + 59 [label="Enter function getter" style="filled" fillcolor=red]; + subgraph cluster_25 { color=blue - 65 [label="Enter block"]; - 66 [label="Const: Null(null)"]; - 67 [label="Jump: ^fdata Null(null)"]; - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Exit block" style="filled" fillcolor=gray]; + 60 [label="Enter block"]; + 61 [label="Const: Null(null)"]; + 62 [label="Jump: ^ Null(null)"]; + 63 [label="Stub" style="filled" fillcolor=gray]; + 64 [label="Exit block" style="filled" fillcolor=gray]; } - 70 [label="Exit function fdata" style="filled" fillcolor=red]; + 65 [label="Exit function getter" style="filled" fillcolor=red]; } - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {70}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {65}; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {65} [style=dotted]; - subgraph cluster_27 { + subgraph cluster_26 { color=red - 71 [label="Enter class QImplWithCustomGetter" style="filled" fillcolor=red]; - 72 [label="Exit class QImplWithCustomGetter" style="filled" fillcolor=red]; + 66 [label="Enter function fdata" style="filled" fillcolor=red]; + subgraph cluster_27 { + color=blue + 67 [label="Enter block"]; + 68 [label="Const: Null(null)"]; + 69 [label="Jump: ^fdata Null(null)"]; + 70 [label="Stub" style="filled" fillcolor=gray]; + 71 [label="Exit block" style="filled" fillcolor=gray]; + } + 72 [label="Exit function fdata" style="filled" fillcolor=red]; } - 71 -> {72} [color=green]; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {72}; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + 71 -> {72} [style=dotted]; subgraph cluster_28 { 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 4b59cf6b94d..3e1d7df2c80 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot @@ -5,63 +5,63 @@ digraph implicitReceivers_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 4 [label="Enter block"]; - 5 [label="Exit block"]; - } - 6 [label="Exit function foo" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } + 2 -> {3}; 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 7 [label="Enter class A" style="filled" fillcolor=red]; - 8 [label="Exit class A" 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]; } - 7 -> {8} [color=green]; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; subgraph cluster_4 { color=red - 9 [label="Enter function " style="filled" fillcolor=red]; - 10 [label="Delegated constructor call: super()"]; - 11 [label="Exit function " style="filled" fillcolor=red]; + 9 [label="Enter class B" style="filled" fillcolor=red]; + 10 [label="Exit class B" style="filled" fillcolor=red]; } - 9 -> {10}; - 10 -> {11}; + 9 -> {10} [color=green]; subgraph cluster_5 { color=red - 12 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 13 [label="Enter block"]; - 14 [label="Exit block"]; - } - 15 [label="Exit function bar" style="filled" fillcolor=red]; + 11 [label="Enter function " style="filled" fillcolor=red]; + 12 [label="Delegated constructor call: super()"]; + 13 [label="Exit function " style="filled" fillcolor=red]; } + 11 -> {12}; 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - subgraph cluster_7 { + subgraph cluster_6 { color=red - 16 [label="Enter class B" style="filled" fillcolor=red]; - 17 [label="Exit class B" 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]; } - 16 -> {17} [color=green]; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; subgraph cluster_8 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.dot index 519dcf644aa..77d87f454a8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.dot @@ -12,17 +12,17 @@ digraph thisOfExtensionProperty_kt { subgraph cluster_1 { color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; + 2 [label="Enter class B" style="filled" fillcolor=red]; + 3 [label="Exit class B" style="filled" fillcolor=red]; } - 2 -> {3}; + 2 -> {3} [color=green]; subgraph cluster_2 { color=red - 4 [label="Enter class B" style="filled" fillcolor=red]; - 5 [label="Exit class B" style="filled" fillcolor=red]; + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red 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 71dab85abd2..120d51090a2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot @@ -5,70 +5,70 @@ digraph assignSafeCall_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - - subgraph cluster_1 { - color=red - 3 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { + 0 [label="Enter class A" style="filled" fillcolor=red]; + subgraph cluster_1 { color=blue - 4 [label="Enter block"]; - 5 [label="Const: Int(1)"]; - 6 [label="Jump: ^foo Int(1)"]; - 7 [label="Stub" style="filled" fillcolor=gray]; - 8 [label="Exit block" style="filled" fillcolor=gray]; + 2 [label="Enter property" style="filled" fillcolor=red]; + 3 [label="Const: Int(1)"]; + 4 [label="Exit property" style="filled" fillcolor=red]; } - 9 [label="Exit function foo" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } + 0 -> {2} [color=green]; + 2 -> {3}; 3 -> {4}; - 4 -> {5}; + 4 -> {1} [color=green]; + + subgraph cluster_2 { + color=red + 5 [label="Enter function " style="filled" fillcolor=red]; + 6 [label="Delegated constructor call: super()"]; + 7 [label="Exit function " style="filled" fillcolor=red]; + } 5 -> {6}; - 6 -> {9}; - 6 -> {7} [style=dotted]; - 7 -> {8} [style=dotted]; - 8 -> {9} [style=dotted]; + 6 -> {7}; subgraph cluster_3 { color=red - 10 [label="Enter function getter" style="filled" fillcolor=red]; - 11 [label="Exit function getter" style="filled" fillcolor=red]; - } - 10 -> {11}; - - subgraph cluster_4 { - color=red - 15 [label="Enter function bar" style="filled" fillcolor=red]; - subgraph cluster_5 { + 8 [label="Enter function foo" style="filled" fillcolor=red]; + subgraph cluster_4 { color=blue - 16 [label="Enter block"]; - 17 [label="Exit block"]; + 9 [label="Enter block"]; + 10 [label="Const: Int(1)"]; + 11 [label="Jump: ^foo Int(1)"]; + 12 [label="Stub" style="filled" fillcolor=gray]; + 13 [label="Exit block" style="filled" fillcolor=gray]; } - 18 [label="Exit function bar" style="filled" fillcolor=red]; + 14 [label="Exit function foo" style="filled" fillcolor=red]; + } + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {14}; + 11 -> {12} [style=dotted]; + 12 -> {13} [style=dotted]; + 13 -> {14} [style=dotted]; + + subgraph cluster_5 { + color=red + 15 [label="Enter function getter" style="filled" fillcolor=red]; + 16 [label="Exit function getter" style="filled" fillcolor=red]; } 15 -> {16}; - 16 -> {17}; - 17 -> {18}; subgraph cluster_6 { color=red - 19 [label="Enter class A" style="filled" fillcolor=red]; + 17 [label="Enter function bar" style="filled" fillcolor=red]; subgraph cluster_7 { color=blue - 12 [label="Enter property" style="filled" fillcolor=red]; - 13 [label="Const: Int(1)"]; - 14 [label="Exit property" style="filled" fillcolor=red]; + 18 [label="Enter block"]; + 19 [label="Exit block"]; } - 20 [label="Exit class A" style="filled" fillcolor=red]; + 20 [label="Exit function bar" style="filled" fillcolor=red]; } - 19 -> {12} [color=green]; - 12 -> {13}; - 13 -> {14}; - 14 -> {20} [color=green]; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; subgraph cluster_8 { color=red @@ -278,31 +278,31 @@ digraph assignSafeCall_kt { subgraph cluster_25 { color=red - 98 [label="Enter function foo" style="filled" fillcolor=red]; - 99 [label="Exit function foo" style="filled" fillcolor=red]; + 98 [label="Enter class B" style="filled" fillcolor=red]; + 99 [label="Exit class B" style="filled" fillcolor=red]; } - 98 -> {99}; + 98 -> {99} [color=green]; subgraph cluster_26 { color=red - 100 [label="Enter function getter" style="filled" fillcolor=red]; - 101 [label="Exit function getter" style="filled" fillcolor=red]; + 100 [label="Enter function foo" style="filled" fillcolor=red]; + 101 [label="Exit function foo" style="filled" fillcolor=red]; } 100 -> {101}; subgraph cluster_27 { color=red - 102 [label="Enter function bar" style="filled" fillcolor=red]; - 103 [label="Exit function bar" style="filled" fillcolor=red]; + 102 [label="Enter function getter" style="filled" fillcolor=red]; + 103 [label="Exit function getter" style="filled" fillcolor=red]; } 102 -> {103}; subgraph cluster_28 { color=red - 104 [label="Enter class B" style="filled" fillcolor=red]; - 105 [label="Exit class B" style="filled" fillcolor=red]; + 104 [label="Enter function bar" style="filled" fillcolor=red]; + 105 [label="Exit function bar" style="filled" fillcolor=red]; } - 104 -> {105} [color=green]; + 104 -> {105}; subgraph cluster_29 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot index e631c06fce0..9b1844d4de9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot @@ -74,31 +74,31 @@ digraph safeCalls_kt { subgraph cluster_6 { color=red - 25 [label="Enter function bar" style="filled" fillcolor=red]; - 26 [label="Exit function bar" style="filled" fillcolor=red]; + 25 [label="Enter class A" style="filled" fillcolor=red]; + 26 [label="Exit class A" style="filled" fillcolor=red]; } - 25 -> {26}; + 25 -> {26} [color=green]; subgraph cluster_7 { color=red - 27 [label="Enter function bool" style="filled" fillcolor=red]; - 28 [label="Exit function bool" style="filled" fillcolor=red]; + 27 [label="Enter function bar" style="filled" fillcolor=red]; + 28 [label="Exit function bar" style="filled" fillcolor=red]; } 27 -> {28}; subgraph cluster_8 { color=red - 29 [label="Enter function id" style="filled" fillcolor=red]; - 30 [label="Exit function id" style="filled" fillcolor=red]; + 29 [label="Enter function bool" style="filled" fillcolor=red]; + 30 [label="Exit function bool" style="filled" fillcolor=red]; } 29 -> {30}; subgraph cluster_9 { color=red - 31 [label="Enter class A" style="filled" fillcolor=red]; - 32 [label="Exit class A" style="filled" fillcolor=red]; + 31 [label="Enter function id" style="filled" fillcolor=red]; + 32 [label="Exit function id" style="filled" fillcolor=red]; } - 31 -> {32} [color=green]; + 31 -> {32}; subgraph cluster_10 { 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 84ebe0fc22b..7c59a1f669a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot @@ -12,17 +12,17 @@ digraph smartCastInInit_kt { subgraph cluster_1 { color=red - 2 [label="Enter function foo" style="filled" fillcolor=red]; - 3 [label="Exit function foo" style="filled" fillcolor=red]; + 2 [label="Enter class S" style="filled" fillcolor=red]; + 3 [label="Exit class S" style="filled" fillcolor=red]; } - 2 -> {3}; + 2 -> {3} [color=green]; subgraph cluster_2 { color=red - 4 [label="Enter class S" style="filled" fillcolor=red]; - 5 [label="Exit class S" style="filled" fillcolor=red]; + 4 [label="Enter function foo" style="filled" fillcolor=red]; + 5 [label="Exit function foo" style="filled" fillcolor=red]; } - 4 -> {5} [color=green]; + 4 -> {5}; subgraph cluster_3 { color=red @@ -49,47 +49,47 @@ digraph smartCastInInit_kt { subgraph cluster_5 { color=red - 14 [label="Enter function " style="filled" fillcolor=red]; - 15 [label="Delegated constructor call: super()"]; - 16 [label="Exit function " style="filled" fillcolor=red]; - } - 14 -> {15}; - 15 -> {16}; - - subgraph cluster_6 { - color=red - 17 [label="Enter function getter" style="filled" fillcolor=red]; - 18 [label="Exit function getter" style="filled" fillcolor=red]; - } - 17 -> {18}; - - subgraph cluster_7 { - color=red - 27 [label="Enter class Main" style="filled" fillcolor=red]; - subgraph cluster_8 { + 14 [label="Enter class Main" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 19 [label="Enter init block" style="filled" fillcolor=red]; - subgraph cluster_9 { + 16 [label="Enter init block" style="filled" fillcolor=red]; + subgraph cluster_7 { color=blue - 20 [label="Enter block"]; - 21 [label="Function call: R|/s|()"]; - 22 [label="Assignment: R|/Main.x|"]; - 23 [label="Access variable R|/Main.x|"]; - 24 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()"]; - 25 [label="Exit block"]; + 17 [label="Enter block"]; + 18 [label="Function call: R|/s|()"]; + 19 [label="Assignment: R|/Main.x|"]; + 20 [label="Access variable R|/Main.x|"]; + 21 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()"]; + 22 [label="Exit block"]; } - 26 [label="Exit init block" style="filled" fillcolor=red]; + 23 [label="Exit init block" style="filled" fillcolor=red]; } - 28 [label="Exit class Main" style="filled" fillcolor=red]; + 15 [label="Exit class Main" style="filled" fillcolor=red]; } - 27 -> {19} [color=green]; + 14 -> {16} [color=green]; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; - 23 -> {24}; + 23 -> {15} [color=green]; + + subgraph cluster_8 { + color=red + 24 [label="Enter function " style="filled" fillcolor=red]; + 25 [label="Delegated constructor call: super()"]; + 26 [label="Exit function " style="filled" fillcolor=red]; + } 24 -> {25}; 25 -> {26}; - 26 -> {28} [color=green]; + + subgraph cluster_9 { + color=red + 27 [label="Enter function getter" style="filled" fillcolor=red]; + 28 [label="Exit function getter" style="filled" fillcolor=red]; + } + 27 -> {28}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 93e8b5092b8..2d74918ed71 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -116,51 +116,51 @@ digraph smartcastToNothing_kt { subgraph cluster_10 { color=red - 38 [label="Enter function " style="filled" fillcolor=red]; - 39 [label="Delegated constructor call: super()"]; - 40 [label="Exit function " style="filled" fillcolor=red]; - } - 38 -> {39}; - 39 -> {40}; - - subgraph cluster_11 { - color=red - 41 [label="Enter function getter" style="filled" fillcolor=red]; - 42 [label="Exit function getter" style="filled" fillcolor=red]; + 38 [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]; + } + subgraph cluster_12 { + color=blue + 43 [label="Enter property" style="filled" fillcolor=red]; + 44 [label="Const: Boolean(true)"]; + 45 [label="Exit property" style="filled" fillcolor=red]; + } + 39 [label="Exit class A" style="filled" fillcolor=red]; } + 38 -> {40} [color=green]; + 40 -> {41}; 41 -> {42}; - - subgraph cluster_12 { - color=red - 46 [label="Enter function getter" style="filled" fillcolor=red]; - 47 [label="Exit function getter" style="filled" fillcolor=red]; - } - 46 -> {47}; + 42 -> {43} [color=green]; + 43 -> {44}; + 44 -> {45}; + 45 -> {39} [color=green]; subgraph cluster_13 { color=red - 51 [label="Enter class A" style="filled" fillcolor=red]; - subgraph cluster_14 { - color=blue - 43 [label="Enter property" style="filled" fillcolor=red]; - 44 [label="Const: Int(1)"]; - 45 [label="Exit property" style="filled" fillcolor=red]; - } - subgraph cluster_15 { - color=blue - 48 [label="Enter property" style="filled" fillcolor=red]; - 49 [label="Const: Boolean(true)"]; - 50 [label="Exit property" style="filled" fillcolor=red]; - } - 52 [label="Exit class A" style="filled" fillcolor=red]; + 46 [label="Enter function " style="filled" fillcolor=red]; + 47 [label="Delegated constructor call: super()"]; + 48 [label="Exit function " style="filled" fillcolor=red]; + } + 46 -> {47}; + 47 -> {48}; + + subgraph cluster_14 { + color=red + 49 [label="Enter function getter" style="filled" fillcolor=red]; + 50 [label="Exit function getter" style="filled" fillcolor=red]; } - 51 -> {43} [color=green]; - 43 -> {44}; - 44 -> {45}; - 45 -> {48} [color=green]; - 48 -> {49}; 49 -> {50}; - 50 -> {52} [color=green]; + + subgraph cluster_15 { + color=red + 51 [label="Enter function getter" style="filled" fillcolor=red]; + 52 [label="Exit function getter" style="filled" fillcolor=red]; + } + 51 -> {52}; subgraph cluster_16 { 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 58b2ae6889c..3d23f4808f7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot @@ -5,102 +5,102 @@ digraph overridenOpenVal_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - - subgraph cluster_1 { - color=red - 3 [label="Enter function getter" style="filled" fillcolor=red]; - 4 [label="Exit function getter" style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 2 [label="Enter property" style="filled" fillcolor=red]; + 3 [label="Access variable R|/x|"]; + 4 [label="Exit property" style="filled" fillcolor=red]; + } + 1 [label="Exit class A" style="filled" fillcolor=red]; } + 0 -> {2} [color=green]; + 2 -> {3}; 3 -> {4}; + 4 -> {1} [color=green]; subgraph cluster_2 { color=red - 8 [label="Enter class A" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 5 [label="Enter property" style="filled" fillcolor=red]; - 6 [label="Access variable R|/x|"]; - 7 [label="Exit property" style="filled" fillcolor=red]; - } - 9 [label="Exit class A" style="filled" fillcolor=red]; + 5 [label="Enter function " style="filled" fillcolor=red]; + 6 [label="Delegated constructor call: super()"]; + 7 [label="Exit function " style="filled" fillcolor=red]; } - 8 -> {5} [color=green]; 5 -> {6}; 6 -> {7}; - 7 -> {9} [color=green]; + + subgraph cluster_3 { + color=red + 8 [label="Enter function getter" style="filled" fillcolor=red]; + 9 [label="Exit function getter" style="filled" fillcolor=red]; + } + 8 -> {9}; subgraph cluster_4 { color=red - 10 [label="Enter function " style="filled" fillcolor=red]; - 11 [label="Access variable R|/x|"]; - 12 [label="Delegated constructor call: super(...)"]; - 13 [label="Exit function " style="filled" fillcolor=red]; + 10 [label="Enter class B" style="filled" fillcolor=red]; + 11 [label="Exit class B" style="filled" fillcolor=red]; } - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; + 10 -> {11} [color=green]; subgraph cluster_5 { color=red - 14 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_6 { + 12 [label="Enter function " style="filled" fillcolor=red]; + 13 [label="Access variable R|/x|"]; + 14 [label="Delegated constructor call: super(...)"]; + 15 [label="Exit function " style="filled" fillcolor=red]; + } + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + + subgraph cluster_6 { + color=red + 16 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_7 { color=blue - 15 [label="Enter block"]; - subgraph cluster_7 { + 17 [label="Enter block"]; + subgraph cluster_8 { color=blue - 16 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 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"]; - } - 21 [label="Synthetic else branch"]; - 22 [label="Enter when branch result"]; + 18 [label="Enter when"]; subgraph cluster_9 { color=blue - 23 [label="Enter block"]; - 24 [label="Access variable R|/A.x|"]; - 25 [label="Access variable R|kotlin/String.length|"]; - 26 [label="Exit block"]; + 19 [label="Enter when branch condition "]; + 20 [label="Access variable R|/A.x|"]; + 21 [label="Type operator: (this@R|/B|.R|/A.x| is R|kotlin/String|)"]; + 22 [label="Exit when branch condition"]; } - 27 [label="Exit when branch result"]; - 28 [label="Exit when"]; + 23 [label="Synthetic else branch"]; + 24 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 25 [label="Enter block"]; + 26 [label="Access variable R|/A.x|"]; + 27 [label="Access variable R|kotlin/String.length|"]; + 28 [label="Exit block"]; + } + 29 [label="Exit when branch result"]; + 30 [label="Exit when"]; } - 29 [label="Exit block"]; + 31 [label="Exit block"]; } - 30 [label="Exit function test_1" style="filled" fillcolor=red]; + 32 [label="Exit function test_1" style="filled" fillcolor=red]; } - 14 -> {15}; - 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {22 21}; - 21 -> {28}; - 22 -> {23}; - 23 -> {24}; + 20 -> {21}; + 21 -> {22}; + 22 -> {24 23}; + 23 -> {30}; 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - - subgraph cluster_10 { - color=red - 31 [label="Enter class B" style="filled" fillcolor=red]; - 32 [label="Exit class B" style="filled" fillcolor=red]; - } - 31 -> {32} [color=green]; + 30 -> {31}; + 31 -> {32}; subgraph cluster_11 { color=red 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 b5e8abdcfe4..f5908c15ff0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot @@ -5,33 +5,33 @@ digraph delayedAssignment_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class A" style="filled" fillcolor=red]; + 1 [label="Exit class A" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 4 [label="Enter block"]; - 5 [label="Exit block"]; - } - 6 [label="Exit function foo" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } + 2 -> {3}; 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 7 [label="Enter class A" style="filled" fillcolor=red]; - 8 [label="Exit class A" 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]; } - 7 -> {8} [color=green]; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; subgraph cluster_4 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.kt index e2a316b3117..aed438bd621 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.kt @@ -21,7 +21,7 @@ fun test_1() { inlineRun { x = 1 } - x.inc() + x.inc() } fun test_2() { @@ -29,5 +29,5 @@ fun test_2() { myRun { x = 1 } - x.inc() + x.inc() } \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.kt index 517efc78886..62ada8e05aa 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.kt @@ -21,7 +21,7 @@ fun test_1() { inlineRun { x = 1 } - x.inc() + x.inc() } fun test_2() { @@ -29,5 +29,5 @@ fun test_2() { myRun { x = 1 } - x.inc() + x.inc() } \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index b6467c634ed..bef18d1b7d8 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -5,19 +5,19 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_0 { color=red - 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; - 2 [label="Exit function " style="filled" fillcolor=red]; + 0 [label="Enter class DelegateProvider" style="filled" fillcolor=red]; + 1 [label="Exit class DelegateProvider" style="filled" fillcolor=red]; } - 0 -> {1}; - 1 -> {2}; + 0 -> {1} [color=green]; subgraph cluster_1 { color=red - 3 [label="Enter class DelegateProvider" style="filled" fillcolor=red]; - 4 [label="Exit class DelegateProvider" style="filled" fillcolor=red]; + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Delegated constructor call: super()"]; + 4 [label="Exit function " style="filled" fillcolor=red]; } - 3 -> {4} [color=green]; + 2 -> {3}; + 3 -> {4}; subgraph cluster_2 { color=red @@ -44,195 +44,195 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_4 { color=red - 13 [label="Enter function " style="filled" fillcolor=red]; - 14 [label="Delegated constructor call: super|>()"]; - 15 [label="Exit function " style="filled" fillcolor=red]; + 13 [label="Enter class IssueListView" style="filled" fillcolor=red]; + 14 [label="Exit class IssueListView" style="filled" fillcolor=red]; } - 13 -> {14}; - 14 -> {15}; + 13 -> {14} [color=green]; subgraph cluster_5 { color=red - 16 [label="Enter function updateFrom" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 17 [label="Enter block"]; - 18 [label="Exit block"]; - } - 19 [label="Exit function updateFrom" style="filled" fillcolor=red]; + 15 [label="Enter function " style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super|>()"]; + 17 [label="Exit function " style="filled" fillcolor=red]; } + 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - subgraph cluster_7 { + subgraph cluster_6 { color=red - 20 [label="Enter class IssueListView" style="filled" fillcolor=red]; - 21 [label="Exit class IssueListView" style="filled" fillcolor=red]; + 18 [label="Enter function updateFrom" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 19 [label="Enter block"]; + 20 [label="Exit block"]; + } + 21 [label="Exit function updateFrom" style="filled" fillcolor=red]; } - 20 -> {21} [color=green]; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; subgraph cluster_8 { color=red - 22 [label="Enter function " style="filled" fillcolor=red]; - 23 [label="Delegated constructor call: super|>()"]; - 24 [label="Exit function " style="filled" fillcolor=red]; - } - 22 -> {23}; - 23 -> {24}; - - subgraph cluster_9 { - color=red - 32 [label="Enter function " style="filled" fillcolor=red]; - 33 [label="Delegated constructor call: super()"]; - 34 [label="Exit function " style="filled" fillcolor=red]; - } - 32 -> {33}; - 33 -> {34}; - - subgraph cluster_10 { - color=red - 35 [label="Enter function getValue" style="filled" fillcolor=red]; - subgraph cluster_11 { + 22 [label="Enter class IssuesListUserProfile" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 36 [label="Enter block"]; - 37 [label="Function call: R|/IssueListView.IssueListView|()"]; - 38 [label="Jump: ^getValue R|/IssueListView.IssueListView|()"]; - 39 [label="Stub" style="filled" fillcolor=gray]; - 40 [label="Exit block" style="filled" fillcolor=gray]; + 39 [label="Enter class " style="filled" fillcolor=red]; + 40 [label="Exit class " style="filled" fillcolor=red]; } - 41 [label="Exit function getValue" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 24 [label="Enter property" style="filled" fillcolor=red]; + 25 [label="Postponed enter to lambda"]; + 26 [label="Postponed exit from lambda"]; + 27 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; + 28 [label="Access variable this@R|/IssuesListUserProfile|"]; + 29 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)"]; + 30 [label="Postponed enter to lambda"]; + subgraph cluster_11 { + color=blue + 34 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 35 [label="Enter block"]; + 36 [label="Exit anonymous object"]; + 37 [label="Exit block"]; + } + 38 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 31 [label="Postponed exit from lambda"]; + 32 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; + 33 [label="Exit property" style="filled" fillcolor=red]; + } + 23 [label="Exit class IssuesListUserProfile" style="filled" fillcolor=red]; } + 22 -> {24} [color=green]; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31 34}; + 31 -> {32}; + 32 -> {33}; + 33 -> {23} [color=green]; + 34 -> {35}; 35 -> {36}; + 35 -> {44 47 54} [color=red]; 36 -> {37}; 37 -> {38}; - 38 -> {41}; - 38 -> {39} [style=dotted]; - 39 -> {40} [style=dotted]; - 40 -> {41} [style=dotted]; + 39 -> {40} [color=green]; - subgraph cluster_12 { + subgraph cluster_13 { color=red - 42 [label="Enter function setValue" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 43 [label="Enter block"]; - 44 [label="Function call: R|/IssueListView.IssueListView|()"]; - 45 [label="Access variable R|/value|"]; - 46 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)"]; - 47 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|)"]; - 48 [label="Stub" style="filled" fillcolor=gray]; - 49 [label="Exit block" style="filled" fillcolor=gray]; - } - 50 [label="Exit function setValue" style="filled" fillcolor=red]; + 41 [label="Enter function " style="filled" fillcolor=red]; + 42 [label="Delegated constructor call: super|>()"]; + 43 [label="Exit function " style="filled" fillcolor=red]; } + 41 -> {42}; 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {50}; - 47 -> {48} [style=dotted]; - 48 -> {49} [style=dotted]; - 49 -> {50} [style=dotted]; subgraph cluster_14 { color=red - 51 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 52 [label="Enter block"]; - 53 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; - 54 [label="Access variable this@R|/IssuesListUserProfile|"]; - 55 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; - 56 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; - 57 [label="Stub" style="filled" fillcolor=gray]; - 58 [label="Exit block" style="filled" fillcolor=gray]; - } - 59 [label="Exit function getter" style="filled" fillcolor=red]; + 44 [label="Enter function " style="filled" fillcolor=red]; + 45 [label="Delegated constructor call: super()"]; + 46 [label="Exit function " style="filled" fillcolor=red]; + } + 44 -> {45}; + 45 -> {46}; + + subgraph cluster_15 { + color=red + 47 [label="Enter function getValue" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 48 [label="Enter block"]; + 49 [label="Function call: R|/IssueListView.IssueListView|()"]; + 50 [label="Jump: ^getValue R|/IssueListView.IssueListView|()"]; + 51 [label="Stub" style="filled" fillcolor=gray]; + 52 [label="Exit block" style="filled" fillcolor=gray]; + } + 53 [label="Exit function getValue" style="filled" fillcolor=red]; + } + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {53}; + 50 -> {51} [style=dotted]; + 51 -> {52} [style=dotted]; + 52 -> {53} [style=dotted]; + + subgraph cluster_17 { + color=red + 54 [label="Enter function setValue" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 55 [label="Enter block"]; + 56 [label="Function call: R|/IssueListView.IssueListView|()"]; + 57 [label="Access variable R|/value|"]; + 58 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)"]; + 59 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|)"]; + 60 [label="Stub" style="filled" fillcolor=gray]; + 61 [label="Exit block" style="filled" fillcolor=gray]; + } + 62 [label="Exit function setValue" style="filled" fillcolor=red]; } - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; 54 -> {55}; 55 -> {56}; - 56 -> {59}; - 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 58 -> {59} [style=dotted]; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {62}; + 59 -> {60} [style=dotted]; + 60 -> {61} [style=dotted]; + 61 -> {62} [style=dotted]; - subgraph cluster_16 { + subgraph cluster_19 { color=red - 60 [label="Enter function setter" style="filled" fillcolor=red]; - subgraph cluster_17 { + 63 [label="Enter function getter" style="filled" fillcolor=red]; + subgraph cluster_20 { color=blue - 61 [label="Enter block"]; - 62 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; - 63 [label="Access variable this@R|/IssuesListUserProfile|"]; - 64 [label="Access variable R|/issueListView|"]; - 65 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; - 66 [label="Exit block"]; + 64 [label="Enter block"]; + 65 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; + 66 [label="Access variable this@R|/IssuesListUserProfile|"]; + 67 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; + 68 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; + 69 [label="Stub" style="filled" fillcolor=gray]; + 70 [label="Exit block" style="filled" fillcolor=gray]; } - 67 [label="Exit function setter" style="filled" fillcolor=red]; + 71 [label="Exit function getter" style="filled" fillcolor=red]; } - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; + 67 -> {68}; + 68 -> {71}; + 68 -> {69} [style=dotted]; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; - subgraph cluster_18 { + subgraph cluster_21 { color=red - 78 [label="Enter class IssuesListUserProfile" style="filled" fillcolor=red]; - subgraph cluster_19 { + 72 [label="Enter function setter" style="filled" fillcolor=red]; + subgraph cluster_22 { color=blue - 30 [label="Enter class " style="filled" fillcolor=red]; - 31 [label="Exit class " style="filled" fillcolor=red]; + 73 [label="Enter block"]; + 74 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; + 75 [label="Access variable this@R|/IssuesListUserProfile|"]; + 76 [label="Access variable R|/issueListView|"]; + 77 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|FakeOverride|(...)"]; + 78 [label="Exit block"]; } - subgraph cluster_20 { - color=blue - 68 [label="Enter property" style="filled" fillcolor=red]; - 69 [label="Postponed enter to lambda"]; - 70 [label="Postponed exit from lambda"]; - 71 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; - 72 [label="Access variable this@R|/IssuesListUserProfile|"]; - 73 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)"]; - 74 [label="Postponed enter to lambda"]; - subgraph cluster_21 { - color=blue - 25 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 26 [label="Enter block"]; - 27 [label="Exit anonymous object"]; - 28 [label="Exit block"]; - } - 29 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 75 [label="Postponed exit from lambda"]; - 76 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; - 77 [label="Exit property" style="filled" fillcolor=red]; - } - 79 [label="Exit class IssuesListUserProfile" style="filled" fillcolor=red]; + 79 [label="Exit function setter" style="filled" fillcolor=red]; } - 78 -> {68} [color=green]; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; 72 -> {73}; 73 -> {74}; - 74 -> {75 25}; + 74 -> {75}; 75 -> {76}; 76 -> {77}; - 77 -> {79} [color=green]; - 25 -> {26}; - 26 -> {27}; - 26 -> {32 35 42} [color=red]; - 27 -> {28}; - 28 -> {29}; - 30 -> {31} [color=green]; + 77 -> {78}; + 78 -> {79}; } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirControlFlowAnalyzer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirControlFlowAnalyzer.kt index 0aa4a4cf1ef..ed510cc850b 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirControlFlowAnalyzer.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirControlFlowAnalyzer.kt @@ -13,6 +13,8 @@ import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ControlFlowGraph class FirControlFlowAnalyzer { + private val propertyInitializationAnalyzer = FirPropertyInitializationAnalyzer() + fun analyzeClassInitializer(klass: FirClass<*>, graph: ControlFlowGraph, context: CheckerContext, reporter: DiagnosticReporter) { if (graph.owner != null) return // TODO() @@ -20,11 +22,11 @@ class FirControlFlowAnalyzer { fun analyzeFunction(function: FirFunction<*>, graph: ControlFlowGraph, context: CheckerContext, reporter: DiagnosticReporter) { if (graph.owner != null) return - // TODO() + propertyInitializationAnalyzer.analyze(graph, reporter) } fun analyzePropertyInitializer(property: FirProperty, graph: ControlFlowGraph, context: CheckerContext, reporter: DiagnosticReporter) { if (graph.owner != null) return // TODO() } -} \ No newline at end of file +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirPropertyInitializationAnalyzer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirPropertyInitializationAnalyzer.kt new file mode 100644 index 00000000000..4f10f0b7bb1 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirPropertyInitializationAnalyzer.kt @@ -0,0 +1,129 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.cfa + +import kotlinx.collections.immutable.PersistentMap +import kotlinx.collections.immutable.persistentMapOf +import org.jetbrains.kotlin.contracts.description.InvocationKind +import org.jetbrains.kotlin.contracts.description.isDefinitelyVisited +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.* +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol + +class FirPropertyInitializationAnalyzer { + fun analyze(graph: ControlFlowGraph, reporter: DiagnosticReporter) { + val localProperties = LocalPropertyCollector.collect(graph) + // we want to analyze only properties without initializers + localProperties.retainAll { it.fir.initializer == null && it.fir.delegate == null } + if (localProperties.isEmpty()) return + val data = graph.collectDataForNode(TraverseDirection.Forward, PropertyInitializationInfo.EMPTY, DataCollector(localProperties)) + val reporterVisitor = UninitializedPropertyReporter(data, localProperties, reporter) + graph.traverse(TraverseDirection.Forward, reporterVisitor) + } + + private class UninitializedPropertyReporter( + val data: Map, PropertyInitializationInfo>, + val localProperties: Set, + val reporter: DiagnosticReporter + ) : ControlFlowGraphVisitorVoid() { + override fun visitNode(node: CFGNode<*>) {} + + override fun visitQualifiedAccessNode(node: QualifiedAccessNode) { + val reference = node.fir.calleeReference as? FirResolvedNamedReference ?: return + val symbol = reference.resolvedSymbol as? FirPropertySymbol ?: return + if (symbol !in localProperties) return + val kind = data.getValue(node)[symbol] ?: InvocationKind.ZERO + if (!kind.isDefinitelyVisited()) { + node.fir.source?.let { + reporter.report(FirErrors.UNINITIALIZED_VARIABLE.on(it, symbol)) + } + } + } + } + + private class PropertyInitializationInfo( + map: PersistentMap = persistentMapOf() + ) : ControlFlowInfo(map) { + companion object { + val EMPTY = PropertyInitializationInfo() + } + + override val constructor: (PersistentMap) -> PropertyInitializationInfo = + ::PropertyInitializationInfo + + fun merge(other: PropertyInitializationInfo): PropertyInitializationInfo { + var result = this + for (symbol in keys.union(other.keys)) { + val kind1 = this[symbol] ?: InvocationKind.ZERO + val kind2 = other[symbol] ?: InvocationKind.ZERO + result = result.put(symbol, kind1 or kind2) + } + return result + } + } + + private class LocalPropertyCollector private constructor() : ControlFlowGraphVisitorVoid() { + companion object { + fun collect(graph: ControlFlowGraph): MutableSet { + val collector = LocalPropertyCollector() + graph.traverse(TraverseDirection.Forward, collector) + return collector.symbols + } + } + + private val symbols: MutableSet = mutableSetOf() + + override fun visitNode(node: CFGNode<*>) {} + + override fun visitVariableDeclarationNode(node: VariableDeclarationNode) { + symbols += node.fir.symbol + } + } + + private class DataCollector(private val localProperties: Set) : ControlFlowGraphVisitor>() { + override fun visitNode(node: CFGNode<*>, data: Collection): PropertyInitializationInfo { + if (data.isEmpty()) return PropertyInitializationInfo.EMPTY + return data.reduce(PropertyInitializationInfo::merge) + } + + override fun visitVariableAssignmentNode( + node: VariableAssignmentNode, + data: Collection + ): PropertyInitializationInfo { + val dataForNode = visitNode(node, data) + val reference = node.fir.lValue as? FirResolvedNamedReference ?: return dataForNode + val symbol = reference.resolvedSymbol as? FirPropertySymbol ?: return dataForNode + return if (symbol !in localProperties) { + dataForNode + } else{ + processVariableWithAssignment(dataForNode, symbol) + } + } + + override fun visitVariableDeclarationNode( + node: VariableDeclarationNode, + data: Collection + ): PropertyInitializationInfo { + val dataForNode = visitNode(node, data) + return if (node.fir.initializer == null && node.fir.delegate == null) { + dataForNode + } else { + processVariableWithAssignment(dataForNode, node.fir.symbol) + } + } + + private fun processVariableWithAssignment( + dataForNode: PropertyInitializationInfo, + symbol: FirPropertySymbol + ): PropertyInitializationInfo { + val existingKind = dataForNode[symbol] ?: InvocationKind.ZERO + val kind = existingKind and InvocationKind.EXACTLY_ONCE + return dataForNode.put(symbol, kind) + } + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 895a9ff55f9..abc77892bb0 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.NULLABLE_STRING +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.PROPERTY_NAME import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.TO_STRING import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.AMBIGUITY @@ -16,6 +17,11 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DEPRECATED_MODIFI import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DESERIALIZATION_ERROR import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ENUM_AS_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ERROR_FROM_JAVA_RESOLUTION +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_FUNCTION_RETURN_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PARAMETER_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PROPERTY_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_RECEIVER_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_CONST_EXPRESSION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INAPPLICABLE_CANDIDATE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INCOMPATIBLE_MODIFIERS @@ -28,13 +34,9 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REPEATED_MODIFIER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SUPER_IS_NOT_AN_EXPRESSION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SYNTAX_ERROR import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_AS_SUPERTYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNINITIALIZED_VARIABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_LABEL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_REFERENCE -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_FUNCTION_RETURN_TYPE -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PROPERTY_TYPE -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_RECEIVER_TYPE -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PARAMETER_TYPE @Suppress("unused") class FirDefaultErrorMessages : DefaultErrorMessages.Extension { @@ -71,6 +73,9 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(EXPOSED_FUNCTION_RETURN_TYPE, "{0} function exposes its {2} return type{1}", TO_STRING, TO_STRING, TO_STRING) map.put(EXPOSED_RECEIVER_TYPE, "{0} member exposes its {2} receiver type{1}", TO_STRING, TO_STRING, TO_STRING) map.put(EXPOSED_PARAMETER_TYPE, "{0} function exposes its {2} parameter type{1}", TO_STRING, TO_STRING, TO_STRING) + + // Control flow diagnostics + map.put(UNINITIALIZED_VARIABLE, "{2} must be initialized before access", PROPERTY_NAME) } } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index 11628eaf7ed..a99b2c31ce1 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.Renderer import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol object FirDiagnosticRenderers { val NULLABLE_STRING = Renderer { it ?: "null" } @@ -26,4 +27,8 @@ object FirDiagnosticRenderers { val TO_STRING = Renderer { element: Any -> element.toString() } + + val PROPERTY_NAME = Renderer { symbol: FirPropertySymbol -> + symbol.fir.name.asString() + } } \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 9d65be88378..3de89d635cf 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.fir.DeclarationWithRelation import org.jetbrains.kotlin.fir.FirEffectiveVisibility import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.psi.* @@ -75,6 +76,9 @@ object FirErrors { val REDUNDANT_MODIFIER by error2() val DEPRECATED_MODIFIER_PAIR by error2() val INCOMPATIBLE_MODIFIERS by error2() + + // Control flow diagnostics + val UNINITIALIZED_VARIABLE by error1() } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.fir.kt index c63bea9bf28..816c8a0aec8 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.fir.kt @@ -9,13 +9,13 @@ fun doSmth(i: Int) {} fun t1(b : Boolean) { val v : Int - if (v == 0) {} + if (v == 0) {} var u: String if (b) { u = "s" } - doSmth(u) + doSmth(u) var r: String if (b) { @@ -28,10 +28,10 @@ fun t1(b : Boolean) { var t: String if (b) - doSmth(t) + doSmth(t) else t = "ss" - doSmth(t) //repeat for t + doSmth(t) //repeat for t val i = 3 doSmth(i) @@ -207,7 +207,7 @@ class LocalValsVsProperties(val a: Int, w: Int) : Open(a, w) { val r : Int doSmth(x) doSmth(y) - doSmth(r) + doSmth(r) doSmth(a) } var xx = w @@ -257,7 +257,7 @@ class ClassObject() { fun foo() { val a : Int - doSmth(a) + doSmth(a) } } } @@ -317,7 +317,7 @@ object TestObjectDeclaration { if (1 < 3) { i = 10 } - doSmth(i) + doSmth(i) } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/checkPropertyAccessor.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/checkPropertyAccessor.fir.kt index 98f5d3afdc9..8ad3360dbd1 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/checkPropertyAccessor.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/checkPropertyAccessor.fir.kt @@ -12,7 +12,7 @@ val a: Int return d } - return b + return b } class A { @@ -21,7 +21,7 @@ class A { val b: Int val c: Int 42 - return b + return b } fun foo() { @@ -31,7 +31,7 @@ class A { val b: Int val c: Int 42 - return b + return b } } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLambda.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLambda.fir.kt index d08d21af1f0..b3532f50417 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLambda.fir.kt @@ -11,7 +11,7 @@ fun foo() { x = 42 } // Error! - x.hashCode() + x.hashCode() } fun bar() { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalClass.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalClass.fir.kt index 95a87ad0c5b..8e6c0e90ff4 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalClass.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalClass.fir.kt @@ -8,7 +8,7 @@ fun foo() { } } // Error! See KT-10042 - x.length + x.length } fun bar() { @@ -19,7 +19,7 @@ fun bar() { } } // Ok - x.length + x.length } fun gav() { @@ -31,7 +31,7 @@ fun gav() { } } // Error! See KT-10042 - x.length + x.length val y: String class C(val s: String) { constructor(): this("") { @@ -39,7 +39,7 @@ fun gav() { y = s } } - y.length + y.length } open class Gau(val s: String) @@ -53,7 +53,7 @@ fun gau() { } } // Ok - x.length + x.length val y: String fun local() { object: Any() { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.fir.kt deleted file mode 100644 index 7a73b9b2a62..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun foo() { - var x: Int - fun bar() { - x = 42 - } - x.hashCode() - bar() -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.kt index b1c8a673971..c442d1a2767 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/initializationInLocalFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo() { var x: Int fun bar() { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.fir.kt deleted file mode 100644 index 1f464cc382f..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -//KT-2369 Variable is not marked as uninitialized in 'finally' section - -fun main() { - var x : Int - try { - throw Exception() - } - finally { - doSmth(x + 1) - } -} - -fun doSmth(a: Any?) = a \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.kt index 9177ecf7b61..b7bc931bd21 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2369.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2369 Variable is not marked as uninitialized in 'finally' section fun main() { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2845.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2845.fir.kt index c77cd41a908..8e017951097 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2845.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2845.fir.kt @@ -12,7 +12,7 @@ private fun doTest() : Int { return 0 ; } finally { - if(list != null) { // Must be an ERROR + if(list != null) { // Must be an ERROR } } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2960.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2960.fir.kt index 0058a90febb..39fcd820981 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2960.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2960.fir.kt @@ -15,7 +15,7 @@ val o = object { p.x = 4 val z : Int - doSmth(z) + doSmth(z) } } @@ -28,7 +28,7 @@ class A { val a : Int = 1 get() { val x : Int - doSmth(x) + doSmth(x) return field } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInTryCatchWithJumps.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInTryCatchWithJumps.fir.kt index ea546d9889d..dc5d9650e5f 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInTryCatchWithJumps.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/reassignmentInTryCatchWithJumps.fir.kt @@ -15,7 +15,7 @@ fun f1(flag: Boolean) { // KT-13612: reassignment n = 3 } - n.hashCode() + n.hashCode() } fun f2(flag: Boolean) { @@ -32,7 +32,7 @@ fun f2(flag: Boolean) { // KT-13612: reassignment n = 3 } - n.hashCode() + n.hashCode() } } @@ -50,6 +50,6 @@ fun f3(flag: Boolean) { // KT-13612: reassignment n = 3 } - n.hashCode() + n.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.fir.kt index 0f944cb0c97..3fbfbe21626 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.fir.kt @@ -10,6 +10,6 @@ class C { fun foo() { val a : Int - a + 1 - a + 1 + a + 1 + a + 1 } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/uninitializedInLocalDeclarations.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/uninitializedInLocalDeclarations.fir.kt index 7182fbeede5..e1c27fe15c1 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/uninitializedInLocalDeclarations.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/uninitializedInLocalDeclarations.fir.kt @@ -23,14 +23,14 @@ fun test2() { fun test3() { val f = { val a : Int - doSmth(a) + doSmth(a) } } fun test4() { doSmth { val a : Int - doSmth(a) + doSmth(a) } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.fir.kt deleted file mode 100644 index 9c6fef2ec46..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun bar(f: () -> Unit) = f() - -fun foo() { - var v: Any - bar { v.hashCode() } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.kt index 1b99ba205b8..ab423f6c605 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/useUninitializedInLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(f: () -> Unit) = f() fun foo() { diff --git a/compiler/testData/diagnostics/tests/j+k/kt2619.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt2619.fir.kt index 9613d6f02fc..cd19e54d1eb 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2619.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2619.fir.kt @@ -1,7 +1,7 @@ //FILE: foo.kt fun main() { val c: Type - when (c) { + when (c) { } } diff --git a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt new file mode 100644 index 00000000000..dc2735b53da --- /dev/null +++ b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt @@ -0,0 +1,24 @@ +// !LANGUAGE: +LateinitLocalVariables + +fun test1() { + lateinit var s: String + s.length +} + +fun test2() { + lateinit var s: String + run { + s = "" + } + s.length +} + +fun almostAlwaysTrue(): Boolean = true + +fun test3() { + lateinit var s: String + if (almostAlwaysTrue()) { + s = "" + } + s.length +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt index 8c21c4e3258..090a7d0cce9 100644 --- a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt +++ b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !LANGUAGE: +LateinitLocalVariables fun test1() { diff --git a/compiler/testData/diagnostics/tests/reassignment/foronly.fir.kt b/compiler/testData/diagnostics/tests/reassignment/foronly.fir.kt index bc5907df2c1..b5441ce1ff7 100644 --- a/compiler/testData/diagnostics/tests/reassignment/foronly.fir.kt +++ b/compiler/testData/diagnostics/tests/reassignment/foronly.fir.kt @@ -5,5 +5,5 @@ fun foo(k: Int): Int { for (j in 1..k) { i = j } - return i + return i } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt455.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt455.fir.kt index fb57b0d1f06..d49652f1ed2 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt455.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt455.fir.kt @@ -4,7 +4,7 @@ package kt455 fun foo() { val a: Int - doSmth(a) //error - doSmth(a) //no repeat error + doSmth(a) //error + doSmth(a) //no repeat error } fun doSmth(i: Int) {} diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt index 3a4519f7069..241ae124690 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt @@ -4,7 +4,7 @@ public fun foo(x: String?): Int { y = if (x == null) break else x } // In future we can infer this initialization - y.hashCode() + y.hashCode() // x is null because of the break return x.length } diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.fir.kt index a1ec917c645..27e53b8833c 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.fir.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveValOverConditionalInit.fir.kt @@ -18,5 +18,5 @@ fun bar(a: Boolean, b: Boolean): Int { when (b) { false -> x = 3 } - return x + return x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.fir.kt index 17994c2be70..50d1442f1cf 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.fir.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveVarOverConditionalInit.fir.kt @@ -18,5 +18,5 @@ fun bar(a: Boolean, b: Boolean): Int { when (b) { false -> x = 3 } - return x + return x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/unsupportedVariableDeclarationsInWhenSubject.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unsupportedVariableDeclarationsInWhenSubject.fir.kt index bdfbe8f64f0..e620befb326 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/unsupportedVariableDeclarationsInWhenSubject.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/unsupportedVariableDeclarationsInWhenSubject.fir.kt @@ -12,7 +12,7 @@ fun testSimpleValInWhenSubject() { fun testValWithoutInitializerWhenSubject() { when (val y: Any) { - is String -> y.length + is String -> y.length } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.fir.kt index 16a2a4916d9..925335b16e3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.fir.kt @@ -44,7 +44,7 @@ fun threeLevelsReturnNoInitialization(x: Int?): Int? { // Possible to report unreachable here y = 54 } - return y.inc() + return y.inc() } fun threeLevelsReturnWithInitialization(x: Int?): Int? { @@ -82,5 +82,5 @@ fun threeLevelsReturnWithUnknown(x: Int?): Int? { } } } - return y.inc() + return y.inc() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.fir.kt index 1c0335c28c2..f9df882365a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.fir.kt @@ -36,7 +36,7 @@ fun outerFinallyInitializes() { x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized - x.inc() + x.inc() log() } finally { // Possible reassignment (e.g. if everything finished) diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchs.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchs.fir.kt index 7034751ecd1..0376bb6d27f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchs.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchs.fir.kt @@ -37,7 +37,7 @@ fun innerTryCatchInitializes() { // Can get here if innerComputation() threw an exception that wasn't catched by the inner catch (x is not initialized) // OR if outerComputation() threw an exception (x is initialized because we reach outer computation only when inner finished ok) // So, x=I? here - x.inc() + x.inc() // Potential reasignment x = 42 diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonReturningInlinedLambda.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonReturningInlinedLambda.fir.kt index bc6f7baa181..fd625cf422c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonReturningInlinedLambda.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonReturningInlinedLambda.fir.kt @@ -21,7 +21,7 @@ fun withLabeledReturn() { y = 42 } - println(y) + println(y) println(x) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/severalJumpOutsFromInlinedLambda.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/severalJumpOutsFromInlinedLambda.fir.kt index 24c484e8e91..8bc4b931535 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/severalJumpOutsFromInlinedLambda.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/severalJumpOutsFromInlinedLambda.fir.kt @@ -33,7 +33,7 @@ fun exitOnlyThroughLocalReturns(b: Boolean) { } x.inc() - s.length + s.length } fun exitOnlyThroughNonLocalReturns(b: Boolean?) { @@ -49,7 +49,7 @@ fun exitOnlyThroughNonLocalReturns(b: Boolean?) { x = 54 } - if (x == 42) { + if (x == 42) { return } else { @@ -59,8 +59,8 @@ fun exitOnlyThroughNonLocalReturns(b: Boolean?) { } } - x.inc() - s.length + x.inc() + s.length } fun nonLocalReturnAndOrdinaryExit(b: Boolean) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/throwIfNotCalled.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/throwIfNotCalled.fir.kt index e8deda72a6c..b3ba1db5f40 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/throwIfNotCalled.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/throwIfNotCalled.fir.kt @@ -44,5 +44,5 @@ fun catchThrowIfNotCalled() { } catch (ignored: java.lang.IllegalArgumentException) { } // x *isn't* initialized here! - println(x) + println(x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/tryCatch.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/tryCatch.fir.kt index 549325b6b8b..ec05a6d18fc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/tryCatch.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/tryCatch.fir.kt @@ -22,7 +22,7 @@ fun tryCatchInlined() { x.inc() } catch (e: java.lang.Exception) { - x.inc() + x.inc() } } x = 42 diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/valDefiniteReassignment.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/valDefiniteReassignment.fir.kt index 2dc03211a3d..ad3579b333a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/valDefiniteReassignment.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/valDefiniteReassignment.fir.kt @@ -21,7 +21,7 @@ fun runOnce(block: () -> T): T { fun valueReassignment() { val x: Int - x.inc() + x.inc() runTwice { x = 42 } x.inc() } @@ -29,12 +29,12 @@ fun valueReassignment() { fun shadowing() { val x: Int runTwice { val x: Int; x = 42; x.inc() } - x.inc() + x.inc() } fun branchingFlow(a: Any?) { val x: Int - x.inc() + x.inc() if (a is String) { runTwice { x = 42 } } @@ -50,18 +50,18 @@ fun branchingFlowWithMissingBranches(a: Any?) { runTwice { x = 42 } } - x.inc() + x.inc() } fun repeatingFlow(n: Int) { val x: Int - x.inc() + x.inc() for (i in 1..n) { runTwice { x = 42 } } - x.inc() + x.inc() } fun repeatingFlow2(n: Int) { @@ -71,5 +71,5 @@ fun repeatingFlow2(n: Int) { runTwice { x = 42 } } - x.inc() + x.inc() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.fir.kt deleted file mode 100644 index dae551d2c74..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -fun runTwice(block: () -> T): T { - contract { - callsInPlace(block, InvocationKind.AT_LEAST_ONCE) - } - block() - return block(); -}; - -fun testInitialization() { - var x: Int - x.inc() - runTwice { x = 42 } - x.inc() - x = 43 - x.inc() -} - -fun repeatingFlow(n: Int) { - var x: Int - for (i in 1..n) { - runTwice { x = 42 } - } - x.inc() -} - diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.kt index 299a2a32c11..40bb9f5e4fa 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varDefiniteInitialization.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varIndefiniteIntialization.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varIndefiniteIntialization.fir.kt index 09ca700a4e2..f5f67ce8c1f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varIndefiniteIntialization.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/atLeastOnce/varIndefiniteIntialization.fir.kt @@ -19,11 +19,11 @@ fun indefiniteFlow() { funWithUnknownInvocations { runTwice { x = 42 } } - x.inc() + x.inc() } fun shadowing() { var x: Int runTwice { val x: Int; x = 42; x.inc() } - x.inc() + x.inc() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/valIndefiniteInitialization.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/valIndefiniteInitialization.fir.kt index 58c2c58fef9..885fd63904c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/valIndefiniteInitialization.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/valIndefiniteInitialization.fir.kt @@ -31,14 +31,14 @@ fun branchingIndetermineFlow(a: Any?) { myRun { x = 43 } } - x.inc() + x.inc() } fun nonAnonymousLambdas() { val x: Int val initializer = { x = 42 } myRun(initializer) - x.inc() + x.inc() } fun multipleAssignments() { @@ -47,7 +47,7 @@ fun multipleAssignments() { // Val reassignment because we know that repeat's lambda called in-place myRun { x = 42 } } - x.inc() + x.inc() } fun funWithUnknownInvocations(block: () -> Unit) = block() @@ -56,7 +56,7 @@ fun nestedIndefiniteAssignment() { val x: Int // Captured val initialization reported, because we don't know anything about funWithUnknownInvocations funWithUnknownInvocations { myRun { x = 42 } } - x.inc() + x.inc() } class InitializationForbiddenInNonInitSection { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varIndefiniteInitialization.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varIndefiniteInitialization.fir.kt index 54fe4eac746..923f73b7eda 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varIndefiniteInitialization.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varIndefiniteInitialization.fir.kt @@ -16,7 +16,7 @@ fun indefiniteVarReassignment(n: Int) { repeat(n) { myRun { x = 42 } } - x.inc() + x.inc() } fun nonAnonymousLambdas() { @@ -24,7 +24,7 @@ fun nonAnonymousLambdas() { var x: Int val initializer = { x = 42 } myRun(initializer) - x.inc() + x.inc() } fun branchingIndetermineFlow(a: Any) { @@ -39,7 +39,7 @@ fun branchingIndetermineFlow(a: Any) { myRun { x = 43 } } - x.inc() + x.inc() } fun funWithUnknownInvocations(block: () -> Unit) = block() @@ -47,5 +47,5 @@ fun funWithUnknownInvocations(block: () -> Unit) = block() fun nestedIndefiniteAssignment() { val x: Int funWithUnknownInvocations { myRun { x = 42 } } - x.inc() + x.inc() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.fir.kt deleted file mode 100644 index 4df46d06195..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -fun T.myLet(block: (T) -> R): R { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - return block(this) -} - -fun initializationWithReceiver(y: String) { - val x: Int - y.myLet { x = 42 } - x.inc() -} - -fun initializationWithSafeCall(y: String?) { - val x: Int - y?.myLet { x = 42 } - x.inc() -} - -fun sanityCheck(x: Int, y: String): Int { - y.let { return x } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.kt index 67bed1b860e..1ae884e790f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/withReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/unknown/unknownInvocations.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/unknown/unknownInvocations.fir.kt index b3affbf0f8a..4fd09584022 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/unknown/unknownInvocations.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/unknown/unknownInvocations.fir.kt @@ -14,5 +14,5 @@ fun inPlace(block: () -> T): T { fun reassignmentAndNoInitializaiton() { val x: Int inPlace { x = 42 } - x.inc() + x.inc() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.fir.kt index 19704fd1dcd..9bb13f9070d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.fir.kt @@ -88,7 +88,7 @@ fun testRepeatOnVal(x: Int) { // reassignment instead of captured val initialization y = 42 } - println(y) + println(y) } fun testRepeatOnVar(x: Int) { @@ -98,7 +98,7 @@ fun testRepeatOnVar(x: Int) { y = 42 } // but here we still unsure if 'y' was initialized - println(y) + println(y) } fun testRepeatOnInitializedVar(x: Int) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/multieffect/returnsAndCalls.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/multieffect/returnsAndCalls.fir.kt index 3491f299fc4..6e490586931 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/multieffect/returnsAndCalls.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/multieffect/returnsAndCalls.fir.kt @@ -34,14 +34,14 @@ fun inPresenceOfLazy(x: Any?, unknownBoolean: Boolean) { val y: Int if (unknownBoolean && callsAndInverts(x !is String) { y = 42 }) { - println(y) + println(y) x.length } else { - println(y) + println(y) x.length } - println(y) + println(y) } fun isPresenceOfLazy2(x: Any?, unknownBoolean: Boolean) { @@ -50,10 +50,10 @@ fun isPresenceOfLazy2(x: Any?, unknownBoolean: Boolean) { x.length } else { - println(y) + println(y) x.length } - println(y) + println(y) } fun isPresenceOfLazy3(x: Any?, unknownBoolean: Boolean) { @@ -64,5 +64,5 @@ fun isPresenceOfLazy3(x: Any?, unknownBoolean: Boolean) { else { x.length } - println(y) + println(y) } \ No newline at end of file diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.fir.kt new file mode 100644 index 00000000000..2b2abf3970a --- /dev/null +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.fir.kt @@ -0,0 +1,32 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// SKIP_TXT + + +/* + * TESTCASE NUMBER: 1 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35565 + */ +fun case1() { + val x1: String + val x: Boolean + try { + val x0: Boolean = (throw Exception()) || true + !x // UNINITIALIZED_VARIABLE should be + val a: Int = x1.toInt() // UNINITIALIZED_VARIABLE should be + } catch (e: Exception) { + } +} +/* + * TESTCASE NUMBER: 2 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35565 + */ +fun case2() { + val x: Boolean = false + try { + x = (throw Exception()) || true //VAL_REASSIGNMENT should be + } catch (e: Exception) { + } +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.kt index 314cd90bb89..c4d6b3c6729 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt index 703a8091e15..21ef60422e0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt @@ -44,10 +44,10 @@ import contracts.* fun case_1(value_1: Int?) { val value_2: Int if (contracts.case_1(value_1) { value_2 = 10 }) { - println(value_2) + println(value_2) } else { value_1.inv() - println(value_2) + println(value_2) } } @@ -57,18 +57,18 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { when (value_1.case_2(value_2, value_3) { value_4 = 10 }) { true -> { println(value_3?.xor(true)) - println(value_4) + println(value_4) println(value_1.inv()) println(value_2.inv()) } false -> { - println(value_4) + println(value_4) println(value_1) println(value_2) } null -> { println(value_3?.xor(true)) - println(value_4) + println(value_4) println(value_1) println(value_2) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/1.fir.kt index 653e0528585..bc31ca37459 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/1.fir.kt @@ -12,14 +12,14 @@ fun case_1() { fun case_2() { val value_1: Int funWithAtMostOnceCallsInPlace { value_1 = 10 } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 3 fun case_3() { val value_1: Int funWithUnknownCallsInPlace { value_1 = 10 } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 4 @@ -28,8 +28,8 @@ fun case_4() { var value_2: Int funWithAtMostOnceCallsInPlace { value_1 = 10 } funWithUnknownCallsInPlace { value_2 = 10 } - value_1.dec() - value_2.div(10) + value_1.dec() + value_2.div(10) } // TESTCASE NUMBER: 5 @@ -53,7 +53,7 @@ fun case_6() { val value_1: Int for (i in 0..1) funWithExactlyOnceCallsInPlace { value_1 = 10 } - value_1.dec() + value_1.dec() } // TESTCASE NUMBER: 7 @@ -64,12 +64,12 @@ fun case_7() { funWithExactlyOnceCallsInPlace { value_1 = 10 } i++ } - value_1.dec() + value_1.dec() } // TESTCASE NUMBER: 8 fun case_8() { var value_1: Int if (true) funWithAtLeastOnceCallsInPlace { value_1 = 10 } - value_1.dec() + value_1.dec() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/2.fir.kt index 3097b7097d4..cb1e103b842 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/2.fir.kt @@ -12,11 +12,11 @@ fun case_1() { } } funWithExactlyOnceCallsInPlace { - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 2 @@ -27,14 +27,14 @@ fun case_2() { value_1 = 1 } funWithAtLeastOnceCallsInPlace { - value_1.inc() + value_1.inc() } funWithUnknownCallsInPlace { - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 3 @@ -48,11 +48,11 @@ fun case_3() { } } funWithExactlyOnceCallsInPlace { - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 4 @@ -63,15 +63,15 @@ fun case_4() { value_1 = 1 } funWithAtLeastOnceCallsInPlace { - value_1.inc() + value_1.inc() } funWithUnknownCallsInPlace { - value_1.inc() + value_1.inc() } funWithExactlyOnceCallsInPlace { - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/3.fir.kt index adfabb1dbd9..b9e7dd10574 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/3.fir.kt @@ -12,7 +12,7 @@ fun case_1(value_1: EnumClass?) { null -> funWithExactlyOnceCallsInPlace { value_2 = 5 } } - value_2.inc() + value_2.inc() } // TESTCASE NUMBER: 2 @@ -27,9 +27,9 @@ fun case_2(value_1: Any?) { } else { funWithAtMostOnceCallsInPlace { value_2 = 2 } } - value_2.dec() + value_2.dec() } - value_2.dec() + value_2.dec() } // TESTCASE NUMBER: 3 @@ -65,9 +65,9 @@ fun case_4(value_1: EnumClassSingle?) { funWithUnknownCallsInPlace { value_2 = 2 } } } - value_2.minus(5) + value_2.minus(5) } - value_2.minus(5) + value_2.minus(5) } // TESTCASE NUMBER: 5 @@ -80,7 +80,7 @@ fun case_5() { funWithAtMostOnceCallsInPlace { value_2 = 1 } } - value_2++ + value_2++ } // TESTCASE NUMBER: 6 @@ -92,10 +92,10 @@ fun case_6() { } catch (e: Exception) { throw Exception() } finally { - println(value_2.inc()) + println(value_2.inc()) } - value_2++ + value_2++ } // TESTCASE NUMBER: 7 @@ -112,7 +112,7 @@ fun case_7() { } } - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 8 @@ -127,7 +127,7 @@ fun case_8() { } throw Exception() } - println(x.inc()) + println(x.inc()) } // TESTCASE NUMBER: 9 @@ -139,7 +139,7 @@ fun case_9() { return@outer } } - println(x.inc()) + println(x.inc()) } // TESTCASE NUMBER: 10 @@ -156,5 +156,5 @@ fun case_10() { } return@outer } - println(x.inc()) + println(x.inc()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/4.fir.kt index fad6b8b1bec..2e0b1721e68 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/4.fir.kt @@ -8,7 +8,7 @@ fun case_1() { val value_1 = 10 value_1.inc() } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 2 @@ -24,7 +24,7 @@ fun case_2() { } value_1.inc() } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 3 @@ -36,14 +36,14 @@ fun case_3() { value_1 = 10 } funWithAtMostOnceCallsInPlace { - value_1.inc() + value_1.inc() } - value_1.inc() + value_1.inc() } funWithAtMostOnceCallsInPlace { value_1 = 10 } - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 4 @@ -62,7 +62,7 @@ fun case_4() { funWithAtMostOnceCallsInPlace { value_1 = 1 } - value_1.dec() + value_1.dec() } // TESTCASE NUMBER: 5 @@ -81,5 +81,5 @@ fun case_5() { funWithUnknownCallsInPlace { value_1 = 1 } - value_1.dec() + value_1.dec() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/5.fir.kt index ff877b43dd4..81aa807f0e8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/5.fir.kt @@ -13,7 +13,7 @@ fun case_2() { var value_1: Int val l = { value_1 = 10 } funWithAtLeastOnceCallsInPlace(l) - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 3 @@ -21,7 +21,7 @@ fun case_3() { var value_1: Int val l = fun () { value_1 = 10 } funWithAtLeastOnceCallsInPlace(l) - value_1.inc() + value_1.inc() } // TESTCASE NUMBER: 4 @@ -38,5 +38,5 @@ fun case_5() { fun l() { value_1 = 10 } } funWithExactlyOnceCallsInPlace(o::l) - value_1.inc() + value_1.inc() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt index 42f82159aba..45a783c5d47 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt @@ -17,12 +17,12 @@ fun case_2(arg: Int?) { fun case_3() { val value_1: Boolean? funWithAtMostOnceCallsInPlace { value_1 = false } - value_1.not() + value_1.not() } // TESTCASE NUMBER: 4 fun case_4() { val value_1: Boolean? funWithUnknownCallsInPlace { value_1 = true } - value_1.not() + value_1.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt index 3a85f9d2a22..25246657bb7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt @@ -85,6 +85,6 @@ fun case_6() { null!! } - x - x.minus(10.0) + x + x.minus(10.0) }