diff --git a/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.fir.kts b/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.fir.kts deleted file mode 100644 index 856e85cef8b..00000000000 --- a/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.fir.kts +++ /dev/null @@ -1,3 +0,0 @@ -val x = y - -val y = 2 diff --git a/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.kts b/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.kts index 62532476e15..b4d981e92b9 100644 --- a/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.kts +++ b/compiler/testData/diagnostics/tests/script/AccessForwardDeclarationInScript.kts @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + val x = y val y = 2 diff --git a/compiler/testData/diagnostics/tests/script/ComplexScript.dot b/compiler/testData/diagnostics/tests/script/ComplexScript.dot index 2f778862fec..941339d7483 100644 --- a/compiler/testData/diagnostics/tests/script/ComplexScript.dot +++ b/compiler/testData/diagnostics/tests/script/ComplexScript.dot @@ -12,50 +12,59 @@ digraph ComplexScript_kts { subgraph cluster_1 { color=red - 2 [label="Enter function foo [3]" style="filled" fillcolor=red]; + 2 [label="Enter class [2]" style="filled" fillcolor=red]; subgraph cluster_2 { color=blue - 3 [label="Enter block [3]"]; - 4 [label="Const: Int(1) [3]"]; - 5 [label="Jump: ^foo Int(1) [3]"]; - 6 [label="Stub [3]" style="filled" fillcolor=gray]; - 7 [label="Exit block [3]" style="filled" fillcolor=gray]; + 3 [label="Enter property [3]" style="filled" fillcolor=red]; + 4 [label="Const: Int(2) [3]"]; + 5 [label="Exit property [3]" style="filled" fillcolor=red]; } - 8 [label="Exit function foo [3]" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 7 [label="Function call arguments enter [3]"]; + 8 [label="Access variable R|/y| [3]"]; + 9 [label="Function call arguments exit [3]"]; + } + 10 [label="Function call: R|/foo|(...) [3]" style="filled" fillcolor=yellow]; + 11 [label="Exit property [3]" style="filled" fillcolor=red]; + } + 12 [label="Exit class [2]" style="filled" fillcolor=red]; } - 2 -> {3}; + 2 -> {3} [color=green]; + 2 -> {12} [style=dotted]; + 2 -> {3 6} [style=dashed]; 3 -> {4}; 4 -> {5}; - 5 -> {8}; - 5 -> {6} [style=dotted]; - 6 -> {7} [style=dotted]; - 7 -> {8} [style=dotted]; - - subgraph cluster_3 { - color=red - 9 [label="Enter property [3]" style="filled" fillcolor=red]; - 10 [label="Const: Int(2) [3]"]; - 11 [label="Exit property [3]" style="filled" fillcolor=red]; - } + 5 -> {6} [color=green]; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; 9 -> {10}; 10 -> {11}; + 11 -> {12} [color=green]; - subgraph cluster_4 { + subgraph cluster_5 { color=red - 12 [label="Enter property [3]" style="filled" fillcolor=red]; - subgraph cluster_5 { + 13 [label="Enter function foo [3]" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 13 [label="Function call arguments enter [3]"]; - 14 [label="Access variable R|/y| [3]"]; - 15 [label="Function call arguments exit [3]"]; + 14 [label="Enter block [3]"]; + 15 [label="Const: Int(1) [3]"]; + 16 [label="Jump: ^foo Int(1) [3]"]; + 17 [label="Stub [3]" style="filled" fillcolor=gray]; + 18 [label="Exit block [3]" style="filled" fillcolor=gray]; } - 16 [label="Function call: R|/foo|(...) [3]" style="filled" fillcolor=yellow]; - 17 [label="Exit property [3]" style="filled" fillcolor=red]; + 19 [label="Exit function foo [3]" style="filled" fillcolor=red]; } - 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17}; + 16 -> {19}; + 16 -> {17} [style=dotted]; + 17 -> {18} [style=dotted]; + 18 -> {19} [style=dotted]; } diff --git a/compiler/testData/diagnostics/tests/script/LateInit.dot b/compiler/testData/diagnostics/tests/script/LateInit.dot new file mode 100644 index 00000000000..055e705448d --- /dev/null +++ b/compiler/testData/diagnostics/tests/script/LateInit.dot @@ -0,0 +1,38 @@ +digraph LateInit_kts { + graph [nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter file LateInit.kts [1]" style="filled" fillcolor=red]; + 1 [label="Exit file LateInit.kts [1]" style="filled" fillcolor=red]; + } + 0 -> {1} [color=green]; + + subgraph cluster_1 { + color=red + 2 [label="Enter class [2]" style="filled" fillcolor=red]; + 3 [label="Exit class [2]" style="filled" fillcolor=red]; + } + 2 -> {3} [color=green]; + + subgraph cluster_2 { + color=red + 4 [label="Enter function foo [3]" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 5 [label="Enter block [3]"]; + 6 [label="Const: String(Hello) [3]"]; + 7 [label="Assignment: R|/s| [3]"]; + 8 [label="Exit block [3]"]; + } + 9 [label="Exit function foo [3]" style="filled" fillcolor=red]; + } + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + +} diff --git a/compiler/testData/diagnostics/tests/script/LateInit.kts b/compiler/testData/diagnostics/tests/script/LateInit.kts index 07664b783d1..96198acac84 100644 --- a/compiler/testData/diagnostics/tests/script/LateInit.kts +++ b/compiler/testData/diagnostics/tests/script/LateInit.kts @@ -1,4 +1,6 @@ // FIR_IDENTICAL +// DUMP_CFG: LEVELS + lateinit var s: String fun foo() { diff --git a/compiler/testData/diagnostics/tests/script/NestedInnerClass.dot b/compiler/testData/diagnostics/tests/script/NestedInnerClass.dot index f7c3e780715..25cdc133efd 100644 --- a/compiler/testData/diagnostics/tests/script/NestedInnerClass.dot +++ b/compiler/testData/diagnostics/tests/script/NestedInnerClass.dot @@ -12,315 +12,324 @@ digraph NestedInnerClass_fir_kts { subgraph cluster_1 { color=red - 2 [label="Enter function function [3]" style="filled" fillcolor=red]; + 2 [label="Enter class [2]" style="filled" fillcolor=red]; subgraph cluster_2 { color=blue - 3 [label="Enter block [3]"]; - 4 [label="Const: Int(42) [3]"]; - 5 [label="Jump: ^function Int(42) [3]"]; - 6 [label="Stub [3]" style="filled" fillcolor=gray]; - 7 [label="Exit block [3]" style="filled" fillcolor=gray]; + 3 [label="Enter property [3]" style="filled" fillcolor=red]; + 4 [label="Const: String() [3]"]; + 5 [label="Exit property [3]" style="filled" fillcolor=red]; } - 8 [label="Exit function function [3]" style="filled" fillcolor=red]; + 6 [label="Exit class [2]" style="filled" fillcolor=red]; } - 2 -> {3}; + 2 -> {3} [color=green]; + 2 -> {6} [style=dotted]; + 2 -> {3} [style=dashed]; 3 -> {4}; 4 -> {5}; - 5 -> {8}; - 5 -> {6} [style=dotted]; - 6 -> {7} [style=dotted]; - 7 -> {8} [style=dotted]; + 5 -> {6} [color=green]; subgraph cluster_3 { color=red - 9 [label="Enter property [3]" style="filled" fillcolor=red]; - 10 [label="Const: String() [3]"]; - 11 [label="Exit property [3]" style="filled" fillcolor=red]; + 7 [label="Enter function function [3]" style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 8 [label="Enter block [3]"]; + 9 [label="Const: Int(42) [3]"]; + 10 [label="Jump: ^function Int(42) [3]"]; + 11 [label="Stub [3]" style="filled" fillcolor=gray]; + 12 [label="Exit block [3]" style="filled" fillcolor=gray]; + } + 13 [label="Exit function function [3]" style="filled" fillcolor=red]; } + 7 -> {8}; + 8 -> {9}; 9 -> {10}; - 10 -> {11}; + 10 -> {13}; + 10 -> {11} [style=dotted]; + 11 -> {12} [style=dotted]; + 12 -> {13} [style=dotted]; - subgraph cluster_4 { + subgraph cluster_5 { color=red - 12 [label="Enter class Nested [3]" style="filled" fillcolor=red]; - subgraph cluster_5 { + 14 [label="Enter class Nested [3]" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 13 [label="Enter function [4]" style="filled" fillcolor=red]; - 14 [label="Delegated constructor call: super() [4]" style="filled" fillcolor=yellow]; - 15 [label="Exit function [4]" style="filled" fillcolor=red]; + 15 [label="Enter function [4]" style="filled" fillcolor=red]; + 16 [label="Delegated constructor call: super() [4]" style="filled" fillcolor=yellow]; + 17 [label="Exit function [4]" style="filled" fillcolor=red]; } - 16 [label="Exit class Nested [3]" style="filled" fillcolor=red]; + 18 [label="Exit class Nested [3]" style="filled" fillcolor=red]; } - 12 -> {13} [color=green]; - 12 -> {16} [style=dotted]; - 12 -> {13} [style=dashed]; - 13 -> {14}; - 14 -> {15}; - 15 -> {16} [color=green]; + 14 -> {15} [color=green]; + 14 -> {18} [style=dotted]; + 14 -> {15} [style=dashed]; + 15 -> {16}; + 16 -> {17}; + 17 -> {18} [color=green]; - subgraph cluster_6 { + subgraph cluster_7 { color=red - 17 [label="Enter function f [4]" style="filled" fillcolor=red]; - subgraph cluster_7 { + 19 [label="Enter function f [4]" style="filled" fillcolor=red]; + subgraph cluster_8 { color=blue - 18 [label="Enter block [4]"]; - subgraph cluster_8 { + 20 [label="Enter block [4]"]; + subgraph cluster_9 { color=blue - 19 [label="Function call arguments enter [4]"]; - 20 [label="Function call arguments exit [4]"]; + 21 [label="Function call arguments enter [4]"]; + 22 [label="Function call arguments exit [4]"]; } - 21 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow]; - 22 [label="Jump: ^f R|/function|() [4]"]; - 23 [label="Stub [4]" style="filled" fillcolor=gray]; - 24 [label="Exit block [4]" style="filled" fillcolor=gray]; + 23 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow]; + 24 [label="Jump: ^f R|/function|() [4]"]; + 25 [label="Stub [4]" style="filled" fillcolor=gray]; + 26 [label="Exit block [4]" style="filled" fillcolor=gray]; } - 25 [label="Exit function f [4]" style="filled" fillcolor=red]; + 27 [label="Exit function f [4]" style="filled" fillcolor=red]; } - 17 -> {18}; - 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {25}; - 22 -> {23} [style=dotted]; - 23 -> {24} [style=dotted]; + 22 -> {23}; + 23 -> {24}; + 24 -> {27}; 24 -> {25} [style=dotted]; + 25 -> {26} [style=dotted]; + 26 -> {27} [style=dotted]; - subgraph cluster_9 { + subgraph cluster_10 { color=red - 26 [label="Enter function g [4]" style="filled" fillcolor=red]; - subgraph cluster_10 { + 28 [label="Enter function g [4]" style="filled" fillcolor=red]; + subgraph cluster_11 { color=blue - 27 [label="Enter block [4]"]; - 28 [label="Access variable R|/property| [4]"]; - 29 [label="Jump: ^g R|/property| [4]"]; - 30 [label="Stub [4]" style="filled" fillcolor=gray]; - 31 [label="Exit block [4]" style="filled" fillcolor=gray]; + 29 [label="Enter block [4]"]; + 30 [label="Access variable R|/property| [4]"]; + 31 [label="Jump: ^g R|/property| [4]"]; + 32 [label="Stub [4]" style="filled" fillcolor=gray]; + 33 [label="Exit block [4]" style="filled" fillcolor=gray]; } - 32 [label="Exit function g [4]" style="filled" fillcolor=red]; + 34 [label="Exit function g [4]" style="filled" fillcolor=red]; } - 26 -> {27}; - 27 -> {28}; 28 -> {29}; - 29 -> {32}; - 29 -> {30} [style=dotted]; - 30 -> {31} [style=dotted]; + 29 -> {30}; + 30 -> {31}; + 31 -> {34}; 31 -> {32} [style=dotted]; + 32 -> {33} [style=dotted]; + 33 -> {34} [style=dotted]; - subgraph cluster_11 { + subgraph cluster_12 { color=red - 33 [label="Enter class Inner [3]" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 34 [label="Enter property [4]" style="filled" fillcolor=red]; - 35 [label="Access variable R|/property| [4]"]; - 36 [label="Exit property [4]" style="filled" fillcolor=red]; - } + 35 [label="Enter class Inner [3]" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 37 [label="Enter property [4]" style="filled" fillcolor=red]; - 38 [label="Access variable this@NestedInnerClass# [4]"]; - 39 [label="Access variable # [4]"]; - 40 [label="Exit property [4]" style="filled" fillcolor=red]; + 36 [label="Enter property [4]" style="filled" fillcolor=red]; + 37 [label="Access variable R|/property| [4]"]; + 38 [label="Exit property [4]" style="filled" fillcolor=red]; } subgraph cluster_14 { color=blue - 41 [label="Enter function [4]" style="filled" fillcolor=red]; - 42 [label="Delegated constructor call: super() [4]" style="filled" fillcolor=yellow]; - 43 [label="Exit function [4]" style="filled" fillcolor=red]; + 39 [label="Enter property [4]" style="filled" fillcolor=red]; + 40 [label="Access variable this@NestedInnerClass# [4]"]; + 41 [label="Access variable # [4]"]; + 42 [label="Exit property [4]" style="filled" fillcolor=red]; } - 44 [label="Exit class Inner [3]" style="filled" fillcolor=red]; - } - 33 -> {34} [color=green]; - 33 -> {44} [style=dotted]; - 33 -> {34 37 41} [style=dashed]; - 34 -> {35}; - 35 -> {36}; - 36 -> {37} [color=green]; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41} [color=green]; - 41 -> {42}; - 42 -> {43}; - 43 -> {44} [color=green]; - - subgraph cluster_15 { - color=red - 45 [label="Enter function innerFun [4]" style="filled" fillcolor=red]; - subgraph cluster_16 { + subgraph cluster_15 { color=blue - 46 [label="Enter block [4]"]; - subgraph cluster_17 { - color=blue - 47 [label="Function call arguments enter [4]"]; - 48 [label="Function call arguments exit [4]"]; - } - 49 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow]; - 50 [label="Jump: ^innerFun R|/function|() [4]"]; - 51 [label="Stub [4]" style="filled" fillcolor=gray]; - 52 [label="Exit block [4]" style="filled" fillcolor=gray]; + 43 [label="Enter function [4]" style="filled" fillcolor=red]; + 44 [label="Delegated constructor call: super() [4]" style="filled" fillcolor=yellow]; + 45 [label="Exit function [4]" style="filled" fillcolor=red]; } - 53 [label="Exit function innerFun [4]" style="filled" fillcolor=red]; + 46 [label="Exit class Inner [3]" style="filled" fillcolor=red]; + } + 35 -> {36} [color=green]; + 35 -> {46} [style=dotted]; + 35 -> {36 39 43} [style=dashed]; + 36 -> {37}; + 37 -> {38}; + 38 -> {39} [color=green]; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43} [color=green]; + 43 -> {44}; + 44 -> {45}; + 45 -> {46} [color=green]; + + subgraph cluster_16 { + color=red + 47 [label="Enter function innerFun [4]" style="filled" fillcolor=red]; + subgraph cluster_17 { + color=blue + 48 [label="Enter block [4]"]; + subgraph cluster_18 { + color=blue + 49 [label="Function call arguments enter [4]"]; + 50 [label="Function call arguments exit [4]"]; + } + 51 [label="Function call: R|/function|() [4]" style="filled" fillcolor=yellow]; + 52 [label="Jump: ^innerFun R|/function|() [4]"]; + 53 [label="Stub [4]" style="filled" fillcolor=gray]; + 54 [label="Exit block [4]" style="filled" fillcolor=gray]; + } + 55 [label="Exit function innerFun [4]" style="filled" fillcolor=red]; } - 45 -> {46}; - 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {53}; - 50 -> {51} [style=dotted]; - 51 -> {52} [style=dotted]; + 50 -> {51}; + 51 -> {52}; + 52 -> {55}; 52 -> {53} [style=dotted]; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; - subgraph cluster_18 { + subgraph cluster_19 { color=red - 54 [label="Enter function innerThisFun [4]" style="filled" fillcolor=red]; - subgraph cluster_19 { + 56 [label="Enter function innerThisFun [4]" style="filled" fillcolor=red]; + subgraph cluster_20 { color=blue - 55 [label="Enter block [4]"]; - subgraph cluster_20 { + 57 [label="Enter block [4]"]; + subgraph cluster_21 { color=blue - 56 [label="Function call arguments enter [4]"]; - 57 [label="Access variable this@NestedInnerClass# [4]"]; - 58 [label="Function call arguments exit [4]"]; + 58 [label="Function call arguments enter [4]"]; + 59 [label="Access variable this@NestedInnerClass# [4]"]; + 60 [label="Function call arguments exit [4]"]; } - 59 [label="Function call: this@NestedInnerClass#.#() [4]" style="filled" fillcolor=yellow]; - 60 [label="Jump: ^innerThisFun this@NestedInnerClass#.#() [4]"]; - 61 [label="Stub [4]" style="filled" fillcolor=gray]; - 62 [label="Exit block [4]" style="filled" fillcolor=gray]; + 61 [label="Function call: this@NestedInnerClass#.#() [4]" style="filled" fillcolor=yellow]; + 62 [label="Jump: ^innerThisFun this@NestedInnerClass#.#() [4]"]; + 63 [label="Stub [4]" style="filled" fillcolor=gray]; + 64 [label="Exit block [4]" style="filled" fillcolor=gray]; } - 63 [label="Exit function innerThisFun [4]" style="filled" fillcolor=red]; + 65 [label="Exit function innerThisFun [4]" style="filled" fillcolor=red]; } - 54 -> {55}; - 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; 59 -> {60}; - 60 -> {63}; - 60 -> {61} [style=dotted]; - 61 -> {62} [style=dotted]; + 60 -> {61}; + 61 -> {62}; + 62 -> {65}; 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {65} [style=dotted]; - subgraph cluster_21 { + subgraph cluster_22 { color=red - 64 [label="Enter class InnerInner [4]" style="filled" fillcolor=red]; - subgraph cluster_22 { + 66 [label="Enter class InnerInner [4]" style="filled" fillcolor=red]; + subgraph cluster_23 { color=blue - 65 [label="Enter function [5]" style="filled" fillcolor=red]; - 66 [label="Delegated constructor call: super() [5]" style="filled" fillcolor=yellow]; - 67 [label="Exit function [5]" style="filled" fillcolor=red]; + 67 [label="Enter function [5]" style="filled" fillcolor=red]; + 68 [label="Delegated constructor call: super() [5]" style="filled" fillcolor=yellow]; + 69 [label="Exit function [5]" style="filled" fillcolor=red]; } - 68 [label="Exit class InnerInner [4]" style="filled" fillcolor=red]; + 70 [label="Exit class InnerInner [4]" style="filled" fillcolor=red]; } - 64 -> {65} [color=green]; - 64 -> {68} [style=dotted]; - 64 -> {65} [style=dashed]; - 65 -> {66}; - 66 -> {67}; - 67 -> {68} [color=green]; + 66 -> {67} [color=green]; + 66 -> {70} [style=dotted]; + 66 -> {67} [style=dashed]; + 67 -> {68}; + 68 -> {69}; + 69 -> {70} [color=green]; - subgraph cluster_23 { + subgraph cluster_24 { color=red - 69 [label="Enter function f [5]" style="filled" fillcolor=red]; - subgraph cluster_24 { + 71 [label="Enter function f [5]" style="filled" fillcolor=red]; + subgraph cluster_25 { color=blue - 70 [label="Enter block [5]"]; - subgraph cluster_25 { + 72 [label="Enter block [5]"]; + subgraph cluster_26 { color=blue - 71 [label="Function call arguments enter [5]"]; - 72 [label="Function call arguments exit [5]"]; + 73 [label="Function call arguments enter [5]"]; + 74 [label="Function call arguments exit [5]"]; } - 73 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow]; - 74 [label="Jump: ^f this@R|/Inner|.R|/Inner.innerFun|() [5]"]; - 75 [label="Stub [5]" style="filled" fillcolor=gray]; - 76 [label="Exit block [5]" style="filled" fillcolor=gray]; + 75 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow]; + 76 [label="Jump: ^f this@R|/Inner|.R|/Inner.innerFun|() [5]"]; + 77 [label="Stub [5]" style="filled" fillcolor=gray]; + 78 [label="Exit block [5]" style="filled" fillcolor=gray]; } - 77 [label="Exit function f [5]" style="filled" fillcolor=red]; + 79 [label="Exit function f [5]" style="filled" fillcolor=red]; } - 69 -> {70}; - 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; - 74 -> {77}; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; + 74 -> {75}; + 75 -> {76}; + 76 -> {79}; 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; - subgraph cluster_26 { + subgraph cluster_27 { color=red - 78 [label="Enter function g [5]" style="filled" fillcolor=red]; - subgraph cluster_27 { + 80 [label="Enter function g [5]" style="filled" fillcolor=red]; + subgraph cluster_28 { color=blue - 79 [label="Enter block [5]"]; - 80 [label="Access variable R|/Inner.innerProp| [5]"]; - 81 [label="Jump: ^g this@R|/Inner|.R|/Inner.innerProp| [5]"]; - 82 [label="Stub [5]" style="filled" fillcolor=gray]; - 83 [label="Exit block [5]" style="filled" fillcolor=gray]; + 81 [label="Enter block [5]"]; + 82 [label="Access variable R|/Inner.innerProp| [5]"]; + 83 [label="Jump: ^g this@R|/Inner|.R|/Inner.innerProp| [5]"]; + 84 [label="Stub [5]" style="filled" fillcolor=gray]; + 85 [label="Exit block [5]" style="filled" fillcolor=gray]; } - 84 [label="Exit function g [5]" style="filled" fillcolor=red]; + 86 [label="Exit function g [5]" style="filled" fillcolor=red]; } - 78 -> {79}; - 79 -> {80}; 80 -> {81}; - 81 -> {84}; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; + 81 -> {82}; + 82 -> {83}; + 83 -> {86}; 83 -> {84} [style=dotted]; + 84 -> {85} [style=dotted]; + 85 -> {86} [style=dotted]; - subgraph cluster_28 { + subgraph cluster_29 { color=red - 85 [label="Enter function h [5]" style="filled" fillcolor=red]; - subgraph cluster_29 { + 87 [label="Enter function h [5]" style="filled" fillcolor=red]; + subgraph cluster_30 { color=blue - 86 [label="Enter block [5]"]; - subgraph cluster_30 { + 88 [label="Enter block [5]"]; + subgraph cluster_31 { color=blue - 87 [label="Function call arguments enter [5]"]; - 88 [label="Access variable this@R|/Inner| [5]"]; - 89 [label="Function call arguments exit [5]"]; + 89 [label="Function call arguments enter [5]"]; + 90 [label="Access variable this@R|/Inner| [5]"]; + 91 [label="Function call arguments exit [5]"]; } - 90 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow]; - 91 [label="Jump: ^h this@R|/Inner|.R|/Inner.innerFun|() [5]"]; - 92 [label="Stub [5]" style="filled" fillcolor=gray]; - 93 [label="Exit block [5]" style="filled" fillcolor=gray]; + 92 [label="Function call: this@R|/Inner|.R|/Inner.innerFun|() [5]" style="filled" fillcolor=yellow]; + 93 [label="Jump: ^h this@R|/Inner|.R|/Inner.innerFun|() [5]"]; + 94 [label="Stub [5]" style="filled" fillcolor=gray]; + 95 [label="Exit block [5]" style="filled" fillcolor=gray]; } - 94 [label="Exit function h [5]" style="filled" fillcolor=red]; + 96 [label="Exit function h [5]" style="filled" fillcolor=red]; } - 85 -> {86}; - 86 -> {87}; 87 -> {88}; 88 -> {89}; 89 -> {90}; 90 -> {91}; - 91 -> {94}; - 91 -> {92} [style=dotted]; - 92 -> {93} [style=dotted]; + 91 -> {92}; + 92 -> {93}; + 93 -> {96}; 93 -> {94} [style=dotted]; + 94 -> {95} [style=dotted]; + 95 -> {96} [style=dotted]; - subgraph cluster_31 { + subgraph cluster_32 { color=red - 95 [label="Enter function i [5]" style="filled" fillcolor=red]; - subgraph cluster_32 { + 97 [label="Enter function i [5]" style="filled" fillcolor=red]; + subgraph cluster_33 { color=blue - 96 [label="Enter block [5]"]; - 97 [label="Access variable this@R|/Inner| [5]"]; - 98 [label="Access variable R|/Inner.innerProp| [5]"]; - 99 [label="Jump: ^i this@R|/Inner|.R|/Inner.innerProp| [5]"]; - 100 [label="Stub [5]" style="filled" fillcolor=gray]; - 101 [label="Exit block [5]" style="filled" fillcolor=gray]; + 98 [label="Enter block [5]"]; + 99 [label="Access variable this@R|/Inner| [5]"]; + 100 [label="Access variable R|/Inner.innerProp| [5]"]; + 101 [label="Jump: ^i this@R|/Inner|.R|/Inner.innerProp| [5]"]; + 102 [label="Stub [5]" style="filled" fillcolor=gray]; + 103 [label="Exit block [5]" style="filled" fillcolor=gray]; } - 102 [label="Exit function i [5]" style="filled" fillcolor=red]; + 104 [label="Exit function i [5]" style="filled" fillcolor=red]; } - 95 -> {96}; - 96 -> {97}; 97 -> {98}; 98 -> {99}; - 99 -> {102}; - 99 -> {100} [style=dotted]; - 100 -> {101} [style=dotted]; + 99 -> {100}; + 100 -> {101}; + 101 -> {104}; 101 -> {102} [style=dotted]; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; } diff --git a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.dot b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.dot new file mode 100644 index 00000000000..58f06513496 --- /dev/null +++ b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.dot @@ -0,0 +1,347 @@ +digraph destructuringDeclarationsScript_fir_kts { + graph [nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter file destructuringDeclarationsScript.fir.kts [1]" style="filled" fillcolor=red]; + 1 [label="Exit file destructuringDeclarationsScript.fir.kts [1]" style="filled" fillcolor=red]; + } + 0 -> {1} [color=green]; + + subgraph cluster_1 { + color=red + 2 [label="Enter class [2]" style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 3 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 4 [label="Function call arguments enter [3]"]; + 5 [label="Function call arguments exit [3]"]; + } + 6 [label="Function call: R|/A.A|() [3]" style="filled" fillcolor=yellow]; + 7 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_4 { + color=blue + 8 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 9 [label="Function call arguments enter [3]"]; + 10 [label="Access variable R|/| [3]"]; + 11 [label="Function call arguments exit [3]"]; + } + 12 [label="Function call: R|/|.R|/A.component1|() [3]" style="filled" fillcolor=yellow]; + 13 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_6 { + color=blue + 14 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 15 [label="Function call arguments enter [3]"]; + 16 [label="Access variable R|/| [3]"]; + 17 [label="Function call arguments exit [3]"]; + } + 18 [label="Function call: R|/|.R|/A.component2|() [3]" style="filled" fillcolor=yellow]; + 19 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_8 { + color=blue + 20 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 21 [label="Function call arguments enter [3]"]; + 22 [label="Function call arguments exit [3]"]; + } + 23 [label="Function call: R|/A.A|() [3]" style="filled" fillcolor=yellow]; + 24 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_10 { + color=blue + 25 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 26 [label="Function call arguments enter [3]"]; + 27 [label="Access variable R|/| [3]"]; + 28 [label="Function call arguments exit [3]"]; + } + 29 [label="Function call: R|/|.R|/A.component1|() [3]" style="filled" fillcolor=yellow]; + 30 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_12 { + color=blue + 31 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 32 [label="Function call arguments enter [3]"]; + 33 [label="Access variable R|/| [3]"]; + 34 [label="Function call arguments exit [3]"]; + } + 35 [label="Function call: R|/|.R|/A.component2#|() [3]" style="filled" fillcolor=yellow]; + 36 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_14 { + color=blue + 37 [label="Enter property [3]" style="filled" fillcolor=red]; + 38 [label="Access variable # [3]"]; + 39 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_15 { + color=blue + 40 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 41 [label="Function call arguments enter [3]"]; + 42 [label="Access variable R|/| [3]"]; + 43 [label="Function call arguments exit [3]"]; + } + 44 [label="Function call: R|/|.#() [3]" style="filled" fillcolor=yellow]; + 45 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_17 { + color=blue + 46 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 47 [label="Function call arguments enter [3]"]; + 48 [label="Function call arguments exit [3]"]; + } + 49 [label="Function call: R|/A.A|() [3]" style="filled" fillcolor=yellow]; + 50 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_19 { + color=blue + 51 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_20 { + color=blue + 52 [label="Function call arguments enter [3]"]; + 53 [label="Access variable R|/| [3]"]; + 54 [label="Function call arguments exit [3]"]; + } + 55 [label="Function call: R|/|.R|/A.component1|() [3]" style="filled" fillcolor=yellow]; + 56 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_21 { + color=blue + 57 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_22 { + color=blue + 58 [label="Function call arguments enter [3]"]; + 59 [label="Function call arguments exit [3]"]; + } + 60 [label="Function call: R|/A.A|() [3]" style="filled" fillcolor=yellow]; + 61 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_23 { + color=blue + 62 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_24 { + color=blue + 63 [label="Function call arguments enter [3]"]; + 64 [label="Access variable R|/| [3]"]; + 65 [label="Function call arguments exit [3]"]; + } + 66 [label="Function call: R|/|.R|/A.component1|() [3]" style="filled" fillcolor=yellow]; + 67 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_25 { + color=blue + 68 [label="Enter property [3]" style="filled" fillcolor=red]; + subgraph cluster_26 { + color=blue + 69 [label="Function call arguments enter [3]"]; + 70 [label="Access variable R|/| [3]"]; + 71 [label="Function call arguments exit [3]"]; + } + 72 [label="Function call: R|/|.R|/A.component2|() [3]" style="filled" fillcolor=yellow]; + 73 [label="Exit property [3]" style="filled" fillcolor=red]; + } + subgraph cluster_27 { + color=blue + 74 [label="Enter init block [3]" style="filled" fillcolor=red]; + subgraph cluster_28 { + color=blue + 75 [label="Enter block [3]"]; + 76 [label="Access variable R|/a1| [3]"]; + 77 [label="Exit block [3]"]; + } + 78 [label="Exit init block [3]" style="filled" fillcolor=red]; + } + subgraph cluster_29 { + color=blue + 79 [label="Enter init block [3]" style="filled" fillcolor=red]; + subgraph cluster_30 { + color=blue + 80 [label="Enter block [3]"]; + 81 [label="Access variable R|/a2| [3]"]; + 82 [label="Exit block [3]"]; + } + 83 [label="Exit init block [3]" style="filled" fillcolor=red]; + } + subgraph cluster_31 { + color=blue + 84 [label="Enter init block [3]" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 85 [label="Enter block [3]"]; + 86 [label="Access variable R|/e1| [3]"]; + 87 [label="Exit block [3]"]; + } + 88 [label="Exit init block [3]" style="filled" fillcolor=red]; + } + 89 [label="Exit class [2]" style="filled" fillcolor=red]; + } + 2 -> {3} [color=green]; + 2 -> {89} [style=dotted]; + 2 -> {3 8 14 20 25 31 37 40 46 51 57 62 68 74 79 84} [style=dashed]; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8} [color=green]; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14} [color=green]; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20} [color=green]; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25} [color=green]; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31} [color=green]; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37} [color=green]; + 37 -> {38}; + 38 -> {39}; + 39 -> {40} [color=green]; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46} [color=green]; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51} [color=green]; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57} [color=green]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62} [color=green]; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68} [color=green]; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74} [color=green]; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79} [color=green]; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84} [color=green]; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89} [color=green]; + + subgraph cluster_33 { + color=red + 90 [label="Enter class A [3]" style="filled" fillcolor=red]; + subgraph cluster_34 { + color=blue + 91 [label="Enter function [4]" style="filled" fillcolor=red]; + 92 [label="Delegated constructor call: super() [4]" style="filled" fillcolor=yellow]; + 93 [label="Exit function [4]" style="filled" fillcolor=red]; + } + 94 [label="Exit class A [3]" style="filled" fillcolor=red]; + } + 90 -> {91} [color=green]; + 90 -> {94} [style=dotted]; + 90 -> {91} [style=dashed]; + 91 -> {92}; + 92 -> {93}; + 93 -> {94} [color=green]; + + subgraph cluster_35 { + color=red + 95 [label="Enter function component1 [3]" style="filled" fillcolor=red]; + subgraph cluster_36 { + color=blue + 96 [label="Enter block [3]"]; + 97 [label="Const: Int(1) [3]"]; + 98 [label="Jump: ^component1 Int(1) [3]"]; + 99 [label="Stub [3]" style="filled" fillcolor=gray]; + 100 [label="Exit block [3]" style="filled" fillcolor=gray]; + } + 101 [label="Exit function component1 [3]" style="filled" fillcolor=red]; + } + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {101}; + 98 -> {99} [style=dotted]; + 99 -> {100} [style=dotted]; + 100 -> {101} [style=dotted]; + + subgraph cluster_37 { + color=red + 102 [label="Enter function component2 [3]" style="filled" fillcolor=red]; + subgraph cluster_38 { + color=blue + 103 [label="Enter block [3]"]; + 104 [label="Const: String() [3]"]; + 105 [label="Jump: ^component2 String() [3]"]; + 106 [label="Stub [3]" style="filled" fillcolor=gray]; + 107 [label="Exit block [3]" style="filled" fillcolor=gray]; + } + 108 [label="Exit function component2 [3]" style="filled" fillcolor=red]; + } + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {108}; + 105 -> {106} [style=dotted]; + 106 -> {107} [style=dotted]; + 107 -> {108} [style=dotted]; + +} diff --git a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.fir.kts b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.fir.kts index b382fdf532e..5459fe0fbd5 100644 --- a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.fir.kts +++ b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.fir.kts @@ -1,6 +1,7 @@ // !WITH_NEW_INFERENCE // IGNORE_REVERSED_RESOLVE // IGNORE_DIAGNOSTIC_API +// DUMP_CFG: LEVELS // KT-62840 val (a1, a2) = A() val (b1: Int, b2: Int) = A() diff --git a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts index 7a398c03eb4..46a6a45db9a 100644 --- a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts +++ b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts @@ -1,6 +1,7 @@ // !WITH_NEW_INFERENCE // IGNORE_REVERSED_RESOLVE // IGNORE_DIAGNOSTIC_API +// DUMP_CFG: LEVELS // KT-62840 val (a1, a2) = A() val (b1: Int, b2: Int) = A() diff --git a/compiler/testData/diagnostics/tests/script/topLevelPropertyInitialization.fir.kts b/compiler/testData/diagnostics/tests/script/topLevelPropertyInitialization.fir.kts index dc6d72860a0..3cd99fefffb 100644 --- a/compiler/testData/diagnostics/tests/script/topLevelPropertyInitialization.fir.kts +++ b/compiler/testData/diagnostics/tests/script/topLevelPropertyInitialization.fir.kts @@ -24,18 +24,18 @@ fun inPlaceDelegate(block: () -> T): ReadOnlyProperty { fun notInPlaceDelegate(block: () -> T): ReadOnlyProperty = null!! -val a: String = a -val b: String = inPlaceRun { b } +val a: String = a +val b: String = inPlaceRun { b } val c: String = notInPlaceRun { c } -val d: String by simpleDelegate(d) +val d: String by simpleDelegate(d) val e: String by inPlaceDelegate { e } val f: String by notInPlaceDelegate { f } -val g: Int +val g: Int val h = 1.also { g = 2 } val i: Int -val j by lazy { i = 2; 1 } +val j by lazy { i = 2; 1 } val k: Int get() { i = 3 @@ -46,13 +46,13 @@ val l: Comparator = object : Comparator { val delegate: Comparator get() = n override fun compare(o1: String, o2: String): Int = delegate.compare(o1, o2) } -val m: Comparator = object : Comparator by n {} +val m: Comparator = object : Comparator by n {} val n: Comparator = Comparator { _, _ -> 0 } -val t: String = z -val u: String = inPlaceRun { z } +val t: String = z +val u: String = inPlaceRun { z } val v: String = notInPlaceRun { z } -val w: String by simpleDelegate(z) +val w: String by simpleDelegate(z) val x: String by inPlaceDelegate { z } val y: String by notInPlaceDelegate { z } val z: String = "VALUE"