From a9be27e3306dec6c6035b6aaaf4ed0d6be33c015 Mon Sep 17 00:00:00 2001 From: pyos Date: Thu, 17 Nov 2022 12:53:35 +0100 Subject: [PATCH] FIR CFG: add union nodes Quick quiz: Q: In a CFG, what does `a -> b -> c -> d` mean? A: `a`, then `b`, then `c`, then `d`. Q: In a CFG, what does `a -> b -> d; a -> c -> d` mean? A: `a`, then `b` or `c`, then `d`. Q: So how do you encode "a, then (b, then c) or (c, then b), then d`? A: You can't. Problem is, you need to, because that's what `a; run2({ b }, { c }); d` does when `run2` has a contract that it calls both its lambda arguments in-place: `shuffle(listOf(block1, block2)).forEach { it() }` is a perfectly valid implementation for it, as little sense as that makes. So that's what union nodes solve. When a node implements `UnionNodeMarker`, its inputs are interpreted as "all visited in some order" instead of the normal "one of the inputs is visited". Currently this is used for data flow. It *should* also be used for control flow, but it isn't. But it should be. But that's not so easy. BTW, `try` exit is NOT a union node; although lambdas in one branch can be completed according to types' of lambdas in another, data does not flow between the branches anyway (since we don't know how much of the `try` executed before jumping into `catch`, and `catch`es are mutually exclusive) so a `try` expression is more like `when` than a function call with called-in-place-exactly-once arguments. The fact that `exitTryExpression` used `processUnionOfArguments` in a weird way should've hinted at that, but now we know for certain. --- .../resolve/cfa/initializationInTry.dot | 14 +- .../resolve/cfg/annotatedLocalClass.dot | 6 +- .../testData/resolve/cfg/complex.dot | 12 +- .../testData/resolve/cfg/defaultArguments.dot | 36 +- .../resolve/cfg/flowFromInplaceLambda.dot | 1398 ++++++++--------- .../resolve/cfg/flowFromInplaceLambda2.dot | 1050 ++++++------- .../resolve/cfg/flowFromInplaceLambda3.dot | 316 ++-- .../cfg/flowFromInplaceLambda3.fir.txt | 2 +- .../resolve/cfg/flowFromInplaceLambda3.kt | 2 +- .../resolve/cfg/flowFromTwoInplaceLambdas.dot | 986 ++++++------ .../testData/resolve/cfg/initBlock.dot | 6 +- .../resolve/cfg/initBlockAndInPlaceLambda.dot | 64 +- .../cfg/innerClassInAnonymousObject.dot | 4 +- .../inplaceLambdaInControlFlowExpressions.dot | 153 +- .../testData/resolve/cfg/jumps.dot | 20 +- .../resolve/cfg/lambdaAsReturnOfLambda.dot | 6 +- .../resolve/cfg/lambdaReturningObject.dot | 8 +- .../testData/resolve/cfg/lambdas.dot | 194 ++- .../resolve/cfg/localClassesWithImplicit.dot | 38 +- .../testData/resolve/cfg/loops.dot | 8 +- .../cfg/postponedLambdaInConstructor.dot | 86 +- .../testData/resolve/cfg/postponedLambdas.dot | 6 +- .../resolve/cfg/propertiesAndInitBlocks.dot | 38 +- .../resolve/cfg/returnValuesFromLambda.dot | 202 ++- .../testData/resolve/cfg/safeCalls.dot | 6 +- .../testData/resolve/cfg/simple.dot | 4 +- .../testData/resolve/cfg/tryCatch.dot | 2 +- .../cfg/variableInitializedInTryBlock.dot | 6 +- .../testData/resolve/cfg/when.dot | 4 +- .../testData/resolve/classCallInLambda.dot | 46 +- .../positive/exhaustiveWhenAndDNNType.dot | 26 +- .../problems/secondaryConstructorCfg.dot | 4 +- .../testData/resolve/smartcasts/bangbang.dot | 54 +- .../smartcasts/booleans/booleanOperators.dot | 40 +- .../smartcasts/booleans/equalsToBoolean.dot | 32 +- .../booleans/jumpFromRhsOfOperator.dot | 40 +- .../boundSmartcasts/boundSmartcasts.dot | 40 +- .../boundSmartcastsInBranches.dot | 14 +- .../boundSmartcasts/functionCallBound.dot | 6 +- .../testData/resolve/smartcasts/casts.dot | 28 +- .../smartcasts/controlStructures/elvis.dot | 2 +- .../smartcasts/controlStructures/returns.dot | 24 +- .../smartcasts/controlStructures/simpleIf.dot | 2 +- .../smartcastFromArgument.dot | 4 +- .../smartcasts/controlStructures/when.dot | 68 +- .../whenSubjectExpression.dot | 4 +- .../resolve/smartcasts/equalsAndIdentity.dot | 24 +- .../incorrectSmartcastToNothing.dot | 55 +- .../smartcasts/lambdas/inPlaceLambdas.dot | 192 ++- .../smartcasts/lambdas/lambdaInWhenBranch.dot | 31 +- .../smartcasts/lambdas/smartcastOnLambda.dot | 2 +- .../loops/dataFlowInfoFromWhileCondition.dot | 2 +- .../resolve/smartcasts/loops/endlessLoops.dot | 12 +- .../resolve/smartcasts/multipleCasts.dot | 16 +- .../resolve/smartcasts/nullability.dot | 100 +- .../receivers/implicitReceivers.dot | 396 +++-- .../smartcasts/safeCalls/assignSafeCall.dot | 22 +- .../safeCalls/safeCallAndEqualityToBool.dot | 8 +- .../smartcasts/safeCalls/safeCalls.dot | 90 +- .../resolve/smartcasts/smartCastInInit.dot | 8 +- .../smartcasts/smartcastInByClause.dot | 12 +- .../resolve/smartcasts/smartcastToNothing.dot | 158 +- .../smartcasts/stability/overridenOpenVal.dot | 4 +- .../variables/delayedAssignment.dot | 8 +- .../resolveWithStdlib/complexPostponedCfg.dot | 130 +- .../contracts/fromLibrary/callsInPlace.dot | 448 +++--- .../fromLibrary/conditionalEffects.dot | 16 +- .../bad/callsInPlace/inAnonymousObject.dot | 8 +- .../bad/callsInPlace/inLocalClass.dot | 12 +- .../bad/callsInPlace/inLocalFunction.dot | 8 +- .../bad/callsInPlace/toLocalVariables.dot | 6 +- .../good/callsInPlace/atLeastOnce.dot | 104 +- .../good/callsInPlace/atMostOnce.dot | 16 +- .../good/callsInPlace/contractsUsage.dot | 10 +- .../good/callsInPlace/exactlyOnce.dot | 100 +- .../fromSource/good/callsInPlace/flow.dot | 24 +- .../good/callsInPlace/inPlaceLambda.dot | 10 +- .../fromSource/good/callsInPlace/simple.dot | 8 +- .../fromSource/good/callsInPlace/unknown.dot | 20 +- .../delegates/delegateWithAnonymousObject.dot | 24 +- .../inference/plusAssignWithLambdaInRhs.dot | 22 +- .../smartcasts/tryWithLambdaInside.dot | 8 +- .../analysis/cfa/FirCallsEffectAnalyzer.kt | 17 +- .../cfa/FirPropertyInitializationAnalyzer.kt | 2 + .../fir/analysis/cfa/util/ControlFlowInfo.kt | 2 + .../LocalPropertyAndCapturedWriteCollector.kt | 2 + .../util/PathAwareControlFlowGraphVisitor.kt | 28 + .../cfa/util/PathAwareControlFlowInfo.kt | 8 +- .../cfa/util/PropertyInitializationInfo.kt | 2 +- .../PropertyInitializationInfoCollector.kt | 15 +- .../FirPropertyInitializationChecker.kt | 12 +- .../declaration/FirTailrecFunctionChecker.kt | 2 + .../checkers/extended/CanBeValChecker.kt | 2 + .../checkers/extended/UnusedChecker.kt | 30 +- .../fir/resolve/dfa/FirDataFlowAnalyzer.kt | 76 +- .../dfa/cfg/ControlFlowGraphBuilder.kt | 479 +++--- .../dfa/cfg/ControlFlowGraphNodeBuilder.kt | 3 - .../dfa/cfg/ControlFlowGraphRenderer.kt | 2 +- ...ControlFlowStatementsResolveTransformer.kt | 34 +- .../FirDeclarationsResolveTransformer.kt | 4 +- .../FirExpressionsResolveTransformer.kt | 7 +- .../kotlin/fir/resolve/dfa/cfg/CFGNode.kt | 50 +- .../fir/resolve/dfa/cfg/CFGNodeRenderer.kt | 1 - .../dfa/cfg/ControlFlowGraphVisitor.kt | 14 +- .../dfa/cfg/ControlFlowGraphVisitorVoid.kt | 24 +- .../codegen/box/smartCasts/kt44814.dot | 243 ++- .../controlFlow/initialization/pos/3.fir.kt | 2 +- .../description/EventOccurrencesRange.kt | 3 + 108 files changed, 4050 insertions(+), 4239 deletions(-) create mode 100644 compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowGraphVisitor.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/cfa/initializationInTry.dot b/compiler/fir/analysis-tests/testData/resolve/cfa/initializationInTry.dot index d6e1e47bac3..348594c1080 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfa/initializationInTry.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfa/initializationInTry.dot @@ -54,10 +54,10 @@ digraph initializationInTry_kt { subgraph cluster_8 { color=blue 16 [label="Enter block"]; - 17 [label="Function call: R|/getNullableString|()"]; - 18 [label="Check not null: R|/getNullableString|()!!"]; + 17 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow]; + 18 [label="Check not null: R|/getNullableString|()!!" style="filled" fillcolor=yellow]; 19 [label="Variable declaration: lval y: R|kotlin/String|"]; - 20 [label="Function call: R|/getNullableString|()"]; + 20 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow]; 21 [label="Assignment: R|/x|"]; 22 [label="Exit block"]; } @@ -77,7 +77,7 @@ digraph initializationInTry_kt { 29 [label="Try expression exit"]; } 30 [label="Access variable R|/x|"]; - 31 [label="Function call: R|/takeNullableString|(...)"]; + 31 [label="Function call: R|/takeNullableString|(...)" style="filled" fillcolor=yellow]; 32 [label="Exit block"]; } 33 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -123,9 +123,9 @@ digraph initializationInTry_kt { subgraph cluster_15 { color=blue 39 [label="Enter block"]; - 40 [label="Function call: R|/getNullableString|()"]; + 40 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow]; 41 [label="Variable declaration: lval y: R|kotlin/String?|"]; - 42 [label="Function call: R|/getNullableString|()"]; + 42 [label="Function call: R|/getNullableString|()" style="filled" fillcolor=yellow]; 43 [label="Assignment: R|/x|"]; 44 [label="Exit block"]; } @@ -145,7 +145,7 @@ digraph initializationInTry_kt { 51 [label="Try expression exit"]; } 52 [label="Access variable R|/x|"]; - 53 [label="Function call: R|/takeNullableString|(...)"]; + 53 [label="Function call: R|/takeNullableString|(...)" style="filled" fillcolor=yellow]; 54 [label="Exit block"]; } 55 [label="Exit function test_2" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot index a5ab25a1f13..da1c47bd783 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.dot @@ -6,7 +6,7 @@ digraph annotatedLocalClass_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -47,7 +47,7 @@ digraph annotatedLocalClass_kt { 18 [label="Exit when"]; } 19 [label="Exit local class foo"]; - 20 [label="Function call: R|/bar|()"]; + 20 [label="Function call: R|/bar|()" style="filled" fillcolor=yellow]; 21 [label="Exit block"]; } subgraph cluster_7 { @@ -83,7 +83,7 @@ digraph annotatedLocalClass_kt { subgraph cluster_8 { color=red 25 [label="Enter function " style="filled" fillcolor=red]; - 26 [label="Delegated constructor call: super()"]; + 26 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 27 [label="Exit function " style="filled" fillcolor=red]; } 25 -> {26}; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot index 4a4323b57a3..eed034bba65 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/complex.dot @@ -60,7 +60,7 @@ digraph complex_kt { subgraph cluster_11 { color=blue 23 [label="Enter block"]; - 24 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; + 24 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()" style="filled" fillcolor=yellow]; 25 [label="Exit block"]; } 26 [label="Try main block exit"]; @@ -75,7 +75,7 @@ digraph complex_kt { 30 [label="Access variable R|/cause|"]; 31 [label="Smart cast: R|/cause|"]; 32 [label="Access variable R|/closeException|"]; - 33 [label="Function call: R|/cause|.R|kotlin/Throwable.addSuppressed|(...)"]; + 33 [label="Function call: R|/cause|.R|kotlin/Throwable.addSuppressed|(...)" style="filled" fillcolor=yellow]; 34 [label="Exit block"]; } 35 [label="Catch exit"]; @@ -89,7 +89,7 @@ digraph complex_kt { subgraph cluster_14 { color=blue 40 [label="Enter block"]; - 41 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; + 41 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()" style="filled" fillcolor=yellow]; 42 [label="Exit block"]; } 43 [label="Exit when branch result"]; @@ -185,7 +185,7 @@ digraph complex_kt { color=blue 55 [label="Enter block"]; 56 [label="Access variable this@R|/firstIsInstanceOrNull|"]; - 57 [label="Function call: this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride|>|()"]; + 57 [label="Function call: this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride|>|()" style="filled" fillcolor=yellow]; 58 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_19 { color=blue @@ -194,7 +194,7 @@ digraph complex_kt { color=blue 60 [label="Enter loop condition"]; 61 [label="Access variable R|/|"]; - 62 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 62 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 63 [label="Exit loop condition"]; } subgraph cluster_21 { @@ -204,7 +204,7 @@ digraph complex_kt { color=blue 65 [label="Enter block"]; 66 [label="Access variable R|/|"]; - 67 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 67 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 68 [label="Variable declaration: lval element: R|kotlin/Any?|"]; subgraph cluster_23 { color=blue diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.dot index 6d25387b933..efe34223ca1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.dot @@ -33,19 +33,18 @@ digraph defaultArguments_kt { 17 [label="Postponed enter to lambda"]; subgraph cluster_4 { color=blue - 22 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 23 [label="Enter block"]; - 24 [label="Function call: R|/foo|()"]; - 25 [label="Exit block"]; + 22 [label="Enter block"]; + 23 [label="Function call: R|/foo|()" style="filled" fillcolor=yellow]; + 24 [label="Exit block"]; } - 26 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 18 [label="Call arguments union" style="filled" fillcolor=yellow]; - 19 [label="Postponed exit from lambda"]; - 20 [label="Function call: R|kotlin/run|(...)"]; - 21 [label="Exit default value of z" style="filled" fillcolor=red]; + 18 [label="Postponed exit from lambda"]; + 19 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 20 [label="Exit default value of z" style="filled" fillcolor=red]; } subgraph cluster_6 { color=blue @@ -57,7 +56,7 @@ digraph defaultArguments_kt { subgraph cluster_7 { color=blue 8 [label="Enter block"]; - 9 [label="Function call: R|/foo|()"]; + 9 [label="Function call: R|/foo|()" style="filled" fillcolor=yellow]; 10 [label="Exit block"]; } 11 [label="Exit function test" style="filled" fillcolor=red]; @@ -72,17 +71,16 @@ digraph defaultArguments_kt { 14 -> {15}; 16 -> {17}; 16 -> {16} [style=dashed]; - 17 -> {22}; - 17 -> {19} [color=red]; - 17 -> {22} [style=dashed]; - 18 -> {20} [color=red]; - 19 -> {20} [color=green]; - 20 -> {21}; + 17 -> {21}; + 17 -> {18} [color=red]; + 17 -> {21} [style=dashed]; + 18 -> {19}; + 19 -> {20}; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {18} [color=red]; - 26 -> {19} [color=green]; + 25 -> {19} [color=red]; + 25 -> {18} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot index 856a537d7b1..d89a8ad0608 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot @@ -9,7 +9,7 @@ digraph flowFromInplaceLambda_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Jump: ^unknown R|/x|.R|SubstitutionOverride|()"]; 4 [label="Stub" style="filled" fillcolor=gray]; 5 [label="Exit block" style="filled" fillcolor=gray]; @@ -30,7 +30,7 @@ digraph flowFromInplaceLambda_kt { subgraph cluster_3 { color=blue 8 [label="Enter block"]; - 9 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 9 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 10 [label="Jump: ^atLeastOnce R|/x|.R|SubstitutionOverride|()"]; 11 [label="Stub" style="filled" fillcolor=gray]; 12 [label="Exit block" style="filled" fillcolor=gray]; @@ -51,7 +51,7 @@ digraph flowFromInplaceLambda_kt { subgraph cluster_5 { color=blue 15 [label="Enter block"]; - 16 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 16 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 17 [label="Jump: ^exactlyOnce R|/x|.R|SubstitutionOverride|()"]; 18 [label="Stub" style="filled" fillcolor=gray]; 19 [label="Exit block" style="filled" fillcolor=gray]; @@ -72,7 +72,7 @@ digraph flowFromInplaceLambda_kt { subgraph cluster_7 { color=blue 22 [label="Enter block"]; - 23 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 23 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 24 [label="Jump: ^atMostOnce R|/x|.R|SubstitutionOverride|()"]; 25 [label="Stub" style="filled" fillcolor=gray]; 26 [label="Exit block" style="filled" fillcolor=gray]; @@ -93,7 +93,7 @@ digraph flowFromInplaceLambda_kt { subgraph cluster_9 { color=blue 29 [label="Enter block"]; - 30 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 30 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 31 [label="Jump: ^noContract R|/x|.R|SubstitutionOverride|()"]; 32 [label="Stub" style="filled" fillcolor=gray]; 33 [label="Exit block" style="filled" fillcolor=gray]; @@ -116,7 +116,7 @@ digraph flowFromInplaceLambda_kt { 36 [label="Enter block"]; 37 [label="Access variable R|/x|"]; 38 [label="Const: Int(0)"]; - 39 [label="Function call: R|/x|.R|SubstitutionOverride|(...)"]; + 39 [label="Function call: R|/x|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; 40 [label="Jump: ^select R|/x|.R|SubstitutionOverride|(Int(0))"]; 41 [label="Stub" style="filled" fillcolor=gray]; 42 [label="Exit block" style="filled" fillcolor=gray]; @@ -161,7 +161,7 @@ digraph flowFromInplaceLambda_kt { color=blue 52 [label="Enter block"]; 53 [label="Const: Null(null)"]; - 54 [label="Check not null: Null(null)!!"]; + 54 [label="Check not null: Null(null)!!" style="filled" fillcolor=yellow]; 55 [label="Stub" style="filled" fillcolor=gray]; 56 [label="Jump: ^materialize Null(null)!!" style="filled" fillcolor=gray]; 57 [label="Stub" style="filled" fillcolor=gray]; @@ -188,120 +188,117 @@ digraph flowFromInplaceLambda_kt { 62 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 71 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 70 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 72 [label="Enter block"]; - 73 [label="Access variable R|/x|"]; - 74 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 75 [label="Exit block"]; + 71 [label="Enter block"]; + 72 [label="Access variable R|/x|"]; + 73 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 74 [label="Exit block"]; } - 76 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 75 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 63 [label="Call arguments union" style="filled" fillcolor=yellow]; - 64 [label="Postponed exit from lambda"]; - 65 [label="Function call: R|/exactlyOnce|(...)"]; - 66 [label="Access variable R|/x|"]; - 67 [label="Smart cast: R|/x|"]; - 68 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 69 [label="Exit block"]; + 63 [label="Postponed exit from lambda"]; + 64 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 65 [label="Access variable R|/x|"]; + 66 [label="Smart cast: R|/x|"]; + 67 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 68 [label="Exit block"]; } - 70 [label="Exit function basic" style="filled" fillcolor=red]; + 69 [label="Exit function basic" style="filled" fillcolor=red]; } 60 -> {61}; 61 -> {62}; - 62 -> {71}; - 62 -> {64} [color=red]; - 62 -> {71} [style=dashed]; - 63 -> {65} [color=red]; - 64 -> {65} [color=green]; + 62 -> {70}; + 62 -> {63} [color=red]; + 62 -> {70} [style=dashed]; + 63 -> {64}; + 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {70}; + 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; - 75 -> {76}; - 76 -> {63} [color=red]; - 76 -> {64} [color=green]; + 75 -> {64} [color=red]; + 75 -> {63} [color=green]; subgraph cluster_20 { color=red - 77 [label="Enter function completedCallExactlyOnce" style="filled" fillcolor=red]; + 76 [label="Enter function completedCallExactlyOnce" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 78 [label="Enter block"]; - 79 [label="Postponed enter to lambda"]; + 77 [label="Enter block"]; + 78 [label="Postponed enter to lambda"]; subgraph cluster_22 { color=blue - 100 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 97 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 101 [label="Enter block"]; - 102 [label="Access variable R|/y|"]; - 103 [label="Function call: R|/y|.#()"]; - 104 [label="Access variable R|/x|"]; - 105 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 106 [label="Exit block"]; + 98 [label="Enter block"]; + 99 [label="Access variable R|/y|"]; + 100 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 101 [label="Access variable R|/x|"]; + 102 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 103 [label="Exit block"]; } - 107 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 104 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 80 [label="Postponed exit from lambda"]; - 81 [label="Function call: R|/exactlyOnce|(...)"]; - 82 [label="Call arguments union" style="filled" fillcolor=yellow]; - 83 [label="Function call: R|/id|(...)"]; - 84 [label="Access variable R|/y|"]; - 85 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 86 [label="Postponed enter to lambda"]; + 79 [label="Postponed exit from lambda"]; + 80 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 81 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 82 [label="Access variable R|/y|"]; + 83 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 84 [label="Postponed enter to lambda"]; subgraph cluster_24 { color=blue - 108 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 105 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 109 [label="Enter block"]; - 110 [label="Access variable R|/x|"]; - 111 [label="Smart cast: R|/x|"]; - 112 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 113 [label="Access variable R|/y|"]; - 114 [label="Smart cast: R|/y|"]; - 115 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 116 [label="Const: Int(1)"]; - 117 [label="Exit block"]; + 106 [label="Enter block"]; + 107 [label="Access variable R|/x|"]; + 108 [label="Smart cast: R|/x|"]; + 109 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 110 [label="Access variable R|/y|"]; + 111 [label="Smart cast: R|/y|"]; + 112 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 113 [label="Const: Int(1)"]; + 114 [label="Exit block"]; } - 118 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 115 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 87 [label="Postponed exit from lambda"]; - 88 [label="Function call: R|/exactlyOnce|(...)"]; - 89 [label="Call arguments union" style="filled" fillcolor=yellow]; - 90 [label="Function call: R|/select|(...)"]; - 91 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 92 [label="Access variable R|/x|"]; - 93 [label="Smart cast: R|/x|"]; - 94 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 95 [label="Access variable R|/y|"]; - 96 [label="Smart cast: R|/y|"]; - 97 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 98 [label="Exit block"]; + 85 [label="Postponed exit from lambda"]; + 86 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 87 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 88 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 89 [label="Access variable R|/x|"]; + 90 [label="Smart cast: R|/x|"]; + 91 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 92 [label="Access variable R|/y|"]; + 93 [label="Smart cast: R|/y|"]; + 94 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 95 [label="Exit block"]; } - 99 [label="Exit function completedCallExactlyOnce" style="filled" fillcolor=red]; + 96 [label="Exit function completedCallExactlyOnce" style="filled" fillcolor=red]; } + 76 -> {77}; 77 -> {78}; - 78 -> {79}; - 79 -> {100}; - 79 -> {80} [color=red]; - 79 -> {100} [style=dashed]; + 78 -> {97}; + 78 -> {79} [color=red]; + 78 -> {97} [style=dashed]; + 79 -> {80}; 80 -> {81}; 81 -> {82}; 82 -> {83}; 83 -> {84}; - 84 -> {85}; + 84 -> {105}; + 84 -> {85} [color=red]; + 84 -> {105} [style=dashed]; 85 -> {86}; - 86 -> {108}; - 86 -> {87} [color=red]; - 86 -> {108} [style=dashed]; + 86 -> {87}; 87 -> {88}; 88 -> {89}; 89 -> {90}; @@ -311,18 +308,18 @@ digraph flowFromInplaceLambda_kt { 93 -> {94}; 94 -> {95}; 95 -> {96}; - 96 -> {97}; 97 -> {98}; 98 -> {99}; + 99 -> {100}; 100 -> {101}; 101 -> {102}; 102 -> {103}; 103 -> {104}; - 104 -> {105}; + 104 -> {81} [color=red]; + 104 -> {79} [color=green]; 105 -> {106}; 106 -> {107}; - 107 -> {82} [color=red]; - 107 -> {80} [color=green]; + 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; @@ -330,86 +327,86 @@ digraph flowFromInplaceLambda_kt { 112 -> {113}; 113 -> {114}; 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {89} [color=red]; - 118 -> {87} [color=green]; + 115 -> {87} [color=red]; + 115 -> {85} [color=green]; subgraph cluster_26 { color=red - 119 [label="Enter function completedCallAtLeastOnce" style="filled" fillcolor=red]; + 116 [label="Enter function completedCallAtLeastOnce" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 120 [label="Enter block"]; - 121 [label="Postponed enter to lambda"]; + 117 [label="Enter block"]; + 118 [label="Postponed enter to lambda"]; subgraph cluster_28 { color=blue - 142 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 137 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_29 { color=blue - 143 [label="Enter block"]; - 144 [label="Access variable R|/y|"]; - 145 [label="Function call: R|/y|.#()"]; - 146 [label="Access variable R|/x|"]; - 147 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 148 [label="Exit block"]; + 138 [label="Enter block"]; + 139 [label="Access variable R|/y|"]; + 140 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 141 [label="Access variable R|/x|"]; + 142 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 143 [label="Exit block"]; } - 149 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 144 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 122 [label="Postponed exit from lambda"]; - 123 [label="Function call: R|/atLeastOnce|(...)"]; - 124 [label="Call arguments union" style="filled" fillcolor=yellow]; - 125 [label="Function call: R|/id|(...)"]; - 126 [label="Access variable R|/y|"]; - 127 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 128 [label="Postponed enter to lambda"]; + 119 [label="Postponed exit from lambda"]; + 120 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow]; + 121 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 122 [label="Access variable R|/y|"]; + 123 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 124 [label="Postponed enter to lambda"]; subgraph cluster_30 { color=blue - 150 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 145 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_31 { color=blue - 151 [label="Enter block"]; - 152 [label="Access variable R|/x|"]; - 153 [label="Smart cast: R|/x|"]; - 154 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 155 [label="Access variable R|/y|"]; - 156 [label="Smart cast: R|/y|"]; - 157 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 158 [label="Const: Int(1)"]; - 159 [label="Exit block"]; + 146 [label="Enter block"]; + 147 [label="Access variable R|/x|"]; + 148 [label="Smart cast: R|/x|"]; + 149 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 150 [label="Access variable R|/y|"]; + 151 [label="Smart cast: R|/y|"]; + 152 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 153 [label="Const: Int(1)"]; + 154 [label="Exit block"]; } - 160 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 155 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 129 [label="Postponed exit from lambda"]; - 130 [label="Function call: R|/atLeastOnce|(...)"]; - 131 [label="Call arguments union" style="filled" fillcolor=yellow]; - 132 [label="Function call: R|/select|(...)"]; - 133 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 134 [label="Access variable R|/x|"]; - 135 [label="Smart cast: R|/x|"]; - 136 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 137 [label="Access variable R|/y|"]; - 138 [label="Smart cast: R|/y|"]; - 139 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 140 [label="Exit block"]; + 125 [label="Postponed exit from lambda"]; + 126 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow]; + 127 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 128 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 129 [label="Access variable R|/x|"]; + 130 [label="Smart cast: R|/x|"]; + 131 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 132 [label="Access variable R|/y|"]; + 133 [label="Smart cast: R|/y|"]; + 134 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 135 [label="Exit block"]; } - 141 [label="Exit function completedCallAtLeastOnce" style="filled" fillcolor=red]; + 136 [label="Exit function completedCallAtLeastOnce" style="filled" fillcolor=red]; } + 116 -> {117}; + 117 -> {118}; + 118 -> {137}; + 118 -> {119} [color=red]; + 118 -> {137} [style=dashed]; 119 -> {120}; + 119 -> {118} [color=green style=dashed]; 120 -> {121}; - 121 -> {142}; - 121 -> {122} [color=red]; - 121 -> {142} [style=dashed]; + 121 -> {122}; 122 -> {123}; 123 -> {124}; - 124 -> {125}; + 124 -> {145}; + 124 -> {125} [color=red]; + 124 -> {145} [style=dashed]; 125 -> {126}; + 125 -> {124} [color=green style=dashed]; 126 -> {127}; 127 -> {128}; - 128 -> {150}; - 128 -> {129} [color=red]; - 128 -> {150} [style=dashed]; + 128 -> {129}; 129 -> {130}; 130 -> {131}; 131 -> {132}; @@ -417,993 +414,980 @@ digraph flowFromInplaceLambda_kt { 133 -> {134}; 134 -> {135}; 135 -> {136}; - 136 -> {137}; 137 -> {138}; 138 -> {139}; 139 -> {140}; 140 -> {141}; + 141 -> {142}; 142 -> {143}; 143 -> {144}; - 144 -> {145}; + 144 -> {121} [color=red]; + 144 -> {119} [color=green]; 145 -> {146}; 146 -> {147}; 147 -> {148}; 148 -> {149}; - 149 -> {124} [color=red]; - 149 -> {122} [color=green]; - 149 -> {142} [color=green style=dashed]; + 149 -> {150}; 150 -> {151}; 151 -> {152}; 152 -> {153}; 153 -> {154}; 154 -> {155}; - 155 -> {156}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {131} [color=red]; - 160 -> {129} [color=green]; - 160 -> {150} [color=green style=dashed]; + 155 -> {127} [color=red]; + 155 -> {125} [color=green]; subgraph cluster_32 { color=red - 161 [label="Enter function completedCallAtMostOnce" style="filled" fillcolor=red]; + 156 [label="Enter function completedCallAtMostOnce" style="filled" fillcolor=red]; subgraph cluster_33 { color=blue - 162 [label="Enter block"]; - 163 [label="Postponed enter to lambda"]; + 157 [label="Enter block"]; + 158 [label="Postponed enter to lambda"]; subgraph cluster_34 { color=blue - 181 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 176 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_35 { color=blue - 182 [label="Enter block"]; - 183 [label="Access variable R|/y|"]; - 184 [label="Function call: R|/y|.#()"]; - 185 [label="Access variable R|/x|"]; - 186 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 187 [label="Exit block"]; + 177 [label="Enter block"]; + 178 [label="Access variable R|/y|"]; + 179 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 180 [label="Access variable R|/x|"]; + 181 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 182 [label="Exit block"]; } - 188 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 183 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 164 [label="Postponed exit from lambda"]; - 165 [label="Function call: R|/atMostOnce|(...)"]; - 166 [label="Function call: R|/id|(...)"]; - 167 [label="Access variable R|/y|"]; - 168 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 169 [label="Postponed enter to lambda"]; + 159 [label="Postponed exit from lambda"]; + 160 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow]; + 161 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 162 [label="Access variable R|/y|"]; + 163 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 164 [label="Postponed enter to lambda"]; subgraph cluster_36 { color=blue - 189 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 184 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_37 { color=blue - 190 [label="Enter block"]; - 191 [label="Access variable R|/x|"]; - 192 [label="Function call: R|/x|.#()"]; - 193 [label="Access variable R|/y|"]; - 194 [label="Smart cast: R|/y|"]; - 195 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 196 [label="Const: Int(1)"]; - 197 [label="Exit block"]; + 185 [label="Enter block"]; + 186 [label="Access variable R|/x|"]; + 187 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 188 [label="Access variable R|/y|"]; + 189 [label="Smart cast: R|/y|"]; + 190 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 191 [label="Const: Int(1)"]; + 192 [label="Exit block"]; } - 198 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 193 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 170 [label="Postponed exit from lambda"]; - 171 [label="Function call: R|/atMostOnce|(...)"]; - 172 [label="Function call: R|/select|(...)"]; - 173 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 174 [label="Access variable R|/x|"]; - 175 [label="Function call: R|/x|.#()"]; - 176 [label="Access variable R|/y|"]; - 177 [label="Smart cast: R|/y|"]; - 178 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 179 [label="Exit block"]; + 165 [label="Postponed exit from lambda"]; + 166 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow]; + 167 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 168 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 169 [label="Access variable R|/x|"]; + 170 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 171 [label="Access variable R|/y|"]; + 172 [label="Smart cast: R|/y|"]; + 173 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 174 [label="Exit block"]; } - 180 [label="Exit function completedCallAtMostOnce" style="filled" fillcolor=red]; + 175 [label="Exit function completedCallAtMostOnce" style="filled" fillcolor=red]; } + 156 -> {157}; + 157 -> {158}; + 158 -> {159 176}; + 158 -> {176} [style=dashed]; + 159 -> {160}; + 160 -> {161}; 161 -> {162}; 162 -> {163}; - 163 -> {164 181}; - 163 -> {181} [style=dashed]; - 164 -> {165}; + 163 -> {164}; + 164 -> {165 184}; + 164 -> {184} [style=dashed]; 165 -> {166}; 166 -> {167}; 167 -> {168}; 168 -> {169}; - 169 -> {170 189}; - 169 -> {189} [style=dashed]; + 169 -> {170}; 170 -> {171}; 171 -> {172}; 172 -> {173}; 173 -> {174}; 174 -> {175}; - 175 -> {176}; 176 -> {177}; 177 -> {178}; 178 -> {179}; 179 -> {180}; - 181 -> {188 182}; + 180 -> {181}; + 181 -> {182}; 182 -> {183}; - 183 -> {184}; + 183 -> {159}; 184 -> {185}; 185 -> {186}; 186 -> {187}; 187 -> {188}; - 188 -> {164}; - 189 -> {198 190}; + 188 -> {189}; + 189 -> {190}; 190 -> {191}; 191 -> {192}; 192 -> {193}; - 193 -> {194}; - 194 -> {195}; - 195 -> {196}; - 196 -> {197}; - 197 -> {198}; - 198 -> {170}; + 193 -> {165}; subgraph cluster_38 { color=red - 199 [label="Enter function completedCallUnknown" style="filled" fillcolor=red]; + 194 [label="Enter function completedCallUnknown" style="filled" fillcolor=red]; subgraph cluster_39 { color=blue - 200 [label="Enter block"]; - 201 [label="Postponed enter to lambda"]; + 195 [label="Enter block"]; + 196 [label="Postponed enter to lambda"]; subgraph cluster_40 { color=blue - 219 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 214 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_41 { color=blue - 220 [label="Enter block"]; - 221 [label="Access variable R|/y|"]; - 222 [label="Function call: R|/y|.#()"]; - 223 [label="Access variable R|/x|"]; - 224 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 225 [label="Exit block"]; + 215 [label="Enter block"]; + 216 [label="Access variable R|/y|"]; + 217 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 218 [label="Access variable R|/x|"]; + 219 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 220 [label="Exit block"]; } - 226 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 221 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 202 [label="Postponed exit from lambda"]; - 203 [label="Function call: R|/unknown|(...)"]; - 204 [label="Function call: R|/id|(...)"]; - 205 [label="Access variable R|/y|"]; - 206 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 207 [label="Postponed enter to lambda"]; + 197 [label="Postponed exit from lambda"]; + 198 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; + 199 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 200 [label="Access variable R|/y|"]; + 201 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 202 [label="Postponed enter to lambda"]; subgraph cluster_42 { color=blue - 227 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 222 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_43 { color=blue - 228 [label="Enter block"]; - 229 [label="Access variable R|/x|"]; - 230 [label="Function call: R|/x|.#()"]; - 231 [label="Access variable R|/y|"]; - 232 [label="Smart cast: R|/y|"]; - 233 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 234 [label="Const: Int(1)"]; - 235 [label="Exit block"]; + 223 [label="Enter block"]; + 224 [label="Access variable R|/x|"]; + 225 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 226 [label="Access variable R|/y|"]; + 227 [label="Smart cast: R|/y|"]; + 228 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 229 [label="Const: Int(1)"]; + 230 [label="Exit block"]; } - 236 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 231 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 208 [label="Postponed exit from lambda"]; - 209 [label="Function call: R|/unknown|(...)"]; - 210 [label="Function call: R|/select|(...)"]; - 211 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 212 [label="Access variable R|/x|"]; - 213 [label="Function call: R|/x|.#()"]; - 214 [label="Access variable R|/y|"]; - 215 [label="Smart cast: R|/y|"]; - 216 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 217 [label="Exit block"]; + 203 [label="Postponed exit from lambda"]; + 204 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; + 205 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 206 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 207 [label="Access variable R|/x|"]; + 208 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 209 [label="Access variable R|/y|"]; + 210 [label="Smart cast: R|/y|"]; + 211 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 212 [label="Exit block"]; } - 218 [label="Exit function completedCallUnknown" style="filled" fillcolor=red]; + 213 [label="Exit function completedCallUnknown" style="filled" fillcolor=red]; } + 194 -> {195}; + 195 -> {196}; + 196 -> {197 214}; + 196 -> {214} [style=dashed]; + 197 -> {198}; + 197 -> {196} [color=green style=dashed]; + 198 -> {199}; 199 -> {200}; 200 -> {201}; - 201 -> {202 219}; - 201 -> {219} [style=dashed]; - 202 -> {203}; + 201 -> {202}; + 202 -> {203 222}; + 202 -> {222} [style=dashed]; 203 -> {204}; + 203 -> {202} [color=green style=dashed]; 204 -> {205}; 205 -> {206}; 206 -> {207}; - 207 -> {208 227}; - 207 -> {227} [style=dashed]; + 207 -> {208}; 208 -> {209}; 209 -> {210}; 210 -> {211}; 211 -> {212}; 212 -> {213}; - 213 -> {214}; 214 -> {215}; 215 -> {216}; 216 -> {217}; 217 -> {218}; - 219 -> {226 220}; + 218 -> {219}; + 219 -> {220}; 220 -> {221}; - 221 -> {222}; + 221 -> {197}; 222 -> {223}; 223 -> {224}; 224 -> {225}; 225 -> {226}; - 226 -> {202}; - 226 -> {219} [color=green style=dashed]; - 227 -> {236 228}; + 226 -> {227}; + 227 -> {228}; 228 -> {229}; 229 -> {230}; 230 -> {231}; - 231 -> {232}; - 232 -> {233}; - 233 -> {234}; - 234 -> {235}; - 235 -> {236}; - 236 -> {208}; - 236 -> {227} [color=green style=dashed]; + 231 -> {203}; subgraph cluster_44 { color=red - 237 [label="Enter function completedCallNoContract" style="filled" fillcolor=red]; + 232 [label="Enter function completedCallNoContract" style="filled" fillcolor=red]; subgraph cluster_45 { color=blue - 238 [label="Enter block"]; - 239 [label="Postponed enter to lambda"]; + 233 [label="Enter block"]; + 234 [label="Postponed enter to lambda"]; subgraph cluster_46 { color=blue - 257 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 252 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_47 { color=blue - 258 [label="Enter block"]; - 259 [label="Access variable R|/y|"]; - 260 [label="Function call: R|/y|.#()"]; - 261 [label="Access variable R|/x|"]; - 262 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 263 [label="Exit block"]; + 253 [label="Enter block"]; + 254 [label="Access variable R|/y|"]; + 255 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 256 [label="Access variable R|/x|"]; + 257 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 258 [label="Exit block"]; } - 264 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 259 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 240 [label="Postponed exit from lambda"]; - 241 [label="Function call: R|/noContract|(...)"]; - 242 [label="Function call: R|/id|(...)"]; - 243 [label="Access variable R|/y|"]; - 244 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 245 [label="Postponed enter to lambda"]; + 235 [label="Postponed exit from lambda"]; + 236 [label="Function call: R|/noContract|(...)" style="filled" fillcolor=yellow]; + 237 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 238 [label="Access variable R|/y|"]; + 239 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 240 [label="Postponed enter to lambda"]; subgraph cluster_48 { color=blue - 265 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 260 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_49 { color=blue - 266 [label="Enter block"]; - 267 [label="Access variable R|/x|"]; - 268 [label="Function call: R|/x|.#()"]; - 269 [label="Access variable R|/y|"]; - 270 [label="Smart cast: R|/y|"]; - 271 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 272 [label="Const: Int(1)"]; - 273 [label="Exit block"]; + 261 [label="Enter block"]; + 262 [label="Access variable R|/x|"]; + 263 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 264 [label="Access variable R|/y|"]; + 265 [label="Smart cast: R|/y|"]; + 266 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 267 [label="Const: Int(1)"]; + 268 [label="Exit block"]; } - 274 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 269 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 246 [label="Postponed exit from lambda"]; - 247 [label="Function call: R|/noContract|(...)"]; - 248 [label="Function call: R|/select|(...)"]; - 249 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 250 [label="Access variable R|/x|"]; - 251 [label="Function call: R|/x|.#()"]; - 252 [label="Access variable R|/y|"]; - 253 [label="Smart cast: R|/y|"]; - 254 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 255 [label="Exit block"]; + 241 [label="Postponed exit from lambda"]; + 242 [label="Function call: R|/noContract|(...)" style="filled" fillcolor=yellow]; + 243 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 244 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 245 [label="Access variable R|/x|"]; + 246 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 247 [label="Access variable R|/y|"]; + 248 [label="Smart cast: R|/y|"]; + 249 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 250 [label="Exit block"]; } - 256 [label="Exit function completedCallNoContract" style="filled" fillcolor=red]; + 251 [label="Exit function completedCallNoContract" style="filled" fillcolor=red]; } + 232 -> {233}; + 233 -> {234}; + 234 -> {235 252}; + 234 -> {252} [style=dashed]; + 235 -> {236}; + 236 -> {237}; 237 -> {238}; 238 -> {239}; - 239 -> {240 257}; - 239 -> {257} [style=dashed]; - 240 -> {241}; + 239 -> {240}; + 240 -> {241 260}; + 240 -> {260} [style=dashed]; 241 -> {242}; 242 -> {243}; 243 -> {244}; 244 -> {245}; - 245 -> {246 265}; - 245 -> {265} [style=dashed]; + 245 -> {246}; 246 -> {247}; 247 -> {248}; 248 -> {249}; 249 -> {250}; 250 -> {251}; - 251 -> {252}; 252 -> {253}; 253 -> {254}; 254 -> {255}; 255 -> {256}; + 256 -> {257}; 257 -> {258}; 258 -> {259}; - 259 -> {260}; 260 -> {261}; 261 -> {262}; 262 -> {263}; 263 -> {264}; + 264 -> {265}; 265 -> {266}; 266 -> {267}; 267 -> {268}; 268 -> {269}; - 269 -> {270}; - 270 -> {271}; - 271 -> {272}; - 272 -> {273}; - 273 -> {274}; subgraph cluster_50 { color=red - 275 [label="Enter function incompleteCallExactlyOnce" style="filled" fillcolor=red]; + 270 [label="Enter function incompleteCallExactlyOnce" style="filled" fillcolor=red]; subgraph cluster_51 { color=blue - 276 [label="Enter block"]; - 277 [label="Postponed enter to lambda"]; + 271 [label="Enter block"]; + 272 [label="Postponed enter to lambda"]; subgraph cluster_52 { color=blue - 295 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 289 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_53 { color=blue - 296 [label="Enter block"]; - 297 [label="Access variable R|/x|"]; - 298 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 299 [label="Access variable R|/y|"]; - 300 [label="Function call: R|/y|.#()"]; - 301 [label="Access variable R|/x|"]; - 302 [label="Smart cast: R|/x|"]; - 303 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 304 [label="Function call: R|/materialize|()"]; - 305 [label="Exit block"]; + 290 [label="Enter block"]; + 291 [label="Access variable R|/x|"]; + 292 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 293 [label="Access variable R|/y|"]; + 294 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 295 [label="Access variable R|/x|"]; + 296 [label="Smart cast: R|/x|"]; + 297 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 298 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 299 [label="Exit block"]; } - 306 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 300 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 278 [label="Postponed exit from lambda"]; - 279 [label="Function call: R|/exactlyOnce|(...)"]; - 280 [label="Function call: R|/id|(...)"]; - 281 [label="Postponed enter to lambda"]; + 273 [label="Postponed exit from lambda"]; + 274 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 275 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 276 [label="Postponed enter to lambda"]; subgraph cluster_54 { color=blue - 307 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 301 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_55 { color=blue - 308 [label="Enter block"]; - 309 [label="Access variable R|/y|"]; - 310 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 311 [label="Access variable R|/x|"]; - 312 [label="Function call: R|/x|.#()"]; - 313 [label="Access variable R|/y|"]; - 314 [label="Smart cast: R|/y|"]; - 315 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 316 [label="Const: Int(1)"]; - 317 [label="Exit block"]; + 302 [label="Enter block"]; + 303 [label="Access variable R|/y|"]; + 304 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 305 [label="Access variable R|/x|"]; + 306 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 307 [label="Access variable R|/y|"]; + 308 [label="Smart cast: R|/y|"]; + 309 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 310 [label="Const: Int(1)"]; + 311 [label="Exit block"]; } - 318 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 312 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 282 [label="Postponed exit from lambda"]; - 283 [label="Function call: R|/exactlyOnce|(...)"]; - 284 [label="Call arguments union" style="filled" fillcolor=yellow]; - 285 [label="Function call: R|/select|(...)"]; - 286 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 287 [label="Access variable R|/x|"]; - 288 [label="Smart cast: R|/x|"]; - 289 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 290 [label="Access variable R|/y|"]; - 291 [label="Smart cast: R|/y|"]; - 292 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 293 [label="Exit block"]; + 277 [label="Postponed exit from lambda"]; + 278 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 279 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 280 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 281 [label="Access variable R|/x|"]; + 282 [label="Smart cast: R|/x|"]; + 283 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 284 [label="Access variable R|/y|"]; + 285 [label="Smart cast: R|/y|"]; + 286 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 287 [label="Exit block"]; } - 294 [label="Exit function incompleteCallExactlyOnce" style="filled" fillcolor=red]; + 288 [label="Exit function incompleteCallExactlyOnce" style="filled" fillcolor=red]; } + 270 -> {271}; + 271 -> {272}; + 272 -> {289}; + 272 -> {273} [color=red]; + 272 -> {289} [style=dashed]; + 273 -> {274}; + 274 -> {275}; 275 -> {276}; - 276 -> {277}; - 277 -> {295}; - 277 -> {278} [color=red]; - 277 -> {295} [style=dashed]; + 276 -> {301}; + 276 -> {277} [color=red]; + 276 -> {301} [style=dashed]; + 277 -> {278}; 278 -> {279}; 279 -> {280}; 280 -> {281}; - 281 -> {307}; - 281 -> {282} [color=red]; - 281 -> {307} [style=dashed]; + 281 -> {282}; 282 -> {283}; 283 -> {284}; 284 -> {285}; 285 -> {286}; 286 -> {287}; 287 -> {288}; - 288 -> {289}; 289 -> {290}; 290 -> {291}; 291 -> {292}; 292 -> {293}; 293 -> {294}; + 294 -> {295}; 295 -> {296}; 296 -> {297}; 297 -> {298}; 298 -> {299}; 299 -> {300}; - 300 -> {301}; + 300 -> {279} [color=red]; + 300 -> {273} [color=green]; 301 -> {302}; 302 -> {303}; 303 -> {304}; 304 -> {305}; 305 -> {306}; - 306 -> {284} [color=red]; - 306 -> {278} [color=green]; + 306 -> {307}; 307 -> {308}; 308 -> {309}; 309 -> {310}; 310 -> {311}; 311 -> {312}; - 312 -> {313}; - 313 -> {314}; - 314 -> {315}; - 315 -> {316}; - 316 -> {317}; - 317 -> {318}; - 318 -> {284} [color=red]; - 318 -> {282} [color=green]; + 312 -> {279} [color=red]; + 312 -> {277} [color=green]; subgraph cluster_56 { color=red - 319 [label="Enter function incompleteCallAtLeastOnce" style="filled" fillcolor=red]; + 313 [label="Enter function incompleteCallAtLeastOnce" style="filled" fillcolor=red]; subgraph cluster_57 { color=blue - 320 [label="Enter block"]; - 321 [label="Postponed enter to lambda"]; + 314 [label="Enter block"]; + 315 [label="Postponed enter to lambda"]; subgraph cluster_58 { color=blue - 339 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 332 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_59 { color=blue - 340 [label="Enter block"]; - 341 [label="Access variable R|/x|"]; - 342 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 343 [label="Access variable R|/y|"]; - 344 [label="Function call: R|/y|.#()"]; - 345 [label="Access variable R|/x|"]; - 346 [label="Smart cast: R|/x|"]; - 347 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 348 [label="Function call: R|/materialize|()"]; - 349 [label="Exit block"]; + 333 [label="Enter block"]; + 334 [label="Access variable R|/x|"]; + 335 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 336 [label="Access variable R|/y|"]; + 337 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 338 [label="Access variable R|/x|"]; + 339 [label="Smart cast: R|/x|"]; + 340 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 341 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 342 [label="Exit block"]; } - 350 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 343 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 322 [label="Postponed exit from lambda"]; - 323 [label="Function call: R|/atLeastOnce|(...)"]; - 324 [label="Function call: R|/id|(...)"]; - 325 [label="Postponed enter to lambda"]; + 316 [label="Postponed exit from lambda"]; + 317 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow]; + 318 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 319 [label="Postponed enter to lambda"]; subgraph cluster_60 { color=blue - 351 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 344 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_61 { color=blue - 352 [label="Enter block"]; - 353 [label="Access variable R|/y|"]; - 354 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 355 [label="Access variable R|/x|"]; - 356 [label="Function call: R|/x|.#()"]; - 357 [label="Access variable R|/y|"]; - 358 [label="Smart cast: R|/y|"]; - 359 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 360 [label="Const: Int(1)"]; - 361 [label="Exit block"]; + 345 [label="Enter block"]; + 346 [label="Access variable R|/y|"]; + 347 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 348 [label="Access variable R|/x|"]; + 349 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 350 [label="Access variable R|/y|"]; + 351 [label="Smart cast: R|/y|"]; + 352 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 353 [label="Const: Int(1)"]; + 354 [label="Exit block"]; } - 362 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 355 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 326 [label="Postponed exit from lambda"]; - 327 [label="Function call: R|/atLeastOnce|(...)"]; - 328 [label="Call arguments union" style="filled" fillcolor=yellow]; - 329 [label="Function call: R|/select|(...)"]; - 330 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 331 [label="Access variable R|/x|"]; - 332 [label="Smart cast: R|/x|"]; - 333 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 334 [label="Access variable R|/y|"]; - 335 [label="Smart cast: R|/y|"]; - 336 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 337 [label="Exit block"]; + 320 [label="Postponed exit from lambda"]; + 321 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow]; + 322 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 323 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 324 [label="Access variable R|/x|"]; + 325 [label="Smart cast: R|/x|"]; + 326 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 327 [label="Access variable R|/y|"]; + 328 [label="Smart cast: R|/y|"]; + 329 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 330 [label="Exit block"]; } - 338 [label="Exit function incompleteCallAtLeastOnce" style="filled" fillcolor=red]; + 331 [label="Exit function incompleteCallAtLeastOnce" style="filled" fillcolor=red]; } - 319 -> {320}; + 313 -> {314}; + 314 -> {315}; + 315 -> {332}; + 315 -> {316} [color=red]; + 315 -> {332} [style=dashed]; + 316 -> {317}; + 316 -> {315} [color=green style=dashed]; + 317 -> {318}; + 318 -> {319}; + 319 -> {344}; + 319 -> {320} [color=red]; + 319 -> {344} [style=dashed]; 320 -> {321}; - 321 -> {339}; - 321 -> {322} [color=red]; - 321 -> {339} [style=dashed]; + 320 -> {319} [color=green style=dashed]; + 321 -> {322}; 322 -> {323}; 323 -> {324}; 324 -> {325}; - 325 -> {351}; - 325 -> {326} [color=red]; - 325 -> {351} [style=dashed]; + 325 -> {326}; 326 -> {327}; 327 -> {328}; 328 -> {329}; 329 -> {330}; 330 -> {331}; - 331 -> {332}; 332 -> {333}; 333 -> {334}; 334 -> {335}; 335 -> {336}; 336 -> {337}; 337 -> {338}; + 338 -> {339}; 339 -> {340}; 340 -> {341}; 341 -> {342}; 342 -> {343}; - 343 -> {344}; + 343 -> {322} [color=red]; + 343 -> {316} [color=green]; 344 -> {345}; 345 -> {346}; 346 -> {347}; 347 -> {348}; 348 -> {349}; 349 -> {350}; - 350 -> {328} [color=red]; - 350 -> {322} [color=green]; - 350 -> {339} [color=green style=dashed]; + 350 -> {351}; 351 -> {352}; 352 -> {353}; 353 -> {354}; 354 -> {355}; - 355 -> {356}; - 356 -> {357}; - 357 -> {358}; - 358 -> {359}; - 359 -> {360}; - 360 -> {361}; - 361 -> {362}; - 362 -> {328} [color=red]; - 362 -> {326} [color=green]; - 362 -> {351} [color=green style=dashed]; + 355 -> {322} [color=red]; + 355 -> {320} [color=green]; subgraph cluster_62 { color=red - 363 [label="Enter function incompleteCallAtMostOnce" style="filled" fillcolor=red]; + 356 [label="Enter function incompleteCallAtMostOnce" style="filled" fillcolor=red]; subgraph cluster_63 { color=blue - 364 [label="Enter block"]; - 365 [label="Postponed enter to lambda"]; + 357 [label="Enter block"]; + 358 [label="Postponed enter to lambda"]; subgraph cluster_64 { color=blue - 380 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 373 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_65 { color=blue - 381 [label="Enter block"]; - 382 [label="Access variable R|/x|"]; - 383 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 384 [label="Access variable R|/y|"]; - 385 [label="Function call: R|/y|.#()"]; - 386 [label="Access variable R|/x|"]; - 387 [label="Smart cast: R|/x|"]; - 388 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 389 [label="Function call: R|/materialize|()"]; - 390 [label="Exit block"]; + 374 [label="Enter block"]; + 375 [label="Access variable R|/x|"]; + 376 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 377 [label="Access variable R|/y|"]; + 378 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 379 [label="Access variable R|/x|"]; + 380 [label="Smart cast: R|/x|"]; + 381 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 382 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 383 [label="Exit block"]; } - 391 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 384 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 366 [label="Postponed exit from lambda"]; - 367 [label="Function call: R|/atMostOnce|(...)"]; - 368 [label="Function call: R|/id|(...)"]; - 369 [label="Postponed enter to lambda"]; + 359 [label="Postponed exit from lambda"]; + 360 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow]; + 361 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 362 [label="Postponed enter to lambda"]; subgraph cluster_66 { color=blue - 392 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 385 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_67 { color=blue - 393 [label="Enter block"]; - 394 [label="Access variable R|/y|"]; - 395 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 396 [label="Access variable R|/x|"]; - 397 [label="Function call: R|/x|.#()"]; - 398 [label="Access variable R|/y|"]; - 399 [label="Smart cast: R|/y|"]; - 400 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 401 [label="Const: Int(1)"]; - 402 [label="Exit block"]; + 386 [label="Enter block"]; + 387 [label="Access variable R|/y|"]; + 388 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 389 [label="Access variable R|/x|"]; + 390 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 391 [label="Access variable R|/y|"]; + 392 [label="Smart cast: R|/y|"]; + 393 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 394 [label="Const: Int(1)"]; + 395 [label="Exit block"]; } - 403 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 396 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 370 [label="Postponed exit from lambda"]; - 371 [label="Function call: R|/atMostOnce|(...)"]; - 372 [label="Function call: R|/select|(...)"]; - 373 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 374 [label="Access variable R|/x|"]; - 375 [label="Function call: R|/x|.#()"]; - 376 [label="Access variable R|/y|"]; - 377 [label="Function call: R|/y|.#()"]; - 378 [label="Exit block"]; + 363 [label="Postponed exit from lambda"]; + 364 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow]; + 365 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 366 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 367 [label="Access variable R|/x|"]; + 368 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 369 [label="Access variable R|/y|"]; + 370 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 371 [label="Exit block"]; } - 379 [label="Exit function incompleteCallAtMostOnce" style="filled" fillcolor=red]; + 372 [label="Exit function incompleteCallAtMostOnce" style="filled" fillcolor=red]; } + 356 -> {357}; + 357 -> {358}; + 358 -> {359 373}; + 358 -> {373} [style=dashed]; + 359 -> {360}; + 360 -> {361}; + 361 -> {362}; + 362 -> {363 385}; + 362 -> {385} [style=dashed]; 363 -> {364}; 364 -> {365}; - 365 -> {366 380}; - 365 -> {380} [style=dashed]; + 365 -> {366}; 366 -> {367}; 367 -> {368}; 368 -> {369}; - 369 -> {370 392}; - 369 -> {392} [style=dashed]; + 369 -> {370}; 370 -> {371}; 371 -> {372}; - 372 -> {373}; 373 -> {374}; 374 -> {375}; 375 -> {376}; 376 -> {377}; 377 -> {378}; 378 -> {379}; - 380 -> {391 381}; + 379 -> {380}; + 380 -> {381}; 381 -> {382}; 382 -> {383}; 383 -> {384}; - 384 -> {385}; + 384 -> {359}; 385 -> {386}; 386 -> {387}; 387 -> {388}; 388 -> {389}; 389 -> {390}; 390 -> {391}; - 391 -> {366}; - 392 -> {403 393}; + 391 -> {392}; + 392 -> {393}; 393 -> {394}; 394 -> {395}; 395 -> {396}; - 396 -> {397}; - 397 -> {398}; - 398 -> {399}; - 399 -> {400}; - 400 -> {401}; - 401 -> {402}; - 402 -> {403}; - 403 -> {370}; + 396 -> {363}; subgraph cluster_68 { color=red - 404 [label="Enter function incompleteCallUnknown" style="filled" fillcolor=red]; + 397 [label="Enter function incompleteCallUnknown" style="filled" fillcolor=red]; subgraph cluster_69 { color=blue - 405 [label="Enter block"]; - 406 [label="Postponed enter to lambda"]; + 398 [label="Enter block"]; + 399 [label="Postponed enter to lambda"]; subgraph cluster_70 { color=blue - 421 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 414 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_71 { color=blue - 422 [label="Enter block"]; - 423 [label="Access variable R|/x|"]; - 424 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 425 [label="Access variable R|/y|"]; - 426 [label="Function call: R|/y|.#()"]; - 427 [label="Access variable R|/x|"]; - 428 [label="Smart cast: R|/x|"]; - 429 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 430 [label="Function call: R|/materialize|()"]; - 431 [label="Exit block"]; + 415 [label="Enter block"]; + 416 [label="Access variable R|/x|"]; + 417 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 418 [label="Access variable R|/y|"]; + 419 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 420 [label="Access variable R|/x|"]; + 421 [label="Smart cast: R|/x|"]; + 422 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 423 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 424 [label="Exit block"]; } - 432 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 425 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 407 [label="Postponed exit from lambda"]; - 408 [label="Function call: R|/unknown|(...)"]; - 409 [label="Function call: R|/id|(...)"]; - 410 [label="Postponed enter to lambda"]; + 400 [label="Postponed exit from lambda"]; + 401 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; + 402 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 403 [label="Postponed enter to lambda"]; subgraph cluster_72 { color=blue - 433 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 426 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_73 { color=blue - 434 [label="Enter block"]; - 435 [label="Access variable R|/y|"]; - 436 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 437 [label="Access variable R|/x|"]; - 438 [label="Function call: R|/x|.#()"]; - 439 [label="Access variable R|/y|"]; - 440 [label="Smart cast: R|/y|"]; - 441 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 442 [label="Const: Int(1)"]; - 443 [label="Exit block"]; + 427 [label="Enter block"]; + 428 [label="Access variable R|/y|"]; + 429 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 430 [label="Access variable R|/x|"]; + 431 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 432 [label="Access variable R|/y|"]; + 433 [label="Smart cast: R|/y|"]; + 434 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 435 [label="Const: Int(1)"]; + 436 [label="Exit block"]; } - 444 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 437 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 411 [label="Postponed exit from lambda"]; - 412 [label="Function call: R|/unknown|(...)"]; - 413 [label="Function call: R|/select|(...)"]; - 414 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 415 [label="Access variable R|/x|"]; - 416 [label="Function call: R|/x|.#()"]; - 417 [label="Access variable R|/y|"]; - 418 [label="Function call: R|/y|.#()"]; - 419 [label="Exit block"]; + 404 [label="Postponed exit from lambda"]; + 405 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; + 406 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 407 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 408 [label="Access variable R|/x|"]; + 409 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 410 [label="Access variable R|/y|"]; + 411 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 412 [label="Exit block"]; } - 420 [label="Exit function incompleteCallUnknown" style="filled" fillcolor=red]; + 413 [label="Exit function incompleteCallUnknown" style="filled" fillcolor=red]; } + 397 -> {398}; + 398 -> {399}; + 399 -> {400 414}; + 399 -> {414} [style=dashed]; + 400 -> {401}; + 400 -> {399} [color=green style=dashed]; + 401 -> {402}; + 402 -> {403}; + 403 -> {404 426}; + 403 -> {426} [style=dashed]; 404 -> {405}; + 404 -> {403} [color=green style=dashed]; 405 -> {406}; - 406 -> {407 421}; - 406 -> {421} [style=dashed]; + 406 -> {407}; 407 -> {408}; 408 -> {409}; 409 -> {410}; - 410 -> {411 433}; - 410 -> {433} [style=dashed]; + 410 -> {411}; 411 -> {412}; 412 -> {413}; - 413 -> {414}; 414 -> {415}; 415 -> {416}; 416 -> {417}; 417 -> {418}; 418 -> {419}; 419 -> {420}; - 421 -> {432 422}; + 420 -> {421}; + 421 -> {422}; 422 -> {423}; 423 -> {424}; 424 -> {425}; - 425 -> {426}; + 425 -> {400}; 426 -> {427}; 427 -> {428}; 428 -> {429}; 429 -> {430}; 430 -> {431}; 431 -> {432}; - 432 -> {407}; - 432 -> {421} [color=green style=dashed]; - 433 -> {444 434}; + 432 -> {433}; + 433 -> {434}; 434 -> {435}; 435 -> {436}; 436 -> {437}; - 437 -> {438}; - 438 -> {439}; - 439 -> {440}; - 440 -> {441}; - 441 -> {442}; - 442 -> {443}; - 443 -> {444}; - 444 -> {411}; - 444 -> {433} [color=green style=dashed]; + 437 -> {404}; subgraph cluster_74 { color=red - 445 [label="Enter function incompleteCallNoContract" style="filled" fillcolor=red]; + 438 [label="Enter function incompleteCallNoContract" style="filled" fillcolor=red]; subgraph cluster_75 { color=blue - 446 [label="Enter block"]; - 447 [label="Postponed enter to lambda"]; + 439 [label="Enter block"]; + 440 [label="Postponed enter to lambda"]; subgraph cluster_76 { color=blue - 462 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 455 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_77 { color=blue - 463 [label="Enter block"]; - 464 [label="Access variable R|/x|"]; - 465 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; - 466 [label="Access variable R|/y|"]; - 467 [label="Function call: R|/y|.#()"]; - 468 [label="Access variable R|/x|"]; - 469 [label="Smart cast: R|/x|"]; - 470 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 471 [label="Function call: R|/materialize|()"]; - 472 [label="Exit block"]; + 456 [label="Enter block"]; + 457 [label="Access variable R|/x|"]; + 458 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; + 459 [label="Access variable R|/y|"]; + 460 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 461 [label="Access variable R|/x|"]; + 462 [label="Smart cast: R|/x|"]; + 463 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 464 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 465 [label="Exit block"]; } - 473 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 466 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 448 [label="Postponed exit from lambda"]; - 449 [label="Function call: R|/noContract|(...)"]; - 450 [label="Function call: R|/id|(...)"]; - 451 [label="Postponed enter to lambda"]; + 441 [label="Postponed exit from lambda"]; + 442 [label="Function call: R|/noContract|(...)" style="filled" fillcolor=yellow]; + 443 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 444 [label="Postponed enter to lambda"]; subgraph cluster_78 { color=blue - 474 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 467 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_79 { color=blue - 475 [label="Enter block"]; - 476 [label="Access variable R|/y|"]; - 477 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; - 478 [label="Access variable R|/x|"]; - 479 [label="Function call: R|/x|.#()"]; - 480 [label="Access variable R|/y|"]; - 481 [label="Smart cast: R|/y|"]; - 482 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 483 [label="Const: Int(1)"]; - 484 [label="Exit block"]; + 468 [label="Enter block"]; + 469 [label="Access variable R|/y|"]; + 470 [label="Type operator: (R|/y| as R|kotlin/Int|)"]; + 471 [label="Access variable R|/x|"]; + 472 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 473 [label="Access variable R|/y|"]; + 474 [label="Smart cast: R|/y|"]; + 475 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 476 [label="Const: Int(1)"]; + 477 [label="Exit block"]; } - 485 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 478 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 452 [label="Postponed exit from lambda"]; - 453 [label="Function call: R|/noContract|(...)"]; - 454 [label="Function call: R|/select|(...)"]; - 455 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()"]; - 456 [label="Access variable R|/x|"]; - 457 [label="Function call: R|/x|.#()"]; - 458 [label="Access variable R|/y|"]; - 459 [label="Function call: R|/y|.#()"]; - 460 [label="Exit block"]; + 445 [label="Postponed exit from lambda"]; + 446 [label="Function call: R|/noContract|(...)" style="filled" fillcolor=yellow]; + 447 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 448 [label="Function call: R|/select|(...).R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 449 [label="Access variable R|/x|"]; + 450 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 451 [label="Access variable R|/y|"]; + 452 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; + 453 [label="Exit block"]; } - 461 [label="Exit function incompleteCallNoContract" style="filled" fillcolor=red]; + 454 [label="Exit function incompleteCallNoContract" style="filled" fillcolor=red]; } + 438 -> {439}; + 439 -> {440}; + 440 -> {441 455}; + 440 -> {455} [style=dashed]; + 441 -> {442}; + 442 -> {443}; + 443 -> {444}; + 444 -> {445 467}; + 444 -> {467} [style=dashed]; 445 -> {446}; 446 -> {447}; - 447 -> {448 462}; - 447 -> {462} [style=dashed]; + 447 -> {448}; 448 -> {449}; 449 -> {450}; 450 -> {451}; - 451 -> {452 474}; - 451 -> {474} [style=dashed]; + 451 -> {452}; 452 -> {453}; 453 -> {454}; - 454 -> {455}; 455 -> {456}; 456 -> {457}; 457 -> {458}; 458 -> {459}; 459 -> {460}; 460 -> {461}; + 461 -> {462}; 462 -> {463}; 463 -> {464}; 464 -> {465}; 465 -> {466}; - 466 -> {467}; 467 -> {468}; 468 -> {469}; 469 -> {470}; 470 -> {471}; 471 -> {472}; 472 -> {473}; + 473 -> {474}; 474 -> {475}; 475 -> {476}; 476 -> {477}; 477 -> {478}; - 478 -> {479}; - 479 -> {480}; - 480 -> {481}; - 481 -> {482}; - 482 -> {483}; - 483 -> {484}; - 484 -> {485}; subgraph cluster_80 { color=red - 486 [label="Enter function expectedType" style="filled" fillcolor=red]; + 479 [label="Enter function expectedType" style="filled" fillcolor=red]; subgraph cluster_81 { color=blue - 487 [label="Enter block"]; - 488 [label="Postponed enter to lambda"]; + 480 [label="Enter block"]; + 481 [label="Postponed enter to lambda"]; subgraph cluster_82 { color=blue - 501 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 493 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_83 { color=blue - 502 [label="Enter block"]; - 503 [label="Function call: R|/materialize|()"]; - 504 [label="Exit block"]; + 494 [label="Enter block"]; + 495 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 496 [label="Exit block"]; } - 505 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 497 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 489 [label="Postponed exit from lambda"]; - 490 [label="Function call: R|kotlin/run|(...)"]; - 491 [label="Postponed enter to lambda"]; + 482 [label="Postponed exit from lambda"]; + 483 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 484 [label="Postponed enter to lambda"]; subgraph cluster_84 { color=blue - 506 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 498 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_85 { color=blue - 507 [label="Enter block"]; - 508 [label="Function call: R|/materialize|()"]; - 509 [label="Exit block"]; + 499 [label="Enter block"]; + 500 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 501 [label="Exit block"]; } - 510 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 502 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 492 [label="Postponed exit from lambda"]; - 493 [label="Function call: R|kotlin/run|(...)"]; - 494 [label="Call arguments union" style="filled" fillcolor=yellow]; - 495 [label="Function call: R|/select|(...)"]; - 496 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 497 [label="Access variable R|/x|"]; - 498 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 499 [label="Exit block"]; + 485 [label="Postponed exit from lambda"]; + 486 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 487 [label="Function call: R|/select|(...)" style="filled" fillcolor=yellow]; + 488 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 489 [label="Access variable R|/x|"]; + 490 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 491 [label="Exit block"]; } - 500 [label="Exit function expectedType" style="filled" fillcolor=red]; + 492 [label="Exit function expectedType" style="filled" fillcolor=red]; } + 479 -> {480}; + 480 -> {481}; + 481 -> {493}; + 481 -> {482} [color=red]; + 481 -> {493} [style=dashed]; + 482 -> {483}; + 483 -> {484}; + 484 -> {498}; + 484 -> {485} [color=red]; + 484 -> {498} [style=dashed]; + 485 -> {486}; 486 -> {487}; 487 -> {488}; - 488 -> {501}; - 488 -> {489} [color=red]; - 488 -> {501} [style=dashed]; + 488 -> {489}; 489 -> {490}; 490 -> {491}; - 491 -> {506}; - 491 -> {492} [color=red]; - 491 -> {506} [style=dashed]; - 492 -> {493}; + 491 -> {492}; 493 -> {494}; 494 -> {495}; 495 -> {496}; 496 -> {497}; - 497 -> {498}; + 497 -> {487} [color=red]; + 497 -> {482} [color=green]; 498 -> {499}; 499 -> {500}; + 500 -> {501}; 501 -> {502}; - 502 -> {503}; + 502 -> {487} [color=red]; + 502 -> {485} [color=green]; + + subgraph cluster_86 { + color=red + 503 [label="Enter function expectedTypeNested" style="filled" fillcolor=red]; + subgraph cluster_87 { + color=blue + 504 [label="Enter block"]; + 505 [label="Postponed enter to lambda"]; + subgraph cluster_88 { + color=blue + 514 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_89 { + color=blue + 515 [label="Enter block"]; + 516 [label="Postponed enter to lambda"]; + subgraph cluster_90 { + color=blue + 521 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_91 { + color=blue + 522 [label="Enter block"]; + 523 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 524 [label="Exit block"]; + } + 525 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 517 [label="Postponed exit from lambda"]; + 518 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 519 [label="Exit block"]; + } + 520 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 506 [label="Postponed exit from lambda"]; + 507 [label="Function call: R|/noContract|(...)" style="filled" fillcolor=yellow]; + 508 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 509 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 510 [label="Access variable R|/x|"]; + 511 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 512 [label="Exit block"]; + } + 513 [label="Exit function expectedTypeNested" style="filled" fillcolor=red]; + } 503 -> {504}; 504 -> {505}; - 505 -> {494} [color=red]; - 505 -> {489} [color=green]; + 505 -> {506 514}; + 505 -> {514} [style=dashed]; 506 -> {507}; 507 -> {508}; 508 -> {509}; 509 -> {510}; - 510 -> {494} [color=red]; - 510 -> {492} [color=green]; - - subgraph cluster_86 { - color=red - 511 [label="Enter function expectedTypeNested" style="filled" fillcolor=red]; - subgraph cluster_87 { - color=blue - 512 [label="Enter block"]; - 513 [label="Postponed enter to lambda"]; - subgraph cluster_88 { - color=blue - 522 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_89 { - color=blue - 523 [label="Enter block"]; - 524 [label="Postponed enter to lambda"]; - subgraph cluster_90 { - color=blue - 529 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_91 { - color=blue - 530 [label="Enter block"]; - 531 [label="Function call: R|/materialize|()"]; - 532 [label="Exit block"]; - } - 533 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 525 [label="Postponed exit from lambda"]; - 526 [label="Function call: R|kotlin/run|(...)"]; - 527 [label="Exit block"]; - } - 528 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 514 [label="Postponed exit from lambda"]; - 515 [label="Function call: R|/noContract|(...)"]; - 516 [label="Function call: R|/id|(...)"]; - 517 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 518 [label="Access variable R|/x|"]; - 519 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 520 [label="Exit block"]; - } - 521 [label="Exit function expectedTypeNested" style="filled" fillcolor=red]; - } + 510 -> {511}; 511 -> {512}; 512 -> {513}; - 513 -> {514 522}; - 513 -> {522} [style=dashed]; 514 -> {515}; 515 -> {516}; - 516 -> {517}; + 516 -> {521}; + 516 -> {517} [color=red]; + 516 -> {521} [style=dashed]; 517 -> {518}; 518 -> {519}; 519 -> {520}; - 520 -> {521}; + 521 -> {522}; 522 -> {523}; 523 -> {524}; - 524 -> {529}; - 524 -> {525} [color=red]; - 524 -> {529} [style=dashed]; - 525 -> {526}; - 526 -> {527}; - 527 -> {528}; - 529 -> {530}; - 530 -> {531}; - 531 -> {532}; - 532 -> {533}; - 533 -> {525} [color=green]; + 524 -> {525}; + 525 -> {517} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda2.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda2.dot index 506238b892e..55e712c2762 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda2.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda2.dot @@ -89,58 +89,57 @@ digraph flowFromInplaceLambda2_kt { 27 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 42 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 41 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 43 [label="Enter block"]; - 44 [label="Access variable R|/x|"]; - 45 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 46 [label="Function call: R|/n|()"]; - 47 [label="Exit block"]; + 42 [label="Enter block"]; + 43 [label="Access variable R|/x|"]; + 44 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 45 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 46 [label="Exit block"]; } - 48 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 47 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 28 [label="Postponed exit from lambda"]; - 29 [label="Function call: R|kotlin/run|(...)"]; - 30 [label="Function call: R|/id|(...)"]; + 29 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 30 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; 31 [label="Const: Int(1)"]; 32 [label="Postponed enter to lambda"]; subgraph cluster_12 { color=blue - 49 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 48 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 50 [label="Enter block"]; - 51 [label="Access variable R|/x|"]; - 52 [label="Access variable #"]; - 53 [label="Const: Int(123)"]; - 54 [label="Exit block"]; + 49 [label="Enter block"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Access variable #"]; + 52 [label="Const: Int(123)"]; + 53 [label="Exit block"]; } - 55 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 33 [label="Postponed exit from lambda"]; - 34 [label="Function call: R|kotlin/run|(...)"]; - 35 [label="Call arguments union" style="filled" fillcolor=yellow]; - 36 [label="Function call: R|/foo|(...)"]; - 37 [label="Access variable R|/x|"]; - 38 [label="Smart cast: R|/x|"]; - 39 [label="Access variable R|kotlin/String.length|"]; - 40 [label="Exit block"]; + 34 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 35 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 36 [label="Access variable R|/x|"]; + 37 [label="Smart cast: R|/x|"]; + 38 [label="Access variable R|kotlin/String.length|"]; + 39 [label="Exit block"]; } - 41 [label="Exit function test1" style="filled" fillcolor=red]; + 40 [label="Exit function test1" style="filled" fillcolor=red]; } 25 -> {26}; 26 -> {27}; - 27 -> {42}; + 27 -> {41}; 27 -> {28} [color=red]; - 27 -> {42} [style=dashed]; + 27 -> {41} [style=dashed]; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {49}; + 32 -> {48}; 32 -> {33} [color=red]; - 32 -> {49} [style=dashed]; + 32 -> {48} [style=dashed]; 33 -> {34}; 34 -> {35}; 35 -> {36}; @@ -148,809 +147,796 @@ digraph flowFromInplaceLambda2_kt { 37 -> {38}; 38 -> {39}; 39 -> {40}; - 40 -> {41}; + 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; - 48 -> {35} [color=red]; - 48 -> {28} [color=green]; + 47 -> {35} [color=red]; + 47 -> {28} [color=green]; + 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; - 55 -> {35} [color=red]; - 55 -> {33} [color=green]; + 54 -> {35} [color=red]; + 54 -> {33} [color=green]; subgraph cluster_14 { color=red - 56 [label="Enter function test2" style="filled" fillcolor=red]; + 55 [label="Enter function test2" style="filled" fillcolor=red]; subgraph cluster_15 { color=blue - 57 [label="Enter block"]; - 58 [label="Postponed enter to lambda"]; + 56 [label="Enter block"]; + 57 [label="Postponed enter to lambda"]; subgraph cluster_16 { color=blue - 74 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 72 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 75 [label="Enter block"]; - 76 [label="Access variable R|/x|"]; - 77 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 78 [label="Function call: R|/n|()"]; - 79 [label="Exit block"]; + 73 [label="Enter block"]; + 74 [label="Access variable R|/x|"]; + 75 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 76 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 77 [label="Exit block"]; } - 80 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 78 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 59 [label="Postponed exit from lambda"]; - 60 [label="Function call: R|kotlin/run|(...)"]; - 61 [label="Function call: R|/id|(...)"]; - 62 [label="Const: Int(1)"]; - 63 [label="Function call: R|/someCompletedCall|(...)"]; - 64 [label="Postponed enter to lambda"]; + 58 [label="Postponed exit from lambda"]; + 59 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 60 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 61 [label="Const: Int(1)"]; + 62 [label="Function call: R|/someCompletedCall|(...)" style="filled" fillcolor=yellow]; + 63 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 81 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 79 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 82 [label="Enter block"]; - 83 [label="Access variable R|/x|"]; - 84 [label="Access variable #"]; - 85 [label="Const: Int(123)"]; - 86 [label="Exit block"]; + 80 [label="Enter block"]; + 81 [label="Access variable R|/x|"]; + 82 [label="Access variable #"]; + 83 [label="Const: Int(123)"]; + 84 [label="Exit block"]; } - 87 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 85 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 65 [label="Postponed exit from lambda"]; - 66 [label="Function call: R|kotlin/run|(...)"]; - 67 [label="Call arguments union" style="filled" fillcolor=yellow]; - 68 [label="Function call: R|/foo|(...)"]; - 69 [label="Access variable R|/x|"]; - 70 [label="Smart cast: R|/x|"]; - 71 [label="Access variable R|kotlin/String.length|"]; - 72 [label="Exit block"]; + 64 [label="Postponed exit from lambda"]; + 65 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 66 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 67 [label="Access variable R|/x|"]; + 68 [label="Smart cast: R|/x|"]; + 69 [label="Access variable R|kotlin/String.length|"]; + 70 [label="Exit block"]; } - 73 [label="Exit function test2" style="filled" fillcolor=red]; + 71 [label="Exit function test2" style="filled" fillcolor=red]; } + 55 -> {56}; 56 -> {57}; - 57 -> {58}; - 58 -> {74}; - 58 -> {59} [color=red]; - 58 -> {74} [style=dashed]; + 57 -> {72}; + 57 -> {58} [color=red]; + 57 -> {72} [style=dashed]; + 58 -> {59}; 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; - 63 -> {64}; - 64 -> {81}; - 64 -> {65} [color=red]; - 64 -> {81} [style=dashed]; + 63 -> {79}; + 63 -> {64} [color=red]; + 63 -> {79} [style=dashed]; + 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; - 71 -> {72}; 72 -> {73}; + 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; - 78 -> {79}; + 78 -> {66} [color=red]; + 78 -> {58} [color=green]; 79 -> {80}; - 80 -> {67} [color=red]; - 80 -> {59} [color=green]; + 80 -> {81}; 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {67} [color=red]; - 87 -> {65} [color=green]; + 85 -> {66} [color=red]; + 85 -> {64} [color=green]; subgraph cluster_20 { color=red - 88 [label="Enter function test3" style="filled" fillcolor=red]; + 86 [label="Enter function test3" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 89 [label="Enter block"]; - 90 [label="Postponed enter to lambda"]; + 87 [label="Enter block"]; + 88 [label="Postponed enter to lambda"]; subgraph cluster_22 { color=blue - 121 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 118 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 122 [label="Enter block"]; - 123 [label="Access variable R|/x|"]; - 124 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 125 [label="Function call: R|/n|()"]; - 126 [label="Exit block"]; + 119 [label="Enter block"]; + 120 [label="Access variable R|/x|"]; + 121 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 122 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 123 [label="Exit block"]; } - 127 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 124 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 91 [label="Postponed exit from lambda"]; - 92 [label="Function call: R|kotlin/run|(...)"]; - 93 [label="Function call: R|/id|(...)"]; + 89 [label="Postponed exit from lambda"]; + 90 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 91 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; subgraph cluster_24 { color=blue - 94 [label="Enter when"]; + 92 [label="Enter when"]; subgraph cluster_25 { color=blue - 95 [label="Enter when branch condition "]; - 96 [label="Const: Boolean(true)"]; - 97 [label="Exit when branch condition"]; + 93 [label="Enter when branch condition "]; + 94 [label="Const: Boolean(true)"]; + 95 [label="Exit when branch condition"]; } subgraph cluster_26 { color=blue - 98 [label="Enter when branch condition else"]; - 99 [label="Exit when branch condition"]; + 96 [label="Enter when branch condition else"]; + 97 [label="Exit when branch condition"]; } - 100 [label="Enter when branch result"]; + 98 [label="Enter when branch result"]; subgraph cluster_27 { color=blue - 101 [label="Enter block"]; - 102 [label="Const: Int(2)"]; - 103 [label="Exit block"]; + 99 [label="Enter block"]; + 100 [label="Const: Int(2)"]; + 101 [label="Exit block"]; } - 104 [label="Exit when branch result"]; - 105 [label="Enter when branch result"]; + 102 [label="Exit when branch result"]; + 103 [label="Enter when branch result"]; subgraph cluster_28 { color=blue - 106 [label="Enter block"]; - 107 [label="Const: Int(1)"]; - 108 [label="Exit block"]; + 104 [label="Enter block"]; + 105 [label="Const: Int(1)"]; + 106 [label="Exit block"]; } - 109 [label="Exit when branch result"]; - 110 [label="Exit when"]; + 107 [label="Exit when branch result"]; + 108 [label="Exit when"]; } - 111 [label="Postponed enter to lambda"]; + 109 [label="Postponed enter to lambda"]; subgraph cluster_29 { color=blue - 128 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 125 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_30 { color=blue - 129 [label="Enter block"]; - 130 [label="Access variable R|/x|"]; - 131 [label="Access variable #"]; - 132 [label="Const: Int(123)"]; - 133 [label="Exit block"]; + 126 [label="Enter block"]; + 127 [label="Access variable R|/x|"]; + 128 [label="Access variable #"]; + 129 [label="Const: Int(123)"]; + 130 [label="Exit block"]; } - 134 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 131 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 112 [label="Postponed exit from lambda"]; - 113 [label="Function call: R|kotlin/run|(...)"]; - 114 [label="Call arguments union" style="filled" fillcolor=yellow]; - 115 [label="Function call: R|/foo|(...)"]; - 116 [label="Access variable R|/x|"]; - 117 [label="Smart cast: R|/x|"]; - 118 [label="Access variable R|kotlin/String.length|"]; - 119 [label="Exit block"]; + 110 [label="Postponed exit from lambda"]; + 111 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 112 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 113 [label="Access variable R|/x|"]; + 114 [label="Smart cast: R|/x|"]; + 115 [label="Access variable R|kotlin/String.length|"]; + 116 [label="Exit block"]; } - 120 [label="Exit function test3" style="filled" fillcolor=red]; + 117 [label="Exit function test3" style="filled" fillcolor=red]; } - 88 -> {89}; + 86 -> {87}; + 87 -> {88}; + 88 -> {118}; + 88 -> {89} [color=red]; + 88 -> {118} [style=dashed]; 89 -> {90}; - 90 -> {121}; - 90 -> {91} [color=red]; - 90 -> {121} [style=dashed]; + 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; - 95 -> {96}; + 95 -> {103 96}; 96 -> {97}; - 97 -> {105 98}; + 97 -> {98}; 98 -> {99}; 99 -> {100}; 100 -> {101}; 101 -> {102}; - 102 -> {103}; + 102 -> {108}; 103 -> {104}; - 104 -> {110}; + 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; 108 -> {109}; - 109 -> {110}; + 109 -> {125}; + 109 -> {110} [color=red]; + 109 -> {125} [style=dashed]; 110 -> {111}; - 111 -> {128}; - 111 -> {112} [color=red]; - 111 -> {128} [style=dashed]; + 111 -> {112}; 112 -> {113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; 116 -> {117}; - 117 -> {118}; 118 -> {119}; 119 -> {120}; + 120 -> {121}; 121 -> {122}; 122 -> {123}; 123 -> {124}; - 124 -> {125}; + 124 -> {112} [color=red]; + 124 -> {89} [color=green]; 125 -> {126}; 126 -> {127}; - 127 -> {114} [color=red]; - 127 -> {91} [color=green]; + 127 -> {128}; 128 -> {129}; 129 -> {130}; 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {114} [color=red]; - 134 -> {112} [color=green]; + 131 -> {112} [color=red]; + 131 -> {110} [color=green]; subgraph cluster_31 { color=red - 135 [label="Enter function test4" style="filled" fillcolor=red]; + 132 [label="Enter function test4" style="filled" fillcolor=red]; subgraph cluster_32 { color=blue - 136 [label="Enter block"]; - 137 [label="Access variable R|/x|"]; - 138 [label="Variable declaration: lvar p: R|kotlin/String?|"]; + 133 [label="Enter block"]; + 134 [label="Access variable R|/x|"]; + 135 [label="Variable declaration: lvar p: R|kotlin/String?|"]; subgraph cluster_33 { color=blue - 139 [label="Enter when"]; + 136 [label="Enter when"]; subgraph cluster_34 { color=blue - 140 [label="Enter when branch condition "]; - 141 [label="Access variable R|/p|"]; - 142 [label="Const: Null(null)"]; - 143 [label="Equality operator !="]; - 144 [label="Exit when branch condition"]; + 137 [label="Enter when branch condition "]; + 138 [label="Access variable R|/p|"]; + 139 [label="Const: Null(null)"]; + 140 [label="Equality operator !="]; + 141 [label="Exit when branch condition"]; } - 145 [label="Synthetic else branch"]; - 146 [label="Enter when branch result"]; + 142 [label="Synthetic else branch"]; + 143 [label="Enter when branch result"]; subgraph cluster_35 { color=blue - 147 [label="Enter block"]; + 144 [label="Enter block"]; subgraph cluster_36 { color=blue - 148 [label="Enter when"]; + 145 [label="Enter when"]; subgraph cluster_37 { color=blue - 149 [label="Enter when branch condition "]; - 150 [label="Const: Boolean(true)"]; - 151 [label="Exit when branch condition"]; + 146 [label="Enter when branch condition "]; + 147 [label="Const: Boolean(true)"]; + 148 [label="Exit when branch condition"]; } subgraph cluster_38 { color=blue - 152 [label="Enter when branch condition else"]; - 153 [label="Exit when branch condition"]; + 149 [label="Enter when branch condition else"]; + 150 [label="Exit when branch condition"]; } - 154 [label="Enter when branch result"]; + 151 [label="Enter when branch result"]; subgraph cluster_39 { color=blue - 155 [label="Enter block"]; - 156 [label="Postponed enter to lambda"]; + 152 [label="Enter block"]; + 153 [label="Postponed enter to lambda"]; subgraph cluster_40 { color=blue - 191 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 187 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_41 { color=blue - 192 [label="Enter block"]; - 193 [label="Function call: R|/n|()"]; - 194 [label="Exit block"]; + 188 [label="Enter block"]; + 189 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 190 [label="Exit block"]; } - 195 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 191 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 157 [label="Postponed exit from lambda"]; - 158 [label="Function call: R|kotlin/run|(...)"]; - 159 [label="Exit block"]; + 154 [label="Postponed exit from lambda"]; + 155 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 156 [label="Exit block"]; } - 160 [label="Exit when branch result"]; - 161 [label="Enter when branch result"]; + 157 [label="Exit when branch result"]; + 158 [label="Enter when branch result"]; subgraph cluster_42 { color=blue - 162 [label="Enter block"]; - 163 [label="Postponed enter to lambda"]; + 159 [label="Enter block"]; + 160 [label="Postponed enter to lambda"]; subgraph cluster_43 { color=blue - 184 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 180 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_44 { color=blue - 185 [label="Enter block"]; - 186 [label="Const: Null(null)"]; - 187 [label="Assignment: R|/p|"]; - 188 [label="Function call: R|/n|()"]; - 189 [label="Exit block"]; + 181 [label="Enter block"]; + 182 [label="Const: Null(null)"]; + 183 [label="Assignment: R|/p|"]; + 184 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 185 [label="Exit block"]; } - 190 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 186 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 164 [label="Postponed exit from lambda"]; - 165 [label="Function call: R|kotlin/run|(...)"]; - 166 [label="Exit block"]; + 161 [label="Postponed exit from lambda"]; + 162 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 163 [label="Exit block"]; } - 167 [label="Exit when branch result"]; - 168 [label="Exit when"]; + 164 [label="Exit when branch result"]; + 165 [label="Exit when"]; } - 169 [label="Function call: R|/id|(...)"]; - 170 [label="Const: Int(1)"]; - 171 [label="Postponed enter to lambda"]; + 166 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 167 [label="Const: Int(1)"]; + 168 [label="Postponed enter to lambda"]; subgraph cluster_45 { color=blue - 196 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 192 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_46 { color=blue - 197 [label="Enter block"]; - 198 [label="Access variable R|/p|"]; - 199 [label="Smart cast: R|/p|"]; - 200 [label="Access variable #"]; - 201 [label="Const: Int(123)"]; - 202 [label="Exit block"]; + 193 [label="Enter block"]; + 194 [label="Access variable R|/p|"]; + 195 [label="Smart cast: R|/p|"]; + 196 [label="Access variable #"]; + 197 [label="Const: Int(123)"]; + 198 [label="Exit block"]; } - 203 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 199 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 172 [label="Postponed exit from lambda"]; - 173 [label="Function call: R|kotlin/run|(...)"]; - 174 [label="Merge postponed lambda exits"]; - 175 [label="Call arguments union" style="filled" fillcolor=yellow]; - 176 [label="Function call: R|/foo|(...)"]; - 177 [label="Access variable R|/p|"]; - 178 [label="Access variable #"]; - 179 [label="Exit block"]; + 169 [label="Postponed exit from lambda"]; + 170 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 171 [label="Merge postponed lambda exits"]; + 172 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 173 [label="Access variable R|/p|"]; + 174 [label="Access variable #"]; + 175 [label="Exit block"]; } - 180 [label="Exit when branch result"]; - 181 [label="Exit when"]; + 176 [label="Exit when branch result"]; + 177 [label="Exit when"]; } - 182 [label="Exit block"]; + 178 [label="Exit block"]; } - 183 [label="Exit function test4" style="filled" fillcolor=red]; + 179 [label="Exit function test4" style="filled" fillcolor=red]; } + 132 -> {133}; + 133 -> {134}; + 134 -> {135}; 135 -> {136}; 136 -> {137}; 137 -> {138}; 138 -> {139}; 139 -> {140}; 140 -> {141}; - 141 -> {142}; - 142 -> {143}; + 141 -> {143 142}; + 142 -> {177}; 143 -> {144}; - 144 -> {146 145}; - 145 -> {181}; + 144 -> {145}; + 145 -> {146}; 146 -> {147}; 147 -> {148}; - 148 -> {149}; + 148 -> {158 149}; 149 -> {150}; 150 -> {151}; - 151 -> {161 152}; + 151 -> {152}; 152 -> {153}; - 153 -> {154}; + 153 -> {187}; + 153 -> {154} [color=red]; + 153 -> {187} [style=dashed]; 154 -> {155}; 155 -> {156}; - 156 -> {191}; - 156 -> {157} [color=red]; - 156 -> {191} [style=dashed]; - 157 -> {158}; + 156 -> {157}; + 157 -> {165}; 158 -> {159}; 159 -> {160}; - 160 -> {168}; + 160 -> {180}; + 160 -> {161} [color=red]; + 160 -> {180} [style=dashed]; 161 -> {162}; 162 -> {163}; - 163 -> {184}; - 163 -> {164} [color=red]; - 163 -> {184} [style=dashed]; + 163 -> {164}; 164 -> {165}; - 165 -> {166}; + 165 -> {171 166}; 166 -> {167}; 167 -> {168}; - 168 -> {174 169}; + 168 -> {192}; + 168 -> {169} [color=red]; + 168 -> {192} [style=dashed]; 169 -> {170}; - 170 -> {171}; - 171 -> {196}; + 170 -> {172}; 171 -> {172} [color=red]; - 171 -> {196} [style=dashed]; 172 -> {173}; - 173 -> {175}; - 174 -> {175} [color=red]; + 173 -> {174}; + 174 -> {175}; 175 -> {176}; 176 -> {177}; 177 -> {178}; 178 -> {179}; - 179 -> {180}; 180 -> {181}; 181 -> {182}; 182 -> {183}; + 183 -> {184}; 184 -> {185}; 185 -> {186}; - 186 -> {187}; + 186 -> {171} [color=red]; + 186 -> {161} [color=green]; 187 -> {188}; 188 -> {189}; 189 -> {190}; - 190 -> {174} [color=red]; - 190 -> {164} [color=green]; - 191 -> {192}; + 190 -> {191}; + 191 -> {171} [color=red]; + 191 -> {154} [color=green]; 192 -> {193}; 193 -> {194}; 194 -> {195}; - 195 -> {174} [color=red]; - 195 -> {157} [color=green]; + 195 -> {196}; 196 -> {197}; 197 -> {198}; 198 -> {199}; - 199 -> {200}; - 200 -> {201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {175} [color=red]; - 203 -> {172} [color=green]; + 199 -> {172} [color=red]; + 199 -> {169} [color=green]; subgraph cluster_47 { color=red - 204 [label="Enter function test5" style="filled" fillcolor=red]; + 200 [label="Enter function test5" style="filled" fillcolor=red]; subgraph cluster_48 { color=blue - 205 [label="Enter block"]; - 206 [label="Access variable R|/y|"]; - 207 [label="Enter safe call"]; - 208 [label="Postponed enter to lambda"]; + 201 [label="Enter block"]; + 202 [label="Access variable R|/y|"]; + 203 [label="Enter safe call"]; + 204 [label="Postponed enter to lambda"]; subgraph cluster_49 { color=blue - 223 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 218 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_50 { color=blue - 224 [label="Enter block"]; - 225 [label="Access variable R|/x|"]; - 226 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 227 [label="Function call: R|/n|()"]; + 219 [label="Enter block"]; + 220 [label="Access variable R|/x|"]; + 221 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 222 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 223 [label="Exit block"]; + } + 224 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 205 [label="Postponed exit from lambda"]; + 206 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; + 207 [label="Exit safe call"]; + 208 [label="Const: Int(1)"]; + 209 [label="Postponed enter to lambda"]; + subgraph cluster_51 { + color=blue + 225 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_52 { + color=blue + 226 [label="Enter block"]; + 227 [label="Const: String()"]; 228 [label="Exit block"]; } 229 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 209 [label="Postponed exit from lambda"]; - 210 [label="Function call: $subj$.R|kotlin/let|(...)"]; - 211 [label="Exit safe call"]; - 212 [label="Const: Int(1)"]; - 213 [label="Postponed enter to lambda"]; - subgraph cluster_51 { - color=blue - 230 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_52 { - color=blue - 231 [label="Enter block"]; - 232 [label="Const: String()"]; - 233 [label="Exit block"]; - } - 234 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 214 [label="Postponed exit from lambda"]; - 215 [label="Function call: R|kotlin/run|(...)"]; - 216 [label="Merge postponed lambda exits"]; - 217 [label="Call arguments union" style="filled" fillcolor=yellow]; - 218 [label="Function call: R|/foo|(...)"]; - 219 [label="Access variable R|/x|"]; - 220 [label="Access variable #"]; - 221 [label="Exit block"]; + 210 [label="Postponed exit from lambda"]; + 211 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 212 [label="Merge postponed lambda exits"]; + 213 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 214 [label="Access variable R|/x|"]; + 215 [label="Access variable #"]; + 216 [label="Exit block"]; } - 222 [label="Exit function test5" style="filled" fillcolor=red]; + 217 [label="Exit function test5" style="filled" fillcolor=red]; } - 204 -> {205}; + 200 -> {201}; + 201 -> {202}; + 202 -> {203 207}; + 203 -> {204}; + 204 -> {218}; + 204 -> {205} [color=red]; + 204 -> {218} [style=dashed]; 205 -> {206}; - 206 -> {207 211}; - 207 -> {208}; - 208 -> {223}; - 208 -> {209} [color=red]; - 208 -> {223} [style=dashed]; - 209 -> {210}; + 206 -> {207}; + 207 -> {212 208}; + 208 -> {209}; + 209 -> {225}; + 209 -> {210} [color=red]; + 209 -> {225} [style=dashed]; 210 -> {211}; - 211 -> {216 212}; - 212 -> {213}; - 213 -> {230}; - 213 -> {214} [color=red]; - 213 -> {230} [style=dashed]; + 211 -> {213}; + 212 -> {213} [color=red]; + 213 -> {214}; 214 -> {215}; - 215 -> {217}; - 216 -> {217} [color=red]; - 217 -> {218}; + 215 -> {216}; + 216 -> {217}; 218 -> {219}; 219 -> {220}; 220 -> {221}; 221 -> {222}; + 222 -> {223}; 223 -> {224}; - 224 -> {225}; + 224 -> {212} [color=red]; + 224 -> {205} [color=green]; 225 -> {226}; 226 -> {227}; 227 -> {228}; 228 -> {229}; - 229 -> {216} [color=red]; - 229 -> {209} [color=green]; + 229 -> {213} [color=red]; + 229 -> {210} [color=green]; + + subgraph cluster_53 { + color=red + 230 [label="Enter function test6" style="filled" fillcolor=red]; + subgraph cluster_54 { + color=blue + 231 [label="Enter block"]; + subgraph cluster_55 { + color=blue + 232 [label="Enter when"]; + subgraph cluster_56 { + color=blue + 233 [label="Enter when branch condition "]; + 234 [label="Const: Boolean(true)"]; + 235 [label="Exit when branch condition"]; + } + subgraph cluster_57 { + color=blue + 236 [label="Enter when branch condition else"]; + 237 [label="Exit when branch condition"]; + } + 238 [label="Enter when branch result"]; + subgraph cluster_58 { + color=blue + 239 [label="Enter block"]; + 240 [label="Postponed enter to lambda"]; + subgraph cluster_59 { + color=blue + 271 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_60 { + color=blue + 272 [label="Enter block"]; + 273 [label="Access variable R|/x|"]; + 274 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 275 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 276 [label="Exit block"]; + } + 277 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 241 [label="Postponed exit from lambda"]; + 242 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 243 [label="Exit block"]; + } + 244 [label="Exit when branch result"]; + 245 [label="Enter when branch result"]; + subgraph cluster_61 { + color=blue + 246 [label="Enter block"]; + 247 [label="Postponed enter to lambda"]; + subgraph cluster_62 { + color=blue + 264 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_63 { + color=blue + 265 [label="Enter block"]; + 266 [label="Access variable R|/x|"]; + 267 [label="Type operator: (R|/x| as R|kotlin/String|)"]; + 268 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 269 [label="Exit block"]; + } + 270 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 248 [label="Postponed exit from lambda"]; + 249 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 250 [label="Exit block"]; + } + 251 [label="Exit when branch result"]; + 252 [label="Exit when"]; + } + 253 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 254 [label="Const: Int(1)"]; + 255 [label="Postponed enter to lambda"]; + subgraph cluster_64 { + color=blue + 278 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_65 { + color=blue + 279 [label="Enter block"]; + 280 [label="Access variable R|/x|"]; + 281 [label="Access variable #"]; + 282 [label="Const: Int(123)"]; + 283 [label="Exit block"]; + } + 284 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 256 [label="Postponed exit from lambda"]; + 257 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 258 [label="Merge postponed lambda exits"]; + 259 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 260 [label="Access variable R|/x|"]; + 261 [label="Access variable #"]; + 262 [label="Exit block"]; + } + 263 [label="Exit function test6" style="filled" fillcolor=red]; + } 230 -> {231}; 231 -> {232}; 232 -> {233}; 233 -> {234}; - 234 -> {217} [color=red]; - 234 -> {214} [color=green]; - - subgraph cluster_53 { - color=red - 235 [label="Enter function test6" style="filled" fillcolor=red]; - subgraph cluster_54 { - color=blue - 236 [label="Enter block"]; - subgraph cluster_55 { - color=blue - 237 [label="Enter when"]; - subgraph cluster_56 { - color=blue - 238 [label="Enter when branch condition "]; - 239 [label="Const: Boolean(true)"]; - 240 [label="Exit when branch condition"]; - } - subgraph cluster_57 { - color=blue - 241 [label="Enter when branch condition else"]; - 242 [label="Exit when branch condition"]; - } - 243 [label="Enter when branch result"]; - subgraph cluster_58 { - color=blue - 244 [label="Enter block"]; - 245 [label="Postponed enter to lambda"]; - subgraph cluster_59 { - color=blue - 277 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_60 { - color=blue - 278 [label="Enter block"]; - 279 [label="Access variable R|/x|"]; - 280 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 281 [label="Function call: R|/n|()"]; - 282 [label="Exit block"]; - } - 283 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 246 [label="Postponed exit from lambda"]; - 247 [label="Function call: R|kotlin/run|(...)"]; - 248 [label="Exit block"]; - } - 249 [label="Exit when branch result"]; - 250 [label="Enter when branch result"]; - subgraph cluster_61 { - color=blue - 251 [label="Enter block"]; - 252 [label="Postponed enter to lambda"]; - subgraph cluster_62 { - color=blue - 270 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_63 { - color=blue - 271 [label="Enter block"]; - 272 [label="Access variable R|/x|"]; - 273 [label="Type operator: (R|/x| as R|kotlin/String|)"]; - 274 [label="Function call: R|/n|()"]; - 275 [label="Exit block"]; - } - 276 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 253 [label="Postponed exit from lambda"]; - 254 [label="Function call: R|kotlin/run|(...)"]; - 255 [label="Exit block"]; - } - 256 [label="Exit when branch result"]; - 257 [label="Exit when"]; - } - 258 [label="Function call: R|/id|(...)"]; - 259 [label="Const: Int(1)"]; - 260 [label="Postponed enter to lambda"]; - subgraph cluster_64 { - color=blue - 284 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_65 { - color=blue - 285 [label="Enter block"]; - 286 [label="Access variable R|/x|"]; - 287 [label="Access variable #"]; - 288 [label="Const: Int(123)"]; - 289 [label="Exit block"]; - } - 290 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 261 [label="Postponed exit from lambda"]; - 262 [label="Function call: R|kotlin/run|(...)"]; - 263 [label="Merge postponed lambda exits"]; - 264 [label="Call arguments union" style="filled" fillcolor=yellow]; - 265 [label="Function call: R|/foo|(...)"]; - 266 [label="Access variable R|/x|"]; - 267 [label="Access variable #"]; - 268 [label="Exit block"]; - } - 269 [label="Exit function test6" style="filled" fillcolor=red]; - } - 235 -> {236}; + 234 -> {235}; + 235 -> {245 236}; 236 -> {237}; 237 -> {238}; 238 -> {239}; 239 -> {240}; - 240 -> {250 241}; + 240 -> {271}; + 240 -> {241} [color=red]; + 240 -> {271} [style=dashed]; 241 -> {242}; 242 -> {243}; 243 -> {244}; - 244 -> {245}; - 245 -> {277}; - 245 -> {246} [color=red]; - 245 -> {277} [style=dashed]; + 244 -> {252}; + 245 -> {246}; 246 -> {247}; - 247 -> {248}; + 247 -> {264}; + 247 -> {248} [color=red]; + 247 -> {264} [style=dashed]; 248 -> {249}; - 249 -> {257}; + 249 -> {250}; 250 -> {251}; 251 -> {252}; - 252 -> {270}; - 252 -> {253} [color=red]; - 252 -> {270} [style=dashed]; + 252 -> {258 253}; 253 -> {254}; 254 -> {255}; - 255 -> {256}; + 255 -> {278}; + 255 -> {256} [color=red]; + 255 -> {278} [style=dashed]; 256 -> {257}; - 257 -> {263 258}; - 258 -> {259}; + 257 -> {259}; + 258 -> {259} [color=red]; 259 -> {260}; - 260 -> {284}; - 260 -> {261} [color=red]; - 260 -> {284} [style=dashed]; + 260 -> {261}; 261 -> {262}; - 262 -> {264}; - 263 -> {264} [color=red]; + 262 -> {263}; 264 -> {265}; 265 -> {266}; 266 -> {267}; 267 -> {268}; 268 -> {269}; - 270 -> {271}; + 269 -> {270}; + 270 -> {258} [color=red]; + 270 -> {248} [color=green]; 271 -> {272}; 272 -> {273}; 273 -> {274}; 274 -> {275}; 275 -> {276}; - 276 -> {263} [color=red]; - 276 -> {253} [color=green]; - 277 -> {278}; + 276 -> {277}; + 277 -> {258} [color=red]; + 277 -> {241} [color=green]; 278 -> {279}; 279 -> {280}; 280 -> {281}; 281 -> {282}; 282 -> {283}; - 283 -> {263} [color=red]; - 283 -> {246} [color=green]; - 284 -> {285}; + 283 -> {284}; + 284 -> {259} [color=red]; + 284 -> {256} [color=green]; + + subgraph cluster_66 { + color=red + 285 [label="Enter function test7" style="filled" fillcolor=red]; + subgraph cluster_67 { + color=blue + 286 [label="Enter block"]; + 287 [label="Access variable R|/x|"]; + 288 [label="Variable declaration: lvar p: R|kotlin/String?|"]; + subgraph cluster_68 { + color=blue + 289 [label="Enter when"]; + subgraph cluster_69 { + color=blue + 290 [label="Enter when branch condition "]; + 291 [label="Access variable R|/p|"]; + 292 [label="Const: Null(null)"]; + 293 [label="Equality operator !="]; + 294 [label="Exit when branch condition"]; + } + 295 [label="Synthetic else branch"]; + 296 [label="Enter when branch result"]; + subgraph cluster_70 { + color=blue + 297 [label="Enter block"]; + 298 [label="Postponed enter to lambda"]; + subgraph cluster_71 { + color=blue + 315 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_72 { + color=blue + 316 [label="Enter block"]; + 317 [label="Const: Null(null)"]; + 318 [label="Assignment: R|/p|"]; + 319 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 320 [label="Exit block"]; + } + 321 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 299 [label="Postponed exit from lambda"]; + 300 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 301 [label="Function call: R|/id|(...)" style="filled" fillcolor=yellow]; + 302 [label="Const: Int(1)"]; + 303 [label="Postponed enter to lambda"]; + subgraph cluster_73 { + color=blue + 322 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_74 { + color=blue + 323 [label="Enter block"]; + 324 [label="Access variable R|/p|"]; + 325 [label="Smart cast: R|/p|"]; + 326 [label="Access variable #"]; + 327 [label="Const: Int(123)"]; + 328 [label="Exit block"]; + } + 329 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 304 [label="Postponed exit from lambda"]; + 305 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 306 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; + 307 [label="Access variable R|/p|"]; + 308 [label="Smart cast: R|/p|"]; + 309 [label="Access variable #"]; + 310 [label="Exit block"]; + } + 311 [label="Exit when branch result"]; + 312 [label="Exit when"]; + } + 313 [label="Exit block"]; + } + 314 [label="Exit function test7" style="filled" fillcolor=red]; + } 285 -> {286}; 286 -> {287}; 287 -> {288}; 288 -> {289}; 289 -> {290}; - 290 -> {264} [color=red]; - 290 -> {261} [color=green]; - - subgraph cluster_66 { - color=red - 291 [label="Enter function test7" style="filled" fillcolor=red]; - subgraph cluster_67 { - color=blue - 292 [label="Enter block"]; - 293 [label="Access variable R|/x|"]; - 294 [label="Variable declaration: lvar p: R|kotlin/String?|"]; - subgraph cluster_68 { - color=blue - 295 [label="Enter when"]; - subgraph cluster_69 { - color=blue - 296 [label="Enter when branch condition "]; - 297 [label="Access variable R|/p|"]; - 298 [label="Const: Null(null)"]; - 299 [label="Equality operator !="]; - 300 [label="Exit when branch condition"]; - } - 301 [label="Synthetic else branch"]; - 302 [label="Enter when branch result"]; - subgraph cluster_70 { - color=blue - 303 [label="Enter block"]; - 304 [label="Postponed enter to lambda"]; - subgraph cluster_71 { - color=blue - 322 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_72 { - color=blue - 323 [label="Enter block"]; - 324 [label="Const: Null(null)"]; - 325 [label="Assignment: R|/p|"]; - 326 [label="Function call: R|/n|()"]; - 327 [label="Exit block"]; - } - 328 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 305 [label="Postponed exit from lambda"]; - 306 [label="Function call: R|kotlin/run|(...)"]; - 307 [label="Function call: R|/id|(...)"]; - 308 [label="Const: Int(1)"]; - 309 [label="Postponed enter to lambda"]; - subgraph cluster_73 { - color=blue - 329 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_74 { - color=blue - 330 [label="Enter block"]; - 331 [label="Access variable R|/p|"]; - 332 [label="Smart cast: R|/p|"]; - 333 [label="Access variable #"]; - 334 [label="Const: Int(123)"]; - 335 [label="Exit block"]; - } - 336 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 310 [label="Postponed exit from lambda"]; - 311 [label="Function call: R|kotlin/run|(...)"]; - 312 [label="Call arguments union" style="filled" fillcolor=yellow]; - 313 [label="Function call: R|/foo|(...)"]; - 314 [label="Access variable R|/p|"]; - 315 [label="Smart cast: R|/p|"]; - 316 [label="Access variable #"]; - 317 [label="Exit block"]; - } - 318 [label="Exit when branch result"]; - 319 [label="Exit when"]; - } - 320 [label="Exit block"]; - } - 321 [label="Exit function test7" style="filled" fillcolor=red]; - } + 290 -> {291}; 291 -> {292}; 292 -> {293}; 293 -> {294}; - 294 -> {295}; - 295 -> {296}; + 294 -> {296 295}; + 295 -> {312}; 296 -> {297}; 297 -> {298}; - 298 -> {299}; + 298 -> {315}; + 298 -> {299} [color=red]; + 298 -> {315} [style=dashed]; 299 -> {300}; - 300 -> {302 301}; - 301 -> {319}; + 300 -> {301}; + 301 -> {302}; 302 -> {303}; - 303 -> {304}; - 304 -> {322}; - 304 -> {305} [color=red]; - 304 -> {322} [style=dashed]; + 303 -> {322}; + 303 -> {304} [color=red]; + 303 -> {322} [style=dashed]; + 304 -> {305}; 305 -> {306}; 306 -> {307}; 307 -> {308}; 308 -> {309}; - 309 -> {329}; - 309 -> {310} [color=red]; - 309 -> {329} [style=dashed]; + 309 -> {310}; 310 -> {311}; 311 -> {312}; 312 -> {313}; 313 -> {314}; - 314 -> {315}; 315 -> {316}; 316 -> {317}; 317 -> {318}; 318 -> {319}; 319 -> {320}; 320 -> {321}; + 321 -> {306} [color=red]; + 321 -> {299} [color=green]; 322 -> {323}; 323 -> {324}; 324 -> {325}; 325 -> {326}; 326 -> {327}; 327 -> {328}; - 328 -> {312} [color=red]; - 328 -> {305} [color=green]; - 329 -> {330}; - 330 -> {331}; - 331 -> {332}; - 332 -> {333}; - 333 -> {334}; - 334 -> {335}; - 335 -> {336}; - 336 -> {312} [color=red]; - 336 -> {310} [color=green]; + 328 -> {329}; + 329 -> {306} [color=red]; + 329 -> {304} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.dot index 35d6a5f90ae..ef78941b87a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.dot @@ -9,7 +9,7 @@ digraph flowFromInplaceLambda3_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function unknown" style="filled" fillcolor=red]; @@ -25,7 +25,7 @@ digraph flowFromInplaceLambda3_kt { subgraph cluster_3 { color=blue 6 [label="Enter block"]; - 7 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function atLeastOnce" style="filled" fillcolor=red]; @@ -41,7 +41,7 @@ digraph flowFromInplaceLambda3_kt { subgraph cluster_5 { color=blue 11 [label="Enter block"]; - 12 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 12 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 13 [label="Exit block"]; } 14 [label="Exit function exactlyOnce" style="filled" fillcolor=red]; @@ -80,25 +80,27 @@ digraph flowFromInplaceLambda3_kt { 27 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 36 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 38 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 37 [label="Enter block"]; - 38 [label="Const: Int(1)"]; - 39 [label="Assignment: R|/x|"]; - 40 [label="Exit block"]; + 39 [label="Enter block"]; + 40 [label="Const: Int(1)"]; + 41 [label="Assignment: R|/x|"]; + 42 [label="Exit block"]; } - 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 43 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 28 [label="Postponed exit from lambda"]; - 29 [label="Function call: R|/unknown|(...)"]; + 29 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; 30 [label="Access variable R|/x|"]; - 31 [label="Access variable #"]; - 32 [label="Access variable R|/x|"]; - 33 [label="Function call: R|/x|.#()"]; - 34 [label="Exit block"]; + 31 [label="Smart cast: R|/x|"]; + 32 [label="Access variable #"]; + 33 [label="Access variable R|/x|"]; + 34 [label="Smart cast: R|/x|"]; + 35 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 36 [label="Exit block"]; } - 35 [label="Exit function test1" style="filled" fillcolor=red]; + 37 [label="Exit function test1" style="filled" fillcolor=red]; } 19 -> {20}; 20 -> {21}; @@ -108,198 +110,197 @@ digraph flowFromInplaceLambda3_kt { 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28 36}; - 27 -> {36} [style=dashed]; + 27 -> {28 38}; + 27 -> {38} [style=dashed]; 28 -> {29}; + 28 -> {27} [color=green style=dashed]; 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; - 36 -> {41 37}; - 37 -> {38}; + 35 -> {36}; + 36 -> {37}; 38 -> {39}; 39 -> {40}; 40 -> {41}; - 41 -> {28}; - 41 -> {36} [color=green style=dashed]; + 41 -> {42}; + 42 -> {43}; + 43 -> {28}; subgraph cluster_12 { color=red - 42 [label="Enter function test1m" style="filled" fillcolor=red]; + 44 [label="Enter function test1m" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 43 [label="Enter block"]; - 44 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; - 45 [label="Const: String()"]; - 46 [label="Assignment: R|/x|"]; - 47 [label="Access variable R|/x|"]; - 48 [label="Smart cast: R|/x|"]; - 49 [label="Access variable R|kotlin/String.length|"]; - 50 [label="Postponed enter to lambda"]; + 45 [label="Enter block"]; + 46 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; + 47 [label="Const: String()"]; + 48 [label="Assignment: R|/x|"]; + 49 [label="Access variable R|/x|"]; + 50 [label="Smart cast: R|/x|"]; + 51 [label="Access variable R|kotlin/String.length|"]; + 52 [label="Postponed enter to lambda"]; subgraph cluster_14 { color=blue - 57 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 60 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_15 { color=blue - 58 [label="Enter block"]; - 59 [label="Const: String()"]; - 60 [label="Assignment: R|/x|"]; - 61 [label="Exit block"]; + 61 [label="Enter block"]; + 62 [label="Const: String()"]; + 63 [label="Assignment: R|/x|"]; + 64 [label="Exit block"]; } - 62 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 65 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 51 [label="Postponed exit from lambda"]; - 52 [label="Function call: R|/unknown|(...)"]; - 53 [label="Access variable R|/x|"]; - 54 [label="Access variable #"]; - 55 [label="Exit block"]; + 53 [label="Postponed exit from lambda"]; + 54 [label="Function call: R|/unknown|(...)" style="filled" fillcolor=yellow]; + 55 [label="Access variable R|/x|"]; + 56 [label="Smart cast: R|/x|"]; + 57 [label="Access variable R|kotlin/String.length|"]; + 58 [label="Exit block"]; } - 56 [label="Exit function test1m" style="filled" fillcolor=red]; + 59 [label="Exit function test1m" style="filled" fillcolor=red]; } - 42 -> {43}; - 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {51 57}; - 50 -> {57} [style=dashed]; + 50 -> {51}; 51 -> {52}; - 52 -> {53}; + 52 -> {53 60}; + 52 -> {60} [style=dashed]; 53 -> {54}; + 53 -> {52} [color=green style=dashed]; 54 -> {55}; 55 -> {56}; - 57 -> {62 58}; + 56 -> {57}; + 57 -> {58}; 58 -> {59}; - 59 -> {60}; 60 -> {61}; 61 -> {62}; - 62 -> {51}; - 62 -> {57} [color=green style=dashed]; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {53}; subgraph cluster_16 { color=red - 63 [label="Enter function test2" style="filled" fillcolor=red]; + 66 [label="Enter function test2" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 64 [label="Enter block"]; - 65 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; - 66 [label="Const: String()"]; - 67 [label="Assignment: R|/x|"]; - 68 [label="Access variable R|/x|"]; - 69 [label="Smart cast: R|/x|"]; - 70 [label="Access variable R|kotlin/String.length|"]; - 71 [label="Postponed enter to lambda"]; + 67 [label="Enter block"]; + 68 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; + 69 [label="Const: String()"]; + 70 [label="Assignment: R|/x|"]; + 71 [label="Access variable R|/x|"]; + 72 [label="Smart cast: R|/x|"]; + 73 [label="Access variable R|kotlin/String.length|"]; + 74 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 83 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 85 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 84 [label="Enter block"]; - 85 [label="Const: Int(1)"]; - 86 [label="Assignment: R|/x|"]; - 87 [label="Exit block"]; + 86 [label="Enter block"]; + 87 [label="Const: Int(1)"]; + 88 [label="Assignment: R|/x|"]; + 89 [label="Exit block"]; } - 88 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 90 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 72 [label="Call arguments union" style="filled" fillcolor=yellow]; - 73 [label="Postponed exit from lambda"]; - 74 [label="Function call: R|/atLeastOnce|(...)"]; - 75 [label="Access variable R|/x|"]; - 76 [label="Smart cast: R|/x|"]; - 77 [label="Access variable #"]; - 78 [label="Access variable R|/x|"]; - 79 [label="Smart cast: R|/x|"]; - 80 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 81 [label="Exit block"]; + 75 [label="Postponed exit from lambda"]; + 76 [label="Function call: R|/atLeastOnce|(...)" style="filled" fillcolor=yellow]; + 77 [label="Access variable R|/x|"]; + 78 [label="Smart cast: R|/x|"]; + 79 [label="Access variable #"]; + 80 [label="Access variable R|/x|"]; + 81 [label="Smart cast: R|/x|"]; + 82 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 83 [label="Exit block"]; } - 82 [label="Exit function test2" style="filled" fillcolor=red]; + 84 [label="Exit function test2" style="filled" fillcolor=red]; } - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; - 71 -> {83}; - 71 -> {73} [color=red]; - 71 -> {83} [style=dashed]; - 72 -> {74} [color=red]; - 73 -> {74} [color=green]; - 74 -> {75}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {85}; + 74 -> {75} [color=red]; + 74 -> {85} [style=dashed]; 75 -> {76}; + 75 -> {74} [color=green style=dashed]; 76 -> {77}; 77 -> {78}; 78 -> {79}; 79 -> {80}; 80 -> {81}; 81 -> {82}; + 82 -> {83}; 83 -> {84}; - 84 -> {85}; 85 -> {86}; 86 -> {87}; 87 -> {88}; - 88 -> {72} [color=red]; - 88 -> {73} [color=green]; - 88 -> {83} [color=green style=dashed]; + 88 -> {89}; + 89 -> {90}; + 90 -> {76} [color=red]; + 90 -> {75} [color=green]; subgraph cluster_20 { color=red - 89 [label="Enter function test3" style="filled" fillcolor=red]; + 91 [label="Enter function test3" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 90 [label="Enter block"]; - 91 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; - 92 [label="Const: String()"]; - 93 [label="Assignment: R|/x|"]; - 94 [label="Access variable R|/x|"]; - 95 [label="Smart cast: R|/x|"]; - 96 [label="Access variable R|kotlin/String.length|"]; - 97 [label="Postponed enter to lambda"]; + 92 [label="Enter block"]; + 93 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; + 94 [label="Const: String()"]; + 95 [label="Assignment: R|/x|"]; + 96 [label="Access variable R|/x|"]; + 97 [label="Smart cast: R|/x|"]; + 98 [label="Access variable R|kotlin/String.length|"]; + 99 [label="Postponed enter to lambda"]; subgraph cluster_22 { color=blue - 109 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 110 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 110 [label="Enter block"]; - 111 [label="Const: Int(1)"]; - 112 [label="Assignment: R|/x|"]; - 113 [label="Exit block"]; + 111 [label="Enter block"]; + 112 [label="Const: Int(1)"]; + 113 [label="Assignment: R|/x|"]; + 114 [label="Exit block"]; } - 114 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 115 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 98 [label="Call arguments union" style="filled" fillcolor=yellow]; - 99 [label="Postponed exit from lambda"]; - 100 [label="Function call: R|/exactlyOnce|(...)"]; - 101 [label="Access variable R|/x|"]; - 102 [label="Smart cast: R|/x|"]; - 103 [label="Access variable #"]; - 104 [label="Access variable R|/x|"]; - 105 [label="Smart cast: R|/x|"]; - 106 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 107 [label="Exit block"]; + 100 [label="Postponed exit from lambda"]; + 101 [label="Function call: R|/exactlyOnce|(...)" style="filled" fillcolor=yellow]; + 102 [label="Access variable R|/x|"]; + 103 [label="Smart cast: R|/x|"]; + 104 [label="Access variable #"]; + 105 [label="Access variable R|/x|"]; + 106 [label="Smart cast: R|/x|"]; + 107 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 108 [label="Exit block"]; } - 108 [label="Exit function test3" style="filled" fillcolor=red]; + 109 [label="Exit function test3" style="filled" fillcolor=red]; } - 89 -> {90}; - 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {109}; - 97 -> {99} [color=red]; - 97 -> {109} [style=dashed]; - 98 -> {100} [color=red]; - 99 -> {100} [color=green]; + 97 -> {98}; + 98 -> {99}; + 99 -> {110}; + 99 -> {100} [color=red]; + 99 -> {110} [style=dashed]; 100 -> {101}; 101 -> {102}; 102 -> {103}; @@ -308,52 +309,52 @@ digraph flowFromInplaceLambda3_kt { 105 -> {106}; 106 -> {107}; 107 -> {108}; - 109 -> {110}; + 108 -> {109}; 110 -> {111}; 111 -> {112}; 112 -> {113}; 113 -> {114}; - 114 -> {98} [color=red]; - 114 -> {99} [color=green]; + 114 -> {115}; + 115 -> {101} [color=red]; + 115 -> {100} [color=green]; subgraph cluster_24 { color=red - 115 [label="Enter function test4" style="filled" fillcolor=red]; + 116 [label="Enter function test4" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 116 [label="Enter block"]; - 117 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; - 118 [label="Const: String()"]; - 119 [label="Assignment: R|/x|"]; - 120 [label="Access variable R|/x|"]; - 121 [label="Smart cast: R|/x|"]; - 122 [label="Access variable R|kotlin/String.length|"]; - 123 [label="Postponed enter to lambda"]; + 117 [label="Enter block"]; + 118 [label="Variable declaration: lvar x: R|kotlin/Any?|"]; + 119 [label="Const: String()"]; + 120 [label="Assignment: R|/x|"]; + 121 [label="Access variable R|/x|"]; + 122 [label="Smart cast: R|/x|"]; + 123 [label="Access variable R|kotlin/String.length|"]; + 124 [label="Postponed enter to lambda"]; subgraph cluster_26 { color=blue - 134 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 135 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 135 [label="Enter block"]; - 136 [label="Const: Int(1)"]; - 137 [label="Assignment: R|/x|"]; - 138 [label="Exit block"]; + 136 [label="Enter block"]; + 137 [label="Const: Int(1)"]; + 138 [label="Assignment: R|/x|"]; + 139 [label="Exit block"]; } - 139 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 140 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 124 [label="Postponed exit from lambda"]; - 125 [label="Function call: R|/atMostOnce|(...)"]; - 126 [label="Access variable R|/x|"]; - 127 [label="Smart cast: R|/x|"]; - 128 [label="Access variable #"]; - 129 [label="Access variable R|/x|"]; - 130 [label="Smart cast: R|/x|"]; - 131 [label="Function call: R|/x|.#()"]; - 132 [label="Exit block"]; + 125 [label="Postponed exit from lambda"]; + 126 [label="Function call: R|/atMostOnce|(...)" style="filled" fillcolor=yellow]; + 127 [label="Access variable R|/x|"]; + 128 [label="Smart cast: R|/x|"]; + 129 [label="Access variable #"]; + 130 [label="Access variable R|/x|"]; + 131 [label="Smart cast: R|/x|"]; + 132 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 133 [label="Exit block"]; } - 133 [label="Exit function test4" style="filled" fillcolor=red]; + 134 [label="Exit function test4" style="filled" fillcolor=red]; } - 115 -> {116}; 116 -> {117}; 117 -> {118}; 118 -> {119}; @@ -361,9 +362,9 @@ digraph flowFromInplaceLambda3_kt { 120 -> {121}; 121 -> {122}; 122 -> {123}; - 123 -> {124 134}; - 123 -> {134} [style=dashed]; - 124 -> {125}; + 123 -> {124}; + 124 -> {125 135}; + 124 -> {135} [style=dashed]; 125 -> {126}; 126 -> {127}; 127 -> {128}; @@ -372,11 +373,12 @@ digraph flowFromInplaceLambda3_kt { 130 -> {131}; 131 -> {132}; 132 -> {133}; - 134 -> {139 135}; + 133 -> {134}; 135 -> {136}; 136 -> {137}; 137 -> {138}; 138 -> {139}; - 139 -> {124}; + 139 -> {140}; + 140 -> {125}; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.fir.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.fir.txt index 58810e43606..e1ef87b1a0a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.fir.txt @@ -53,7 +53,7 @@ FILE: flowFromInplaceLambda3.kt R|/x| = String() } ) - R|/x|.# + R|/x|.R|kotlin/String.length| } public final fun test2(): R|kotlin/Unit| { lvar x: R|kotlin/Any?| diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.kt b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.kt index 5de255da7ee..1c30965ce0c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.kt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda3.kt @@ -35,7 +35,7 @@ fun test1m() { x = "" x.length unknown { x = "" } - x.length + x.length } fun test2() { diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromTwoInplaceLambdas.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromTwoInplaceLambdas.dot index 5bfec9e0b9a..03a916593cc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromTwoInplaceLambdas.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromTwoInplaceLambdas.dot @@ -30,8 +30,8 @@ digraph flowFromTwoInplaceLambdas_kt { subgraph cluster_3 { color=blue 8 [label="Enter block"]; - 9 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; - 10 [label="Function call: R|/y|.R|SubstitutionOverride|()"]; + 9 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 10 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 11 [label="Exit block"]; } 12 [label="Exit function run2" style="filled" fillcolor=red]; @@ -69,47 +69,46 @@ digraph flowFromTwoInplaceLambdas_kt { 26 [label="Postponed enter to lambda"]; subgraph cluster_9 { color=blue - 40 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 39 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_10 { color=blue - 41 [label="Enter block"]; - 42 [label="Const: Null(null)"]; - 43 [label="Assignment: R|/p|"]; - 44 [label="Function call: R|/n|()"]; - 45 [label="Exit block"]; + 40 [label="Enter block"]; + 41 [label="Const: Null(null)"]; + 42 [label="Assignment: R|/p|"]; + 43 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 44 [label="Exit block"]; } - 46 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 45 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 28 [label="Postponed exit from lambda"]; - 29 [label="Postponed enter to lambda"]; + 27 [label="Postponed exit from lambda"]; + 28 [label="Postponed enter to lambda"]; subgraph cluster_11 { color=blue - 47 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 46 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_12 { color=blue - 48 [label="Enter block"]; - 49 [label="Access variable R|/p|"]; - 50 [label="Smart cast: R|/p|"]; - 51 [label="Access variable #"]; - 52 [label="Const: Int(123)"]; - 53 [label="Exit block"]; + 47 [label="Enter block"]; + 48 [label="Access variable R|/p|"]; + 49 [label="Smart cast: R|/p|"]; + 50 [label="Access variable #"]; + 51 [label="Const: Int(123)"]; + 52 [label="Exit block"]; } - 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 53 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 27 [label="Call arguments union" style="filled" fillcolor=yellow]; - 30 [label="Postponed exit from lambda"]; - 31 [label="Function call: R|/run2|(...)"]; - 32 [label="Access variable R|/p|"]; - 33 [label="Smart cast: R|/p|"]; - 34 [label="Access variable #"]; - 35 [label="Exit block"]; + 29 [label="Postponed exit from lambda"]; + 30 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 31 [label="Access variable R|/p|"]; + 32 [label="Smart cast: R|/p|"]; + 33 [label="Access variable #"]; + 34 [label="Exit block"]; } - 36 [label="Exit when branch result"]; - 37 [label="Exit when"]; + 35 [label="Exit when branch result"]; + 36 [label="Exit when"]; } - 38 [label="Exit block"]; + 37 [label="Exit block"]; } - 39 [label="Exit function test1" style="filled" fillcolor=red]; + 38 [label="Exit function test1" style="filled" fillcolor=red]; } 13 -> {14}; 14 -> {15}; @@ -121,18 +120,18 @@ digraph flowFromTwoInplaceLambdas_kt { 20 -> {21}; 21 -> {22}; 22 -> {24 23}; - 23 -> {37}; + 23 -> {36}; 24 -> {25}; 25 -> {26}; - 26 -> {40}; - 26 -> {28} [color=red]; - 26 -> {40} [style=dashed]; - 27 -> {31} [color=red]; - 28 -> {29}; - 29 -> {47}; - 29 -> {30} [color=red]; - 29 -> {47} [style=dashed]; - 30 -> {31} [color=green]; + 26 -> {39}; + 26 -> {27} [color=red]; + 26 -> {39} [style=dashed]; + 27 -> {28}; + 28 -> {46}; + 28 -> {29} [color=red]; + 28 -> {46} [style=dashed]; + 29 -> {30}; + 30 -> {31}; 31 -> {32}; 32 -> {33}; 33 -> {34}; @@ -140,94 +139,93 @@ digraph flowFromTwoInplaceLambdas_kt { 35 -> {36}; 36 -> {37}; 37 -> {38}; - 38 -> {39}; + 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; - 46 -> {27} [color=red]; - 46 -> {28} [color=green]; + 45 -> {30} [color=red]; + 45 -> {27} [color=green]; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; - 53 -> {54}; - 54 -> {27} [color=red]; - 54 -> {30} [color=green]; + 53 -> {30} [color=red]; + 53 -> {29} [color=green]; subgraph cluster_13 { color=red - 55 [label="Enter function test1_tail" style="filled" fillcolor=red]; + 54 [label="Enter function test1_tail" style="filled" fillcolor=red]; subgraph cluster_14 { color=blue - 56 [label="Enter block"]; - 57 [label="Access variable R|/x|"]; - 58 [label="Variable declaration: lvar p: R|kotlin/String?|"]; + 55 [label="Enter block"]; + 56 [label="Access variable R|/x|"]; + 57 [label="Variable declaration: lvar p: R|kotlin/String?|"]; subgraph cluster_15 { color=blue - 59 [label="Enter when"]; + 58 [label="Enter when"]; subgraph cluster_16 { color=blue - 60 [label="Enter when branch condition "]; - 61 [label="Access variable R|/p|"]; - 62 [label="Const: Null(null)"]; - 63 [label="Equality operator !="]; - 64 [label="Exit when branch condition"]; + 59 [label="Enter when branch condition "]; + 60 [label="Access variable R|/p|"]; + 61 [label="Const: Null(null)"]; + 62 [label="Equality operator !="]; + 63 [label="Exit when branch condition"]; } - 65 [label="Synthetic else branch"]; - 66 [label="Enter when branch result"]; + 64 [label="Synthetic else branch"]; + 65 [label="Enter when branch result"]; subgraph cluster_17 { color=blue - 67 [label="Enter block"]; - 68 [label="Postponed enter to lambda"]; + 66 [label="Enter block"]; + 67 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 89 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 87 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 90 [label="Enter block"]; - 91 [label="Access variable R|/p|"]; - 92 [label="Smart cast: R|/p|"]; - 93 [label="Access variable #"]; - 94 [label="Const: Int(123)"]; - 95 [label="Exit block"]; + 88 [label="Enter block"]; + 89 [label="Access variable R|/p|"]; + 90 [label="Smart cast: R|/p|"]; + 91 [label="Access variable #"]; + 92 [label="Const: Int(123)"]; + 93 [label="Exit block"]; } - 96 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 94 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 70 [label="Postponed exit from lambda"]; - 71 [label="Postponed enter to lambda"]; + 68 [label="Postponed exit from lambda"]; + 69 [label="Postponed enter to lambda"]; subgraph cluster_20 { color=blue - 82 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 80 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 83 [label="Enter block"]; - 84 [label="Const: Null(null)"]; - 85 [label="Assignment: R|/p|"]; - 86 [label="Function call: R|/n|()"]; - 87 [label="Exit block"]; + 81 [label="Enter block"]; + 82 [label="Const: Null(null)"]; + 83 [label="Assignment: R|/p|"]; + 84 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 85 [label="Exit block"]; } - 88 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 86 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 69 [label="Call arguments union" style="filled" fillcolor=yellow]; - 72 [label="Postponed exit from lambda"]; - 73 [label="Function call: R|/run2|(...)"]; - 74 [label="Access variable R|/p|"]; - 75 [label="Smart cast: R|/p|"]; - 76 [label="Access variable #"]; - 77 [label="Exit block"]; + 70 [label="Postponed exit from lambda"]; + 71 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 72 [label="Access variable R|/p|"]; + 73 [label="Smart cast: R|/p|"]; + 74 [label="Access variable #"]; + 75 [label="Exit block"]; } - 78 [label="Exit when branch result"]; - 79 [label="Exit when"]; + 76 [label="Exit when branch result"]; + 77 [label="Exit when"]; } - 80 [label="Exit block"]; + 78 [label="Exit block"]; } - 81 [label="Exit function test1_tail" style="filled" fillcolor=red]; + 79 [label="Exit function test1_tail" style="filled" fillcolor=red]; } + 54 -> {55}; 55 -> {56}; 56 -> {57}; 57 -> {58}; @@ -236,640 +234,626 @@ digraph flowFromTwoInplaceLambdas_kt { 60 -> {61}; 61 -> {62}; 62 -> {63}; - 63 -> {64}; - 64 -> {66 65}; - 65 -> {79}; + 63 -> {65 64}; + 64 -> {77}; + 65 -> {66}; 66 -> {67}; - 67 -> {68}; - 68 -> {89}; - 68 -> {70} [color=red]; - 68 -> {89} [style=dashed]; - 69 -> {73} [color=red]; + 67 -> {87}; + 67 -> {68} [color=red]; + 67 -> {87} [style=dashed]; + 68 -> {69}; + 69 -> {80}; + 69 -> {70} [color=red]; + 69 -> {80} [style=dashed]; 70 -> {71}; - 71 -> {82}; - 71 -> {72} [color=red]; - 71 -> {82} [style=dashed]; - 72 -> {73} [color=green]; + 71 -> {72}; + 72 -> {73}; 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - 79 -> {80}; 80 -> {81}; + 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; - 86 -> {87}; + 86 -> {71} [color=red]; + 86 -> {70} [color=green]; 87 -> {88}; - 88 -> {69} [color=red]; - 88 -> {72} [color=green]; + 88 -> {89}; 89 -> {90}; 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {69} [color=red]; - 96 -> {70} [color=green]; + 94 -> {71} [color=red]; + 94 -> {68} [color=green]; subgraph cluster_22 { color=red - 97 [label="Enter function test2" style="filled" fillcolor=red]; + 95 [label="Enter function test2" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 98 [label="Enter block"]; - 99 [label="Access variable R|/x|"]; - 100 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; - 101 [label="Access variable R|/p|"]; - 102 [label="Access variable #"]; - 103 [label="Postponed enter to lambda"]; + 96 [label="Enter block"]; + 97 [label="Access variable R|/x|"]; + 98 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; + 99 [label="Access variable R|/p|"]; + 100 [label="Access variable #"]; + 101 [label="Postponed enter to lambda"]; subgraph cluster_24 { color=blue - 119 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 116 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 120 [label="Enter block"]; - 121 [label="Const: Null(null)"]; - 122 [label="Assignment: R|/p|"]; - 123 [label="Function call: R|/n|()"]; - 124 [label="Exit block"]; + 117 [label="Enter block"]; + 118 [label="Const: Null(null)"]; + 119 [label="Assignment: R|/p|"]; + 120 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 121 [label="Exit block"]; } - 125 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 122 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 105 [label="Postponed exit from lambda"]; - 106 [label="Postponed enter to lambda"]; + 102 [label="Postponed exit from lambda"]; + 103 [label="Postponed enter to lambda"]; subgraph cluster_26 { color=blue - 126 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 123 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 127 [label="Enter block"]; - 128 [label="Access variable R|/p|"]; - 129 [label="Type operator: (R|/p| as R|kotlin/String|)"]; - 130 [label="Const: Int(123)"]; - 131 [label="Exit block"]; + 124 [label="Enter block"]; + 125 [label="Access variable R|/p|"]; + 126 [label="Type operator: (R|/p| as R|kotlin/String|)"]; + 127 [label="Const: Int(123)"]; + 128 [label="Exit block"]; } - 132 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 129 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 104 [label="Call arguments union" style="filled" fillcolor=yellow]; - 107 [label="Postponed exit from lambda"]; - 108 [label="Function call: R|/run2|(...)"]; + 104 [label="Postponed exit from lambda"]; + 105 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 106 [label="Access variable R|/p|"]; + 107 [label="Smart cast: R|/p|"]; + 108 [label="Access variable #"]; 109 [label="Access variable R|/p|"]; 110 [label="Smart cast: R|/p|"]; - 111 [label="Access variable #"]; - 112 [label="Access variable R|/p|"]; - 113 [label="Smart cast: R|/p|"]; - 114 [label="Enter safe call"]; - 115 [label="Access variable #"]; - 116 [label="Exit safe call"]; - 117 [label="Exit block"]; + 111 [label="Enter safe call"]; + 112 [label="Access variable #"]; + 113 [label="Exit safe call"]; + 114 [label="Exit block"]; } - 118 [label="Exit function test2" style="filled" fillcolor=red]; + 115 [label="Exit function test2" style="filled" fillcolor=red]; } + 95 -> {96}; + 96 -> {97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; 100 -> {101}; - 101 -> {102}; + 101 -> {116}; + 101 -> {102} [color=red]; + 101 -> {116} [style=dashed]; 102 -> {103}; - 103 -> {119}; - 103 -> {105} [color=red]; - 103 -> {119} [style=dashed]; - 104 -> {108} [color=red]; + 103 -> {123}; + 103 -> {104} [color=red]; + 103 -> {123} [style=dashed]; + 104 -> {105}; 105 -> {106}; - 106 -> {126}; - 106 -> {107} [color=red]; - 106 -> {126} [style=dashed]; - 107 -> {108} [color=green]; + 106 -> {107}; + 107 -> {108}; 108 -> {109}; 109 -> {110}; - 110 -> {111}; + 110 -> {111 113}; 111 -> {112}; 112 -> {113}; - 113 -> {114 116}; + 113 -> {114}; 114 -> {115}; - 115 -> {116}; 116 -> {117}; 117 -> {118}; + 118 -> {119}; 119 -> {120}; 120 -> {121}; 121 -> {122}; - 122 -> {123}; + 122 -> {105} [color=red]; + 122 -> {102} [color=green]; 123 -> {124}; 124 -> {125}; - 125 -> {104} [color=red]; - 125 -> {105} [color=green]; + 125 -> {126}; 126 -> {127}; 127 -> {128}; 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {104} [color=red]; - 132 -> {107} [color=green]; + 129 -> {105} [color=red]; + 129 -> {104} [color=green]; subgraph cluster_28 { color=red - 133 [label="Enter function test3" style="filled" fillcolor=red]; + 130 [label="Enter function test3" style="filled" fillcolor=red]; subgraph cluster_29 { color=blue - 134 [label="Enter block"]; - 135 [label="Access variable R|/x|"]; - 136 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; - 137 [label="Access variable R|/p|"]; - 138 [label="Access variable #"]; - 139 [label="Postponed enter to lambda"]; + 131 [label="Enter block"]; + 132 [label="Access variable R|/x|"]; + 133 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; + 134 [label="Access variable R|/p|"]; + 135 [label="Access variable #"]; + 136 [label="Postponed enter to lambda"]; subgraph cluster_30 { color=blue - 155 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 151 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_31 { color=blue - 156 [label="Enter block"]; - 157 [label="Const: Null(null)"]; - 158 [label="Assignment: R|/p|"]; - 159 [label="Function call: R|/n|()"]; - 160 [label="Exit block"]; + 152 [label="Enter block"]; + 153 [label="Const: Null(null)"]; + 154 [label="Assignment: R|/p|"]; + 155 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 156 [label="Exit block"]; } - 161 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 157 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 141 [label="Postponed exit from lambda"]; - 142 [label="Postponed enter to lambda"]; + 137 [label="Postponed exit from lambda"]; + 138 [label="Postponed enter to lambda"]; subgraph cluster_32 { color=blue - 162 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 158 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_33 { color=blue - 163 [label="Enter block"]; - 164 [label="Const: String()"]; - 165 [label="Assignment: R|/p|"]; - 166 [label="Const: Int(123)"]; - 167 [label="Exit block"]; + 159 [label="Enter block"]; + 160 [label="Const: String()"]; + 161 [label="Assignment: R|/p|"]; + 162 [label="Const: Int(123)"]; + 163 [label="Exit block"]; } - 168 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 164 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 140 [label="Call arguments union" style="filled" fillcolor=yellow]; - 143 [label="Postponed exit from lambda"]; - 144 [label="Function call: R|/run2|(...)"]; - 145 [label="Access variable R|/p|"]; - 146 [label="Smart cast: R|/p|"]; - 147 [label="Access variable #"]; - 148 [label="Access variable R|/p|"]; - 149 [label="Smart cast: R|/p|"]; - 150 [label="Enter safe call"]; - 151 [label="Access variable R|kotlin/String.length|"]; - 152 [label="Exit safe call"]; - 153 [label="Exit block"]; + 139 [label="Postponed exit from lambda"]; + 140 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 141 [label="Access variable R|/p|"]; + 142 [label="Smart cast: R|/p|"]; + 143 [label="Access variable #"]; + 144 [label="Access variable R|/p|"]; + 145 [label="Smart cast: R|/p|"]; + 146 [label="Enter safe call"]; + 147 [label="Access variable R|kotlin/String.length|"]; + 148 [label="Exit safe call"]; + 149 [label="Exit block"]; } - 154 [label="Exit function test3" style="filled" fillcolor=red]; + 150 [label="Exit function test3" style="filled" fillcolor=red]; } + 130 -> {131}; + 131 -> {132}; + 132 -> {133}; 133 -> {134}; 134 -> {135}; 135 -> {136}; - 136 -> {137}; + 136 -> {151}; + 136 -> {137} [color=red]; + 136 -> {151} [style=dashed]; 137 -> {138}; - 138 -> {139}; - 139 -> {155}; - 139 -> {141} [color=red]; - 139 -> {155} [style=dashed]; - 140 -> {144} [color=red]; + 138 -> {158}; + 138 -> {139} [color=red]; + 138 -> {158} [style=dashed]; + 139 -> {140}; + 140 -> {141}; 141 -> {142}; - 142 -> {162}; - 142 -> {143} [color=red]; - 142 -> {162} [style=dashed]; - 143 -> {144} [color=green]; + 142 -> {143}; + 143 -> {144}; 144 -> {145}; - 145 -> {146}; + 145 -> {146 148}; 146 -> {147}; 147 -> {148}; 148 -> {149}; - 149 -> {150 152}; - 150 -> {151}; + 149 -> {150}; 151 -> {152}; 152 -> {153}; 153 -> {154}; + 154 -> {155}; 155 -> {156}; 156 -> {157}; - 157 -> {158}; + 157 -> {140} [color=red]; + 157 -> {137} [color=green]; 158 -> {159}; 159 -> {160}; 160 -> {161}; - 161 -> {140} [color=red]; - 161 -> {141} [color=green]; + 161 -> {162}; 162 -> {163}; 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - 166 -> {167}; - 167 -> {168}; - 168 -> {140} [color=red]; - 168 -> {143} [color=green]; + 164 -> {140} [color=red]; + 164 -> {139} [color=green]; subgraph cluster_34 { color=red - 169 [label="Enter class I1" style="filled" fillcolor=red]; - 170 [label="Exit class I1" style="filled" fillcolor=red]; + 165 [label="Enter class I1" style="filled" fillcolor=red]; + 166 [label="Exit class I1" style="filled" fillcolor=red]; } - 169 -> {170} [color=green]; + 165 -> {166} [color=green]; subgraph cluster_35 { color=red - 171 [label="Enter class I2" style="filled" fillcolor=red]; - 172 [label="Exit class I2" style="filled" fillcolor=red]; + 167 [label="Enter class I2" style="filled" fillcolor=red]; + 168 [label="Exit class I2" style="filled" fillcolor=red]; } - 171 -> {172} [color=green]; + 167 -> {168} [color=green]; subgraph cluster_36 { color=red - 173 [label="Enter function test4" style="filled" fillcolor=red]; + 169 [label="Enter function test4" style="filled" fillcolor=red]; subgraph cluster_37 { color=blue - 174 [label="Enter block"]; - 175 [label="Access variable R|/x|"]; - 176 [label="Access variable #"]; - 177 [label="Access variable R|/x|"]; - 178 [label="Access variable #"]; - 179 [label="Postponed enter to lambda"]; + 170 [label="Enter block"]; + 171 [label="Access variable R|/x|"]; + 172 [label="Access variable #"]; + 173 [label="Access variable R|/x|"]; + 174 [label="Access variable #"]; + 175 [label="Postponed enter to lambda"]; subgraph cluster_38 { color=blue - 193 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 188 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_39 { color=blue - 194 [label="Enter block"]; - 195 [label="Access variable R|/x|"]; - 196 [label="Type operator: (R|/x| as R|I1|)"]; - 197 [label="Access variable R|/x|"]; - 198 [label="Smart cast: R|/x|"]; - 199 [label="Access variable #"]; - 200 [label="Function call: R|/n|()"]; - 201 [label="Exit block"]; + 189 [label="Enter block"]; + 190 [label="Access variable R|/x|"]; + 191 [label="Type operator: (R|/x| as R|I1|)"]; + 192 [label="Access variable R|/x|"]; + 193 [label="Smart cast: R|/x|"]; + 194 [label="Access variable #"]; + 195 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 196 [label="Exit block"]; } - 202 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 197 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 181 [label="Postponed exit from lambda"]; - 182 [label="Postponed enter to lambda"]; + 176 [label="Postponed exit from lambda"]; + 177 [label="Postponed enter to lambda"]; subgraph cluster_40 { color=blue - 203 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 198 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_41 { color=blue - 204 [label="Enter block"]; - 205 [label="Access variable R|/x|"]; - 206 [label="Type operator: (R|/x| as R|I2|)"]; - 207 [label="Access variable R|/x|"]; - 208 [label="Smart cast: R|/x|"]; - 209 [label="Access variable #"]; - 210 [label="Const: Int(123)"]; - 211 [label="Exit block"]; + 199 [label="Enter block"]; + 200 [label="Access variable R|/x|"]; + 201 [label="Type operator: (R|/x| as R|I2|)"]; + 202 [label="Access variable R|/x|"]; + 203 [label="Smart cast: R|/x|"]; + 204 [label="Access variable #"]; + 205 [label="Const: Int(123)"]; + 206 [label="Exit block"]; } - 212 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 207 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 180 [label="Call arguments union" style="filled" fillcolor=yellow]; - 183 [label="Postponed exit from lambda"]; - 184 [label="Function call: R|/run2|(...)"]; - 185 [label="Access variable R|/x|"]; - 186 [label="Smart cast: R|/x|"]; - 187 [label="Access variable R|/I1.x|"]; - 188 [label="Access variable R|/x|"]; - 189 [label="Smart cast: R|/x|"]; - 190 [label="Access variable R|/I2.y|"]; - 191 [label="Exit block"]; + 178 [label="Postponed exit from lambda"]; + 179 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 180 [label="Access variable R|/x|"]; + 181 [label="Smart cast: R|/x|"]; + 182 [label="Access variable R|/I1.x|"]; + 183 [label="Access variable R|/x|"]; + 184 [label="Smart cast: R|/x|"]; + 185 [label="Access variable R|/I2.y|"]; + 186 [label="Exit block"]; } - 192 [label="Exit function test4" style="filled" fillcolor=red]; + 187 [label="Exit function test4" style="filled" fillcolor=red]; } + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {173}; 173 -> {174}; 174 -> {175}; - 175 -> {176}; + 175 -> {188}; + 175 -> {176} [color=red]; + 175 -> {188} [style=dashed]; 176 -> {177}; - 177 -> {178}; + 177 -> {198}; + 177 -> {178} [color=red]; + 177 -> {198} [style=dashed]; 178 -> {179}; - 179 -> {193}; - 179 -> {181} [color=red]; - 179 -> {193} [style=dashed]; - 180 -> {184} [color=red]; + 179 -> {180}; + 180 -> {181}; 181 -> {182}; - 182 -> {203}; - 182 -> {183} [color=red]; - 182 -> {203} [style=dashed]; - 183 -> {184} [color=green]; + 182 -> {183}; + 183 -> {184}; 184 -> {185}; 185 -> {186}; 186 -> {187}; - 187 -> {188}; 188 -> {189}; 189 -> {190}; 190 -> {191}; 191 -> {192}; + 192 -> {193}; 193 -> {194}; 194 -> {195}; 195 -> {196}; 196 -> {197}; - 197 -> {198}; + 197 -> {179} [color=red]; + 197 -> {176} [color=green]; 198 -> {199}; 199 -> {200}; 200 -> {201}; 201 -> {202}; - 202 -> {180} [color=red]; - 202 -> {181} [color=green]; + 202 -> {203}; 203 -> {204}; 204 -> {205}; 205 -> {206}; 206 -> {207}; - 207 -> {208}; + 207 -> {179} [color=red]; + 207 -> {178} [color=green]; + + subgraph cluster_42 { + color=red + 208 [label="Enter function test5" style="filled" fillcolor=red]; + subgraph cluster_43 { + color=blue + 209 [label="Enter block"]; + 210 [label="Access variable R|/x|"]; + 211 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; + 212 [label="Access variable R|/p|"]; + 213 [label="Access variable #"]; + 214 [label="Postponed enter to lambda"]; + subgraph cluster_44 { + color=blue + 229 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_45 { + color=blue + 230 [label="Enter block"]; + 231 [label="Access variable R|/p|"]; + 232 [label="Type operator: (R|/p| as R|kotlin/Int|)"]; + 233 [label="Const: Int(123)"]; + 234 [label="Exit block"]; + } + 235 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 215 [label="Postponed exit from lambda"]; + 216 [label="Postponed enter to lambda"]; + subgraph cluster_46 { + color=blue + 236 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_47 { + color=blue + 237 [label="Enter block"]; + 238 [label="Access variable R|/q|"]; + 239 [label="Assignment: R|/p|"]; + 240 [label="Function call: R|/n|()" style="filled" fillcolor=yellow]; + 241 [label="Exit block"]; + } + 242 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 217 [label="Postponed exit from lambda"]; + 218 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 219 [label="Access variable R|/p|"]; + 220 [label="Smart cast: R|/p|"]; + 221 [label="Access variable #"]; + 222 [label="Access variable R|/p|"]; + 223 [label="Smart cast: R|/p|"]; + 224 [label="Enter safe call"]; + 225 [label="Access variable R|kotlin/String.length|"]; + 226 [label="Exit safe call"]; + 227 [label="Exit block"]; + } + 228 [label="Exit function test5" style="filled" fillcolor=red]; + } 208 -> {209}; 209 -> {210}; 210 -> {211}; 211 -> {212}; - 212 -> {180} [color=red]; - 212 -> {183} [color=green]; - - subgraph cluster_42 { - color=red - 213 [label="Enter function test5" style="filled" fillcolor=red]; - subgraph cluster_43 { - color=blue - 214 [label="Enter block"]; - 215 [label="Access variable R|/x|"]; - 216 [label="Variable declaration: lvar p: R|kotlin/Any?|"]; - 217 [label="Access variable R|/p|"]; - 218 [label="Access variable #"]; - 219 [label="Postponed enter to lambda"]; - subgraph cluster_44 { - color=blue - 235 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_45 { - color=blue - 236 [label="Enter block"]; - 237 [label="Access variable R|/p|"]; - 238 [label="Type operator: (R|/p| as R|kotlin/Int|)"]; - 239 [label="Const: Int(123)"]; - 240 [label="Exit block"]; - } - 241 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 221 [label="Postponed exit from lambda"]; - 222 [label="Postponed enter to lambda"]; - subgraph cluster_46 { - color=blue - 242 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_47 { - color=blue - 243 [label="Enter block"]; - 244 [label="Access variable R|/q|"]; - 245 [label="Assignment: R|/p|"]; - 246 [label="Function call: R|/n|()"]; - 247 [label="Exit block"]; - } - 248 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 220 [label="Call arguments union" style="filled" fillcolor=yellow]; - 223 [label="Postponed exit from lambda"]; - 224 [label="Function call: R|/run2|(...)"]; - 225 [label="Access variable R|/p|"]; - 226 [label="Smart cast: R|/p|"]; - 227 [label="Access variable #"]; - 228 [label="Access variable R|/p|"]; - 229 [label="Smart cast: R|/p|"]; - 230 [label="Enter safe call"]; - 231 [label="Access variable R|kotlin/String.length|"]; - 232 [label="Exit safe call"]; - 233 [label="Exit block"]; - } - 234 [label="Exit function test5" style="filled" fillcolor=red]; - } + 212 -> {213}; 213 -> {214}; - 214 -> {215}; + 214 -> {229}; + 214 -> {215} [color=red]; + 214 -> {229} [style=dashed]; 215 -> {216}; - 216 -> {217}; + 216 -> {236}; + 216 -> {217} [color=red]; + 216 -> {236} [style=dashed]; 217 -> {218}; 218 -> {219}; - 219 -> {235}; - 219 -> {221} [color=red]; - 219 -> {235} [style=dashed]; - 220 -> {224} [color=red]; + 219 -> {220}; + 220 -> {221}; 221 -> {222}; - 222 -> {242}; - 222 -> {223} [color=red]; - 222 -> {242} [style=dashed]; - 223 -> {224} [color=green]; + 222 -> {223}; + 223 -> {224 226}; 224 -> {225}; 225 -> {226}; 226 -> {227}; 227 -> {228}; - 228 -> {229}; - 229 -> {230 232}; + 229 -> {230}; 230 -> {231}; 231 -> {232}; 232 -> {233}; 233 -> {234}; - 235 -> {236}; + 234 -> {235}; + 235 -> {218} [color=red]; + 235 -> {215} [color=green]; 236 -> {237}; 237 -> {238}; 238 -> {239}; 239 -> {240}; 240 -> {241}; - 241 -> {220} [color=red]; - 241 -> {221} [color=green]; - 242 -> {243}; - 243 -> {244}; - 244 -> {245}; - 245 -> {246}; - 246 -> {247}; - 247 -> {248}; - 248 -> {220} [color=red]; - 248 -> {223} [color=green]; + 241 -> {242}; + 242 -> {218} [color=red]; + 242 -> {217} [color=green]; subgraph cluster_48 { color=red - 249 [label="Enter function test6" style="filled" fillcolor=red]; + 243 [label="Enter function test6" style="filled" fillcolor=red]; subgraph cluster_49 { color=blue - 250 [label="Enter block"]; - 251 [label="Variable declaration: lval x: R|kotlin/String|"]; - 252 [label="Postponed enter to lambda"]; + 244 [label="Enter block"]; + 245 [label="Variable declaration: lval x: R|kotlin/String|"]; + 246 [label="Postponed enter to lambda"]; subgraph cluster_50 { color=blue - 262 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 255 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_51 { color=blue - 263 [label="Enter block"]; - 264 [label="Const: String()"]; - 265 [label="Assignment: R|/x|"]; - 266 [label="Access variable R|/x|"]; - 267 [label="Access variable R|kotlin/String.length|"]; - 268 [label="Exit block"]; + 256 [label="Enter block"]; + 257 [label="Const: String()"]; + 258 [label="Assignment: R|/x|"]; + 259 [label="Access variable R|/x|"]; + 260 [label="Access variable R|kotlin/String.length|"]; + 261 [label="Exit block"]; } - 269 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 262 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 254 [label="Postponed exit from lambda"]; - 255 [label="Postponed enter to lambda"]; + 247 [label="Postponed exit from lambda"]; + 248 [label="Postponed enter to lambda"]; subgraph cluster_52 { color=blue - 270 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 263 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_53 { color=blue - 271 [label="Enter block"]; - 272 [label="Access variable R|/x|"]; - 273 [label="Access variable R|kotlin/String.length|"]; - 274 [label="Exit block"]; + 264 [label="Enter block"]; + 265 [label="Access variable R|/x|"]; + 266 [label="Access variable R|kotlin/String.length|"]; + 267 [label="Exit block"]; } - 275 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 268 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 253 [label="Call arguments union" style="filled" fillcolor=yellow]; - 256 [label="Postponed exit from lambda"]; - 257 [label="Function call: R|/run2|(...)"]; - 258 [label="Access variable R|/x|"]; - 259 [label="Access variable R|kotlin/String.length|"]; - 260 [label="Exit block"]; + 249 [label="Postponed exit from lambda"]; + 250 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + 251 [label="Access variable R|/x|"]; + 252 [label="Access variable R|kotlin/String.length|"]; + 253 [label="Exit block"]; } - 261 [label="Exit function test6" style="filled" fillcolor=red]; + 254 [label="Exit function test6" style="filled" fillcolor=red]; } + 243 -> {244}; + 244 -> {245}; + 245 -> {246}; + 246 -> {255}; + 246 -> {247} [color=red]; + 246 -> {255} [style=dashed]; + 247 -> {248}; + 248 -> {263}; + 248 -> {249} [color=red]; + 248 -> {263} [style=dashed]; 249 -> {250}; 250 -> {251}; 251 -> {252}; - 252 -> {262}; - 252 -> {254} [color=red]; - 252 -> {262} [style=dashed]; - 253 -> {257} [color=red]; - 254 -> {255}; - 255 -> {270}; - 255 -> {256} [color=red]; - 255 -> {270} [style=dashed]; - 256 -> {257} [color=green]; + 252 -> {253}; + 253 -> {254}; + 255 -> {256}; + 256 -> {257}; 257 -> {258}; 258 -> {259}; 259 -> {260}; 260 -> {261}; - 262 -> {263}; + 261 -> {262}; + 262 -> {250} [color=red]; + 262 -> {247} [color=green]; 263 -> {264}; 264 -> {265}; 265 -> {266}; 266 -> {267}; 267 -> {268}; - 268 -> {269}; - 269 -> {253} [color=red]; - 269 -> {254} [color=green]; + 268 -> {250} [color=red]; + 268 -> {249} [color=green]; + + subgraph cluster_54 { + color=red + 269 [label="Enter function test7" style="filled" fillcolor=red]; + subgraph cluster_55 { + color=blue + 270 [label="Enter block"]; + 271 [label="Const: String()"]; + 272 [label="Variable declaration: lval x: R|kotlin/Any?|"]; + 273 [label="Variable declaration: lval y: R|kotlin/Any?|"]; + 274 [label="Postponed enter to lambda"]; + subgraph cluster_56 { + color=blue + 295 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_57 { + color=blue + 296 [label="Enter block"]; + 297 [label="Access variable R|/x|"]; + 298 [label="Assignment: R|/y|"]; + 299 [label="Exit block"]; + } + 300 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 275 [label="Postponed exit from lambda"]; + 276 [label="Postponed enter to lambda"]; + subgraph cluster_58 { + color=blue + 301 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_59 { + color=blue + 302 [label="Enter block"]; + 303 [label="Jump: ^@run2 Unit"]; + 304 [label="Stub" style="filled" fillcolor=gray]; + 305 [label="Exit block" style="filled" fillcolor=gray]; + } + 306 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 277 [label="Postponed exit from lambda"]; + 278 [label="Function call: R|/run2|(...)" style="filled" fillcolor=yellow]; + subgraph cluster_60 { + color=blue + 279 [label="Enter when"]; + subgraph cluster_61 { + color=blue + 280 [label="Enter when branch condition "]; + 281 [label="Access variable R|/y|"]; + 282 [label="Type operator: (R|/y| is R|kotlin/String|)"]; + 283 [label="Exit when branch condition"]; + } + 284 [label="Synthetic else branch"]; + 285 [label="Enter when branch result"]; + subgraph cluster_62 { + color=blue + 286 [label="Enter block"]; + 287 [label="Access variable R|/x|"]; + 288 [label="Smart cast: R|/x|"]; + 289 [label="Access variable R|kotlin/String.length|"]; + 290 [label="Exit block"]; + } + 291 [label="Exit when branch result"]; + 292 [label="Exit when"]; + } + 293 [label="Exit block"]; + } + 294 [label="Exit function test7" style="filled" fillcolor=red]; + } + 269 -> {270}; 270 -> {271}; 271 -> {272}; 272 -> {273}; 273 -> {274}; - 274 -> {275}; - 275 -> {253} [color=red]; - 275 -> {256} [color=green]; - - subgraph cluster_54 { - color=red - 276 [label="Enter function test7" style="filled" fillcolor=red]; - subgraph cluster_55 { - color=blue - 277 [label="Enter block"]; - 278 [label="Const: String()"]; - 279 [label="Variable declaration: lval x: R|kotlin/Any?|"]; - 280 [label="Variable declaration: lval y: R|kotlin/Any?|"]; - 281 [label="Postponed enter to lambda"]; - subgraph cluster_56 { - color=blue - 303 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_57 { - color=blue - 304 [label="Enter block"]; - 305 [label="Access variable R|/x|"]; - 306 [label="Assignment: R|/y|"]; - 307 [label="Exit block"]; - } - 308 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 283 [label="Postponed exit from lambda"]; - 284 [label="Postponed enter to lambda"]; - subgraph cluster_58 { - color=blue - 309 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_59 { - color=blue - 310 [label="Enter block"]; - 311 [label="Jump: ^@run2 Unit"]; - 312 [label="Stub" style="filled" fillcolor=gray]; - 313 [label="Exit block" style="filled" fillcolor=gray]; - } - 314 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 282 [label="Call arguments union" style="filled" fillcolor=yellow]; - 285 [label="Postponed exit from lambda"]; - 286 [label="Function call: R|/run2|(...)"]; - subgraph cluster_60 { - color=blue - 287 [label="Enter when"]; - subgraph cluster_61 { - color=blue - 288 [label="Enter when branch condition "]; - 289 [label="Access variable R|/y|"]; - 290 [label="Type operator: (R|/y| is R|kotlin/String|)"]; - 291 [label="Exit when branch condition"]; - } - 292 [label="Synthetic else branch"]; - 293 [label="Enter when branch result"]; - subgraph cluster_62 { - color=blue - 294 [label="Enter block"]; - 295 [label="Access variable R|/x|"]; - 296 [label="Smart cast: R|/x|"]; - 297 [label="Access variable R|kotlin/String.length|"]; - 298 [label="Exit block"]; - } - 299 [label="Exit when branch result"]; - 300 [label="Exit when"]; - } - 301 [label="Exit block"]; - } - 302 [label="Exit function test7" style="filled" fillcolor=red]; - } - 276 -> {277}; + 274 -> {295}; + 274 -> {275} [color=red]; + 274 -> {295} [style=dashed]; + 275 -> {276}; + 276 -> {301}; + 276 -> {277} [color=red]; + 276 -> {301} [style=dashed]; 277 -> {278}; 278 -> {279}; 279 -> {280}; 280 -> {281}; - 281 -> {303}; - 281 -> {283} [color=red]; - 281 -> {303} [style=dashed]; - 282 -> {286} [color=red]; - 283 -> {284}; - 284 -> {309}; - 284 -> {285} [color=red]; - 284 -> {309} [style=dashed]; - 285 -> {286} [color=green]; + 281 -> {282}; + 282 -> {283}; + 283 -> {285 284}; + 284 -> {292}; + 285 -> {286}; 286 -> {287}; 287 -> {288}; 288 -> {289}; 289 -> {290}; 290 -> {291}; - 291 -> {293 292}; - 292 -> {300}; + 291 -> {292}; + 292 -> {293}; 293 -> {294}; - 294 -> {295}; 295 -> {296}; 296 -> {297}; 297 -> {298}; 298 -> {299}; 299 -> {300}; - 300 -> {301}; + 300 -> {278} [color=red]; + 300 -> {275} [color=green]; 301 -> {302}; - 303 -> {304}; - 304 -> {305}; - 305 -> {306}; - 306 -> {307}; - 307 -> {308}; - 308 -> {282} [color=red]; - 308 -> {283} [color=green]; - 309 -> {310}; - 310 -> {311}; - 311 -> {314}; - 311 -> {312} [style=dotted]; - 312 -> {313} [style=dotted]; - 313 -> {314} [style=dotted]; - 314 -> {282} [color=red]; - 314 -> {285} [color=green]; + 302 -> {303}; + 303 -> {306}; + 303 -> {304} [style=dotted]; + 304 -> {305} [style=dotted]; + 305 -> {306} [style=dotted]; + 306 -> {278} [color=red]; + 306 -> {277} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot index 184c44bff82..fa433c0ab63 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.dot @@ -6,7 +6,7 @@ digraph initBlock_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -45,7 +45,7 @@ digraph initBlock_kt { subgraph cluster_4 { color=red 12 [label="Enter function " style="filled" fillcolor=red]; - 13 [label="Delegated constructor call: super()"]; + 13 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 14 [label="Exit function " style="filled" fillcolor=red]; } 12 -> {13}; @@ -59,7 +59,7 @@ digraph initBlock_kt { 16 [label="Enter block"]; 17 [label="Const: Int(1)"]; 18 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 19 [label="Function call: R|java/lang/Exception.Exception|()"]; + 19 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 20 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 21 [label="Stub" style="filled" fillcolor=gray]; 22 [label="Const: Int(2)" style="filled" fillcolor=gray]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot index b772004ea98..ff965c0f905 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.dot @@ -20,7 +20,7 @@ digraph initBlockAndInPlaceLambda_kt { subgraph cluster_2 { color=red 4 [label="Enter function " style="filled" fillcolor=red]; - 5 [label="Delegated constructor call: super()"]; + 5 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 6 [label="Exit function " style="filled" fillcolor=red]; } 4 -> {5}; @@ -38,59 +38,57 @@ digraph initBlockAndInPlaceLambda_kt { 12 [label="Postponed enter to lambda"]; subgraph cluster_5 { color=blue - 20 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 19 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_6 { color=blue - 21 [label="Enter block"]; - 22 [label="Access variable R|/a|"]; - 23 [label="Access variable R|/it|"]; - 24 [label="Function call: R|/C.C|(...)"]; - 25 [label="Exit block"]; + 20 [label="Enter block"]; + 21 [label="Access variable R|/a|"]; + 22 [label="Access variable R|/it|"]; + 23 [label="Function call: R|/C.C|(...)" style="filled" fillcolor=yellow]; + 24 [label="Exit block"]; } - 26 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 13 [label="Call arguments union" style="filled" fillcolor=yellow]; - 14 [label="Postponed exit from lambda"]; - 15 [label="Function call: $subj$.R|kotlin/let|(...)"]; - 16 [label="Exit safe call"]; - 17 [label="Variable declaration: lval c: R|C?|"]; - 18 [label="Exit block"]; + 13 [label="Postponed exit from lambda"]; + 14 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; + 15 [label="Exit safe call"]; + 16 [label="Variable declaration: lval c: R|C?|"]; + 17 [label="Exit block"]; } - 19 [label="Exit init block" style="filled" fillcolor=red]; + 18 [label="Exit init block" style="filled" fillcolor=red]; } 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11 16}; + 10 -> {11 15}; 11 -> {12}; - 12 -> {20}; - 12 -> {14} [color=red]; - 12 -> {20} [style=dashed]; - 13 -> {15} [color=red]; - 14 -> {15} [color=green]; + 12 -> {19}; + 12 -> {13} [color=red]; + 12 -> {19} [style=dashed]; + 13 -> {14}; + 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {18}; - 18 -> {19}; - 19 -> {29} [color=green]; + 18 -> {28} [color=green]; + 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {13} [color=red]; - 26 -> {14} [color=green]; + 25 -> {14} [color=red]; + 25 -> {13} [color=green]; subgraph cluster_7 { color=red - 27 [label="Enter class C" style="filled" fillcolor=red]; - 28 [label="Part of class initialization"]; - 29 [label="Exit class C" style="filled" fillcolor=red]; + 26 [label="Enter class C" style="filled" fillcolor=red]; + 27 [label="Part of class initialization"]; + 28 [label="Exit class C" style="filled" fillcolor=red]; } - 27 -> {28} [color=green]; - 28 -> {29} [style=dotted]; - 28 -> {7} [color=green]; - 28 -> {7} [style=dashed]; + 26 -> {27} [color=green]; + 27 -> {28} [style=dotted]; + 27 -> {7} [color=green]; + 27 -> {7} [style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot index 518382171dd..90b53c4c821 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.dot @@ -6,7 +6,7 @@ digraph innerClassInAnonymousObject_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -15,7 +15,7 @@ digraph innerClassInAnonymousObject_kt { subgraph cluster_1 { color=red 3 [label="Enter function " style="filled" fillcolor=red]; - 4 [label="Delegated constructor call: super()"]; + 4 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 5 [label="Exit function " style="filled" fillcolor=red]; } 3 -> {4}; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.dot index ee65cb4e35e..88482cb8f02 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.dot @@ -10,7 +10,7 @@ digraph inplaceLambdaInControlFlowExpressions_kt { color=blue 1 [label="Enter block"]; 2 [label="Const: Null(null)"]; - 3 [label="Check not null: Null(null)!!"]; + 3 [label="Check not null: Null(null)!!" style="filled" fillcolor=yellow]; 4 [label="Stub" style="filled" fillcolor=gray]; 5 [label="Jump: ^materialize Null(null)!!" style="filled" fillcolor=gray]; 6 [label="Stub" style="filled" fillcolor=gray]; @@ -63,17 +63,17 @@ digraph inplaceLambdaInControlFlowExpressions_kt { 24 [label="Postponed enter to lambda"]; subgraph cluster_9 { color=blue - 34 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 33 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_10 { color=blue - 35 [label="Enter block"]; - 36 [label="Function call: R|/materialize|()"]; - 37 [label="Exit block"]; + 34 [label="Enter block"]; + 35 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 36 [label="Exit block"]; } - 38 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 37 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 25 [label="Postponed exit from lambda"]; - 26 [label="Function call: R|kotlin/run|(...)"]; + 26 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; 27 [label="Exit block"]; } 28 [label="Exit when branch result"]; @@ -84,7 +84,6 @@ digraph inplaceLambdaInControlFlowExpressions_kt { } 32 [label="Exit function test_1" style="filled" fillcolor=red]; } - 33 [label="Merge postponed lambda exits"]; 9 -> {10}; 10 -> {11}; 11 -> {12}; @@ -100,90 +99,90 @@ digraph inplaceLambdaInControlFlowExpressions_kt { 21 -> {29}; 22 -> {23}; 23 -> {24}; - 24 -> {34}; + 24 -> {33}; 24 -> {25} [color=red]; - 24 -> {34} [style=dashed]; + 24 -> {33} [style=dashed]; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; - 29 -> {33 30}; + 29 -> {30}; 30 -> {31}; 31 -> {32}; + 33 -> {34}; 34 -> {35}; 35 -> {36}; 36 -> {37}; - 37 -> {38}; - 38 -> {33} [color=red]; - 38 -> {25} [color=green]; + 37 -> {29} [color=red]; + 37 -> {25} [color=green]; subgraph cluster_11 { color=red - 39 [label="Enter function test_2" style="filled" fillcolor=red]; + 38 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_12 { color=blue - 40 [label="Enter block"]; + 39 [label="Enter block"]; subgraph cluster_13 { color=blue - 41 [label="Try expression enter"]; + 40 [label="Try expression enter"]; subgraph cluster_14 { color=blue - 42 [label="Try main block enter"]; + 41 [label="Try main block enter"]; subgraph cluster_15 { color=blue - 43 [label="Enter block"]; - 44 [label="Postponed enter to lambda"]; + 42 [label="Enter block"]; + 43 [label="Postponed enter to lambda"]; subgraph cluster_16 { color=blue - 60 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 58 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 61 [label="Enter block"]; - 62 [label="Function call: R|/materialize|()"]; - 63 [label="Exit block"]; + 59 [label="Enter block"]; + 60 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 61 [label="Exit block"]; } - 64 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 62 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 45 [label="Postponed exit from lambda"]; - 46 [label="Function call: R|kotlin/run|(...)"]; - 47 [label="Exit block"]; + 44 [label="Postponed exit from lambda"]; + 45 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 46 [label="Exit block"]; } - 48 [label="Try main block exit"]; + 47 [label="Try main block exit"]; } subgraph cluster_18 { color=blue - 49 [label="Catch enter"]; - 50 [label="Variable declaration: e: R|kotlin/Exception|"]; + 48 [label="Catch enter"]; + 49 [label="Variable declaration: e: R|kotlin/Exception|"]; subgraph cluster_19 { color=blue - 51 [label="Enter block"]; - 52 [label="Const: String()"]; - 53 [label="Exit block"]; + 50 [label="Enter block"]; + 51 [label="Const: String()"]; + 52 [label="Exit block"]; } - 54 [label="Catch exit"]; + 53 [label="Catch exit"]; } - 55 [label="Try expression exit"]; + 54 [label="Try expression exit"]; } - 56 [label="Call arguments union" style="filled" fillcolor=yellow]; - 57 [label="Variable declaration: lval x: R|kotlin/String|"]; - 58 [label="Exit block"]; + 55 [label="Variable declaration: lval x: R|kotlin/String|"]; + 56 [label="Exit block"]; } - 59 [label="Exit function test_2" style="filled" fillcolor=red]; + 57 [label="Exit function test_2" style="filled" fillcolor=red]; } + 38 -> {39}; 39 -> {40}; - 40 -> {41}; - 41 -> {42 49}; + 40 -> {41 48}; + 41 -> {42}; 42 -> {43}; - 43 -> {44}; - 44 -> {60}; - 44 -> {45} [color=red]; - 44 -> {60} [style=dashed]; + 43 -> {58}; + 43 -> {44} [color=red]; + 43 -> {58} [style=dashed]; + 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; - 48 -> {55 49}; + 47 -> {54 48}; + 48 -> {49}; + 48 -> {57} [label=onUncaughtException]; 49 -> {50}; - 49 -> {59} [label=onUncaughtException]; 50 -> {51}; 51 -> {52}; 52 -> {53}; @@ -191,58 +190,54 @@ digraph inplaceLambdaInControlFlowExpressions_kt { 54 -> {55}; 55 -> {56}; 56 -> {57}; - 57 -> {58}; 58 -> {59}; + 59 -> {60}; 60 -> {61}; 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {56} [color=red]; - 64 -> {45} [color=green]; + 62 -> {54} [color=red]; + 62 -> {44} [color=green]; subgraph cluster_20 { color=red - 65 [label="Enter function test_3" style="filled" fillcolor=red]; + 63 [label="Enter function test_3" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 66 [label="Enter block"]; - 67 [label="Postponed enter to lambda"]; + 64 [label="Enter block"]; + 65 [label="Postponed enter to lambda"]; subgraph cluster_22 { color=blue - 75 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 72 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 76 [label="Enter block"]; - 77 [label="Function call: R|/materialize|()"]; - 78 [label="Exit block"]; + 73 [label="Enter block"]; + 74 [label="Function call: R|/materialize|()" style="filled" fillcolor=yellow]; + 75 [label="Exit block"]; } - 79 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 76 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 68 [label="Postponed exit from lambda"]; - 69 [label="Function call: R|kotlin/run|(...)"]; - 70 [label="Check not null: R|kotlin/run|(...)!!"]; - 71 [label="Call arguments union" style="filled" fillcolor=yellow]; - 72 [label="Variable declaration: lval x: R|kotlin/String|"]; - 73 [label="Exit block"]; + 66 [label="Postponed exit from lambda"]; + 67 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 68 [label="Check not null: R|kotlin/run|(...)!!" style="filled" fillcolor=yellow]; + 69 [label="Variable declaration: lval x: R|kotlin/String|"]; + 70 [label="Exit block"]; } - 74 [label="Exit function test_3" style="filled" fillcolor=red]; + 71 [label="Exit function test_3" style="filled" fillcolor=red]; } - 65 -> {66}; + 63 -> {64}; + 64 -> {65}; + 65 -> {72}; + 65 -> {66} [color=red]; + 65 -> {72} [style=dashed]; 66 -> {67}; - 67 -> {75}; - 67 -> {68} [color=red]; - 67 -> {75} [style=dashed]; + 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; - 71 -> {72}; 72 -> {73}; 73 -> {74}; + 74 -> {75}; 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {71} [color=red]; - 79 -> {68} [color=green]; + 76 -> {68} [color=red]; + 76 -> {66} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot index d108e0025b8..b94ca081f1d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot @@ -38,7 +38,7 @@ digraph jumps_kt { subgraph cluster_6 { color=blue 17 [label="Enter block"]; - 18 [label="Function call: R|java/lang/Exception.Exception|()"]; + 18 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 19 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 20 [label="Stub" style="filled" fillcolor=gray]; 21 [label="Exit block" style="filled" fillcolor=gray]; @@ -48,10 +48,10 @@ digraph jumps_kt { } 24 [label="Variable declaration: lval y: R|kotlin/Int|"]; 25 [label="Access variable R|/y|"]; - 26 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; + 26 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 27 [label="Access variable R|/x|"]; 28 [label="Smart cast: R|/x|"]; - 29 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 29 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 30 [label="Exit block"]; } 31 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -133,7 +133,7 @@ digraph jumps_kt { } 55 [label="Variable declaration: lval y: R|kotlin/Int?|"]; 56 [label="Access variable R|/y|"]; - 57 [label="Function call: R|/y|.#()"]; + 57 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; 58 [label="Exit block"]; } 59 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -199,7 +199,7 @@ digraph jumps_kt { } 75 [label="Access variable R|/x|"]; 76 [label="Smart cast: R|/x|"]; - 77 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 77 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 78 [label="Exit block"]; } 79 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -259,7 +259,7 @@ digraph jumps_kt { } 95 [label="Access variable R|/x|"]; 96 [label="Smart cast: R|/x|"]; - 97 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 97 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 98 [label="Exit block"]; } 99 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -370,7 +370,7 @@ digraph jumps_kt { subgraph cluster_36 { color=blue 126 [label="Enter block"]; - 127 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 127 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 128 [label="Exit block"]; } 129 [label="Exit function run" style="filled" fillcolor=red]; @@ -400,7 +400,7 @@ digraph jumps_kt { 142 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 133 [label="Postponed exit from lambda"]; - 134 [label="Function call: R|/run|(...)"]; + 134 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow]; 135 [label="Exit block"]; } 136 [label="Exit function test_6" style="filled" fillcolor=red]; @@ -410,15 +410,15 @@ digraph jumps_kt { 132 -> {133 137}; 132 -> {137} [style=dashed]; 133 -> {134}; + 133 -> {132} [color=green style=dashed]; 134 -> {135}; 135 -> {136}; - 137 -> {142 138}; + 137 -> {138}; 138 -> {139}; 139 -> {142}; 139 -> {140} [style=dotted]; 140 -> {141} [style=dotted]; 141 -> {142} [style=dotted]; 142 -> {133}; - 142 -> {137} [color=green style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot index 897effc23da..8ba6710aa54 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.dot @@ -21,7 +21,7 @@ digraph lambdaAsReturnOfLambda_kt { color=blue 9 [label="Enter block"]; 10 [label="Access variable R|/foo|"]; - 11 [label="Function call: R|/bar|(...)"]; + 11 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 12 [label="Exit block"]; } 13 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; @@ -37,7 +37,7 @@ digraph lambdaAsReturnOfLambda_kt { 7 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 16 [label="Postponed exit from lambda"]; - 17 [label="Function call: R|/run| kotlin/Unit|>(...)"]; + 17 [label="Function call: R|/run| kotlin/Unit|>(...)" style="filled" fillcolor=yellow]; 18 [label="Exit property" style="filled" fillcolor=red]; } 14 -> {15}; @@ -80,7 +80,7 @@ digraph lambdaAsReturnOfLambda_kt { subgraph cluster_8 { color=blue 24 [label="Enter block"]; - 25 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 25 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 26 [label="Jump: ^run R|/block|.R|SubstitutionOverride|()"]; 27 [label="Stub" style="filled" fillcolor=gray]; 28 [label="Exit block" style="filled" fillcolor=gray]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot index 6d352c84266..2f64d30f128 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.dot @@ -34,7 +34,7 @@ digraph lambdaReturningObject_kt { subgraph cluster_4 { color=red 8 [label="Enter function " style="filled" fillcolor=red]; - 9 [label="Delegated constructor call: super()"]; + 9 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 10 [label="Exit function " style="filled" fillcolor=red]; } 8 -> {9}; @@ -53,7 +53,7 @@ digraph lambdaReturningObject_kt { subgraph cluster_7 { color=blue 14 [label="Enter block"]; - 15 [label="Function call: R|kotlin/TODO|()"]; + 15 [label="Function call: R|kotlin/TODO|()" style="filled" fillcolor=yellow]; 16 [label="Stub" style="filled" fillcolor=gray]; 17 [label="Jump: ^MyOut R|kotlin/TODO|()" style="filled" fillcolor=gray]; 18 [label="Stub" style="filled" fillcolor=gray]; @@ -89,8 +89,8 @@ digraph lambdaReturningObject_kt { 33 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 24 [label="Postponed exit from lambda"]; - 25 [label="Function call: R|/MyOut|(...)"]; - 26 [label="Function call: R|/bar|(...)"]; + 25 [label="Function call: R|/MyOut|(...)" style="filled" fillcolor=yellow]; + 26 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 27 [label="Exit block"]; } 28 [label="Exit function foo" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot index 493b1321b6a..2ab5d119633 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot @@ -9,7 +9,7 @@ digraph lambdas_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function run" style="filled" fillcolor=red]; @@ -49,13 +49,13 @@ digraph lambdas_kt { 24 [label="Enter block"]; 25 [label="Access variable R|/x|"]; 26 [label="Smart cast: R|/x|"]; - 27 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 27 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 28 [label="Exit block"]; } 29 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 16 [label="Postponed exit from lambda"]; - 17 [label="Function call: R|/run|(...)"]; + 17 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow]; 18 [label="Exit block"]; } 19 [label="Exit when branch result"]; @@ -78,19 +78,19 @@ digraph lambdas_kt { 15 -> {16 23}; 15 -> {23} [style=dashed]; 16 -> {17}; + 16 -> {15} [color=green style=dashed]; 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; - 23 -> {29 24}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {16}; - 29 -> {23} [color=green style=dashed]; subgraph cluster_9 { color=red @@ -114,30 +114,29 @@ digraph lambdas_kt { color=blue 39 [label="Enter block"]; 40 [label="Postponed enter to lambda"]; - subgraph cluster_14 { - color=blue - 49 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 50 [label="Enter block"]; - 51 [label="Access variable R|/x|"]; - 52 [label="Smart cast: R|/x|"]; - 53 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 54 [label="Exit block"]; - } - 55 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - 41 [label="Postponed exit from lambda"]; - 42 [label="Exit anonymous function expression"]; - 43 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"]; - 44 [label="Exit block"]; + 41 [label="Exit anonymous function expression"]; + 42 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"]; + 43 [label="Exit block"]; } - 45 [label="Exit when branch result"]; - 46 [label="Exit when"]; + 44 [label="Exit when branch result"]; + 45 [label="Exit when"]; } - 47 [label="Exit block"]; + 46 [label="Exit block"]; } - 48 [label="Exit function test_2" style="filled" fillcolor=red]; + 47 [label="Exit function test_2" style="filled" fillcolor=red]; + } + subgraph cluster_14 { + color=blue + 48 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + subgraph cluster_15 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Smart cast: R|/x|"]; + 52 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 53 [label="Exit block"]; + } + 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 30 -> {31}; 31 -> {32}; @@ -146,148 +145,147 @@ digraph lambdas_kt { 34 -> {35}; 35 -> {36}; 36 -> {38 37}; - 37 -> {46}; + 37 -> {45}; 38 -> {39}; 39 -> {40}; - 40 -> {41 49}; - 40 -> {49} [style=dashed]; + 40 -> {48 41}; + 40 -> {48} [style=dashed]; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; + 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; subgraph cluster_16 { color=red - 56 [label="Enter function getInt" style="filled" fillcolor=red]; + 55 [label="Enter function getInt" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 57 [label="Enter block"]; - 58 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; - 59 [label="Const: Int(1)"]; - 60 [label="Jump: ^getInt Int(1)"]; - 61 [label="Stub" style="filled" fillcolor=gray]; - 62 [label="Exit block" style="filled" fillcolor=gray]; + 56 [label="Enter block"]; + 57 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 58 [label="Const: Int(1)"]; + 59 [label="Jump: ^getInt Int(1)"]; + 60 [label="Stub" style="filled" fillcolor=gray]; + 61 [label="Exit block" style="filled" fillcolor=gray]; } - 63 [label="Exit function getInt" style="filled" fillcolor=red]; + 62 [label="Exit function getInt" style="filled" fillcolor=red]; } + 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; - 59 -> {60}; - 60 -> {63}; + 59 -> {62}; + 59 -> {60} [style=dotted]; 60 -> {61} [style=dotted]; 61 -> {62} [style=dotted]; - 62 -> {63} [style=dotted]; subgraph cluster_18 { color=red - 64 [label="Enter function test_3" style="filled" fillcolor=red]; + 63 [label="Enter function test_3" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 65 [label="Enter block"]; - 66 [label="Postponed enter to lambda"]; + 64 [label="Enter block"]; + 65 [label="Postponed enter to lambda"]; subgraph cluster_20 { color=blue - 73 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 72 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 74 [label="Enter block"]; - 75 [label="Const: Int(1)"]; - 76 [label="Jump: ^test_3 Int(1)"]; - 77 [label="Stub" style="filled" fillcolor=gray]; - 78 [label="Exit block" style="filled" fillcolor=gray]; + 73 [label="Enter block"]; + 74 [label="Const: Int(1)"]; + 75 [label="Jump: ^test_3 Int(1)"]; + 76 [label="Stub" style="filled" fillcolor=gray]; + 77 [label="Exit block" style="filled" fillcolor=gray]; } - 79 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 78 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; } - 67 [label="Postponed exit from lambda"]; - 68 [label="Function call: R|/getInt|(...)"]; - 69 [label="Jump: ^test_3 R|/getInt|( = getInt@fun (): R|kotlin/Unit| { + 66 [label="Postponed exit from lambda"]; + 67 [label="Function call: R|/getInt|(...)" style="filled" fillcolor=yellow]; + 68 [label="Jump: ^test_3 R|/getInt|( = getInt@fun (): R|kotlin/Unit| { ^test_3 Int(1) } )"]; - 70 [label="Stub" style="filled" fillcolor=gray]; - 71 [label="Exit block" style="filled" fillcolor=gray]; + 69 [label="Stub" style="filled" fillcolor=gray]; + 70 [label="Exit block" style="filled" fillcolor=gray]; } - 72 [label="Exit function test_3" style="filled" fillcolor=red]; + 71 [label="Exit function test_3" style="filled" fillcolor=red]; } + 63 -> {64}; 64 -> {65}; - 65 -> {66}; - 66 -> {67 73}; - 66 -> {73} [style=dashed]; + 65 -> {66 72}; + 65 -> {72} [style=dashed]; + 66 -> {67}; + 66 -> {65} [color=green style=dashed]; 67 -> {68}; - 68 -> {69}; - 69 -> {72}; + 68 -> {71}; + 68 -> {69} [style=dotted]; 69 -> {70} [style=dotted]; 70 -> {71} [style=dotted]; - 71 -> {72} [style=dotted]; - 73 -> {79 74}; + 72 -> {73}; + 73 -> {74}; 74 -> {75}; - 75 -> {76}; - 76 -> {72}; + 75 -> {71}; + 75 -> {76} [style=dotted]; 76 -> {77} [style=dotted]; 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {67}; - 79 -> {73} [color=green style=dashed]; + 78 -> {66} [style=dotted]; subgraph cluster_22 { color=red - 80 [label="Enter function test_4" style="filled" fillcolor=red]; + 79 [label="Enter function test_4" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 81 [label="Enter block"]; - 82 [label="Postponed enter to lambda"]; + 80 [label="Enter block"]; + 81 [label="Postponed enter to lambda"]; subgraph cluster_24 { color=blue - 89 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 88 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 90 [label="Enter block"]; - 91 [label="Const: Int(1)"]; - 92 [label="Jump: ^test_4 Int(1)"]; - 93 [label="Stub" style="filled" fillcolor=gray]; - 94 [label="Exit block" style="filled" fillcolor=gray]; + 89 [label="Enter block"]; + 90 [label="Const: Int(1)"]; + 91 [label="Jump: ^test_4 Int(1)"]; + 92 [label="Stub" style="filled" fillcolor=gray]; + 93 [label="Exit block" style="filled" fillcolor=gray]; } - 95 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 94 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; } - 83 [label="Postponed exit from lambda"]; - 84 [label="Function call: R|/getInt|(...)"]; - 85 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { + 82 [label="Postponed exit from lambda"]; + 83 [label="Function call: R|/getInt|(...)" style="filled" fillcolor=yellow]; + 84 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { ^test_4 Int(1) } )"]; - 86 [label="Stub" style="filled" fillcolor=gray]; - 87 [label="Exit block" style="filled" fillcolor=gray]; + 85 [label="Stub" style="filled" fillcolor=gray]; + 86 [label="Exit block" style="filled" fillcolor=gray]; } - 88 [label="Exit function test_4" style="filled" fillcolor=red]; + 87 [label="Exit function test_4" style="filled" fillcolor=red]; } + 79 -> {80}; 80 -> {81}; - 81 -> {82}; - 82 -> {83 89}; - 82 -> {89} [style=dashed]; + 81 -> {82 88}; + 81 -> {88} [style=dashed]; + 82 -> {83}; + 82 -> {81} [color=green style=dashed]; 83 -> {84}; - 84 -> {85}; - 85 -> {88}; + 84 -> {87}; + 84 -> {85} [style=dotted]; 85 -> {86} [style=dotted]; 86 -> {87} [style=dotted]; - 87 -> {88} [style=dotted]; - 89 -> {95 90}; + 88 -> {89}; + 89 -> {90}; 90 -> {91}; - 91 -> {92}; - 92 -> {88}; + 91 -> {87}; + 91 -> {92} [style=dotted]; 92 -> {93} [style=dotted]; 93 -> {94} [style=dotted]; - 94 -> {95} [style=dotted]; - 95 -> {83}; - 95 -> {89} [color=green style=dashed]; + 94 -> {82} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot index 635121b3db9..3fe9cc72510 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.dot @@ -9,7 +9,7 @@ digraph localClassesWithImplicit_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Jump: ^myRun R|/block|.R|SubstitutionOverride|()"]; 4 [label="Stub" style="filled" fillcolor=gray]; 5 [label="Exit block" style="filled" fillcolor=gray]; @@ -108,7 +108,7 @@ digraph localClassesWithImplicit_kt { subgraph cluster_9 { color=red 33 [label="Enter function " style="filled" fillcolor=red]; - 34 [label="Delegated constructor call: super()"]; + 34 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 35 [label="Exit function " style="filled" fillcolor=red]; } 33 -> {34}; @@ -160,7 +160,7 @@ digraph localClassesWithImplicit_kt { 64 [label="Access variable R|/b|"]; 65 [label="Smart cast: R|/b|"]; 66 [label="Access variable R|kotlin/String.length|"]; - 67 [label="Function call: this@R|/A|.R|/bar|()"]; + 67 [label="Function call: this@R|/A|.R|/bar|()" style="filled" fillcolor=yellow]; 68 [label="Exit block"]; } 69 [label="Exit when branch result"]; @@ -171,7 +171,7 @@ digraph localClassesWithImplicit_kt { 72 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 39 [label="Postponed exit from lambda"]; - 40 [label="Function call: R|/myRun|(...)"]; + 40 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 41 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| ^ when () { @@ -196,12 +196,13 @@ digraph localClassesWithImplicit_kt { 38 -> {39 45}; 38 -> {45} [style=dashed]; 39 -> {40}; + 39 -> {38} [color=green style=dashed]; 40 -> {41}; 41 -> {44}; 41 -> {42} [style=dotted]; 42 -> {43} [style=dotted]; 43 -> {44} [style=dotted]; - 45 -> {72 46}; + 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; @@ -229,7 +230,6 @@ digraph localClassesWithImplicit_kt { 70 -> {71}; 71 -> {72}; 72 -> {39}; - 72 -> {45} [color=green style=dashed]; subgraph cluster_19 { color=red @@ -249,13 +249,13 @@ digraph localClassesWithImplicit_kt { 86 [label="Access variable R|/a|"]; 87 [label="Smart cast: R|/a|"]; 88 [label="Access variable R|kotlin/String.length|"]; - 89 [label="Function call: this@R|/A|.R|/baz|()"]; + 89 [label="Function call: this@R|/A|.R|/baz|()" style="filled" fillcolor=yellow]; 90 [label="Exit block"]; } 91 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 76 [label="Postponed exit from lambda"]; - 77 [label="Function call: R|/myRun|(...)"]; + 77 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 78 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/b|.# R|/a|.R|kotlin/String.length| @@ -272,12 +272,13 @@ digraph localClassesWithImplicit_kt { 75 -> {76 82}; 75 -> {82} [style=dashed]; 76 -> {77}; + 76 -> {75} [color=green style=dashed]; 77 -> {78}; 78 -> {81}; 78 -> {79} [style=dotted]; 79 -> {80} [style=dotted]; 80 -> {81} [style=dotted]; - 82 -> {91 83}; + 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; @@ -287,7 +288,6 @@ digraph localClassesWithImplicit_kt { 89 -> {90}; 90 -> {91}; 91 -> {76}; - 91 -> {82} [color=green style=dashed]; subgraph cluster_23 { color=red @@ -313,7 +313,7 @@ digraph localClassesWithImplicit_kt { subgraph cluster_25 { color=red 99 [label="Enter function " style="filled" fillcolor=red]; - 100 [label="Delegated constructor call: super()"]; + 100 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 101 [label="Exit function " style="filled" fillcolor=red]; } 99 -> {100}; @@ -365,7 +365,7 @@ digraph localClassesWithImplicit_kt { 130 [label="Access variable R|/b|"]; 131 [label="Smart cast: R|/b|"]; 132 [label="Access variable R|kotlin/String.length|"]; - 133 [label="Function call: this@R|/|.R|/.bar|()"]; + 133 [label="Function call: this@R|/|.R|/.bar|()" style="filled" fillcolor=yellow]; 134 [label="Exit block"]; } 135 [label="Exit when branch result"]; @@ -376,7 +376,7 @@ digraph localClassesWithImplicit_kt { 138 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 105 [label="Postponed exit from lambda"]; - 106 [label="Function call: R|/myRun|(...)"]; + 106 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 107 [label="Jump: ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| ^ when () { @@ -401,12 +401,13 @@ digraph localClassesWithImplicit_kt { 104 -> {105 111}; 104 -> {111} [style=dashed]; 105 -> {106}; + 105 -> {104} [color=green style=dashed]; 106 -> {107}; 107 -> {110}; 107 -> {108} [style=dotted]; 108 -> {109} [style=dotted]; 109 -> {110} [style=dotted]; - 111 -> {138 112}; + 111 -> {112}; 112 -> {113}; 113 -> {114}; 114 -> {115}; @@ -434,7 +435,6 @@ digraph localClassesWithImplicit_kt { 136 -> {137}; 137 -> {138}; 138 -> {105}; - 138 -> {111} [color=green style=dashed]; subgraph cluster_35 { color=red @@ -454,13 +454,13 @@ digraph localClassesWithImplicit_kt { 152 [label="Access variable R|kotlin/String.length|"]; 153 [label="Access variable R|/b|"]; 154 [label="Access variable #"]; - 155 [label="Function call: this@R|/|.R|/.baz|()"]; + 155 [label="Function call: this@R|/|.R|/.baz|()" style="filled" fillcolor=yellow]; 156 [label="Exit block"]; } 157 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 142 [label="Postponed exit from lambda"]; - 143 [label="Function call: R|/myRun|(...)"]; + 143 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 144 [label="Jump: ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| R|/b|.# @@ -477,12 +477,13 @@ digraph localClassesWithImplicit_kt { 141 -> {142 148}; 141 -> {148} [style=dashed]; 142 -> {143}; + 142 -> {141} [color=green style=dashed]; 143 -> {144}; 144 -> {147}; 144 -> {145} [style=dotted]; 145 -> {146} [style=dotted]; 146 -> {147} [style=dotted]; - 148 -> {157 149}; + 148 -> {149}; 149 -> {150}; 150 -> {151}; 151 -> {152}; @@ -492,7 +493,6 @@ digraph localClassesWithImplicit_kt { 155 -> {156}; 156 -> {157}; 157 -> {142}; - 157 -> {148} [color=green style=dashed]; subgraph cluster_39 { color=red diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot index 7531480d3c3..e9f7b2983e3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/loops.dot @@ -123,8 +123,8 @@ digraph loops_kt { 38 [label="Enter block"]; 39 [label="Const: Int(0)"]; 40 [label="Const: Int(5)"]; - 41 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"]; - 42 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"]; + 41 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)" style="filled" fillcolor=yellow]; + 42 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()" style="filled" fillcolor=yellow]; 43 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; subgraph cluster_15 { color=blue @@ -133,7 +133,7 @@ digraph loops_kt { color=blue 45 [label="Enter loop condition"]; 46 [label="Access variable R|/|"]; - 47 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 47 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 48 [label="Exit loop condition"]; } subgraph cluster_17 { @@ -143,7 +143,7 @@ digraph loops_kt { color=blue 50 [label="Enter block"]; 51 [label="Access variable R|/|"]; - 52 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; + 52 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()" style="filled" fillcolor=yellow]; 53 [label="Variable declaration: lval i: R|kotlin/Int|"]; 54 [label="Access variable R|/x|"]; 55 [label="Type operator: (R|/x| is R|kotlin/String|)"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot index fbff3d6071a..0551097302d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.dot @@ -6,7 +6,7 @@ digraph postponedLambdaInConstructor_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -26,90 +26,88 @@ digraph postponedLambdaInConstructor_kt { 7 [label="Postponed enter to lambda"]; subgraph cluster_3 { color=blue - 13 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 12 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 14 [label="Enter block"]; - 15 [label="Postponed enter to lambda"]; + 13 [label="Enter block"]; + 14 [label="Postponed enter to lambda"]; subgraph cluster_5 { color=blue - 19 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 18 [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"]; + 19 [label="Enter block"]; + 20 [label="Access variable R|/it|"]; + 21 [label="Exit block"]; } - 23 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 22 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 16 [label="Postponed exit from lambda"]; - 17 [label="Exit block"]; + 15 [label="Postponed exit from lambda"]; + 16 [label="Exit block"]; } - 18 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 17 [label="Exit function anonymousFunction" 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]; + 9 [label="Function call: R|/s|.R|kotlin/let| kotlin/String|>(...)" style="filled" fillcolor=yellow]; + 10 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; + 11 [label="Exit function " style="filled" fillcolor=red]; } 5 -> {6}; 6 -> {7}; - 7 -> {13}; + 7 -> {12}; 7 -> {8} [color=red]; - 7 -> {13} [style=dashed]; + 7 -> {12} [style=dashed]; 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {16 19}; - 15 -> {19} [style=dashed]; + 14 -> {15 18}; + 14 -> {18} [style=dashed]; + 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {10} [color=red]; - 18 -> {8} [color=green]; + 17 -> {10} [color=red]; + 17 -> {8} [color=green]; + 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {23}; subgraph cluster_7 { color=red - 24 [label="Enter property" style="filled" fillcolor=red]; - 25 [label="Access variable R|/s|"]; - 26 [label="Exit property" style="filled" fillcolor=red]; + 23 [label="Enter property" style="filled" fillcolor=red]; + 24 [label="Access variable R|/s|"]; + 25 [label="Exit property" style="filled" fillcolor=red]; } + 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {34} [color=green]; + 25 -> {33} [color=green]; subgraph cluster_8 { color=red - 27 [label="Enter function foo" style="filled" fillcolor=red]; + 26 [label="Enter function foo" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 28 [label="Enter block"]; - 29 [label="Function call: this@R|/B|.R|/B.foo|()"]; - 30 [label="Exit block"]; + 27 [label="Enter block"]; + 28 [label="Function call: this@R|/B|.R|/B.foo|()" style="filled" fillcolor=yellow]; + 29 [label="Exit block"]; } - 31 [label="Exit function foo" style="filled" fillcolor=red]; + 30 [label="Exit function foo" style="filled" fillcolor=red]; } + 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {31}; subgraph cluster_10 { color=red - 32 [label="Enter class B" style="filled" fillcolor=red]; - 33 [label="Part of class initialization"]; - 34 [label="Exit class B" style="filled" fillcolor=red]; + 31 [label="Enter class B" style="filled" fillcolor=red]; + 32 [label="Part of class initialization"]; + 33 [label="Exit class B" style="filled" fillcolor=red]; } - 32 -> {33} [color=green]; - 33 -> {34} [style=dotted]; - 33 -> {24} [color=green]; - 33 -> {24} [style=dashed]; + 31 -> {32} [color=green]; + 32 -> {33} [style=dotted]; + 32 -> {23} [color=green]; + 32 -> {23} [style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.dot index 883934d09d5..eee27324896 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.dot @@ -38,7 +38,7 @@ digraph postponedLambdas_kt { 17 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 9 [label="Postponed exit from lambda"]; - 10 [label="Function call: R|/foo|(...)"]; + 10 [label="Function call: R|/foo|(...)" style="filled" fillcolor=yellow]; 11 [label="Exit block"]; } 12 [label="Exit function test" style="filled" fillcolor=red]; @@ -50,13 +50,13 @@ digraph postponedLambdas_kt { 8 -> {9 13}; 8 -> {13} [style=dashed]; 9 -> {10}; + 9 -> {8} [color=green style=dashed]; 10 -> {11}; 11 -> {12}; - 13 -> {17 14}; + 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {9}; - 17 -> {13} [color=green style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot index 6f79da27a30..45e0d506ae2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.dot @@ -9,7 +9,7 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function run" style="filled" fillcolor=red]; @@ -84,9 +84,9 @@ digraph propertiesAndInitBlocks_kt { 36 [label="Enter block"]; 37 [label="Const: Int(1)"]; 38 [label="Const: Int(1)"]; - 39 [label="Function call: Int(1).R|kotlin/Int.plus|(...)"]; + 39 [label="Function call: Int(1).R|kotlin/Int.plus|(...)" style="filled" fillcolor=yellow]; 40 [label="Variable declaration: lval c: R|kotlin/Int|"]; - 41 [label="Function call: R|java/lang/Exception.Exception|()"]; + 41 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 42 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 43 [label="Stub" style="filled" fillcolor=gray]; 44 [label="Exit block" style="filled" fillcolor=gray]; @@ -108,7 +108,7 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_10 { color=red 46 [label="Enter function " style="filled" fillcolor=red]; - 47 [label="Delegated constructor call: super()"]; + 47 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 48 [label="Exit function " style="filled" fillcolor=red]; } 46 -> {47}; @@ -120,7 +120,7 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_12 { color=blue 50 [label="Enter block"]; - 51 [label="Function call: R|java/lang/Exception.Exception|()"]; + 51 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 52 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 53 [label="Stub" style="filled" fillcolor=gray]; 54 [label="Const: Int(1)" style="filled" fillcolor=gray]; @@ -170,7 +170,7 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_16 { color=red 65 [label="Enter function " style="filled" fillcolor=red]; - 66 [label="Delegated constructor call: super()"]; + 66 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 67 [label="Exit function " style="filled" fillcolor=red]; } 65 -> {66}; @@ -182,7 +182,7 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_18 { color=blue 69 [label="Enter block"]; - 70 [label="Function call: R|java/lang/Exception.Exception|()"]; + 70 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 71 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 72 [label="Stub" style="filled" fillcolor=gray]; 73 [label="Exit block" style="filled" fillcolor=gray]; @@ -209,29 +209,30 @@ digraph propertiesAndInitBlocks_kt { color=blue 25 [label="Enter block"]; 26 [label="Exit local class "]; - 27 [label="Function call: R|java/lang/Exception.Exception|()"]; + 27 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 28 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 29 [label="Stub" style="filled" fillcolor=gray]; 30 [label="Exit block" style="filled" fillcolor=gray]; } - subgraph cluster_22 { - color=blue - 32 [label="Enter class InitializerLocalClass" style="filled" fillcolor=red]; - 33 [label="Part of class initialization"]; - 34 [label="Exit class InitializerLocalClass" style="filled" fillcolor=red]; - } - 31 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 31 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + subgraph cluster_22 { + color=blue + 32 [label="Enter class InitializerLocalClass" style="filled" fillcolor=red]; + 33 [label="Part of class initialization"]; + 34 [label="Exit class InitializerLocalClass" style="filled" fillcolor=red]; } 77 [label="Postponed exit from lambda"]; - 78 [label="Function call: R|/run|(...)"]; + 78 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow]; 79 [label="Exit property" style="filled" fillcolor=red]; } 75 -> {76}; 76 -> {77 24}; 76 -> {24} [style=dashed]; 77 -> {78}; + 77 -> {76} [color=green style=dashed]; 78 -> {79}; - 24 -> {31 25}; + 24 -> {25}; 25 -> {26}; 25 -> {35 46 49} [color=red]; 26 -> {27}; @@ -242,8 +243,7 @@ digraph propertiesAndInitBlocks_kt { 28 -> {29} [style=dotted]; 29 -> {30} [style=dotted]; 30 -> {31} [style=dotted]; - 31 -> {77}; - 31 -> {24} [color=green style=dashed]; + 31 -> {77} [style=dotted]; 32 -> {33} [color=green]; 33 -> {34} [style=dotted]; 33 -> {49} [color=green]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot index 9e36a1e04e2..d63fbd590a5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.dot @@ -13,7 +13,7 @@ digraph returnValuesFromLambda_kt { subgraph cluster_1 { color=red 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Delegated constructor call: super()"]; + 3 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 4 [label="Exit function " style="filled" fillcolor=red]; } 2 -> {3}; @@ -29,7 +29,7 @@ digraph returnValuesFromLambda_kt { subgraph cluster_3 { color=red 7 [label="Enter function " style="filled" fillcolor=red]; - 8 [label="Delegated constructor call: super()"]; + 8 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 9 [label="Exit function " style="filled" fillcolor=red]; } 7 -> {8}; @@ -51,170 +51,164 @@ digraph returnValuesFromLambda_kt { 14 [label="Postponed enter to lambda"]; subgraph cluster_7 { color=blue - 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 20 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_8 { color=blue - 22 [label="Enter block"]; + 21 [label="Enter block"]; subgraph cluster_9 { color=blue - 23 [label="Enter when"]; + 22 [label="Enter when"]; subgraph cluster_10 { color=blue - 24 [label="Enter when branch condition "]; - 25 [label="Access variable R|/b|"]; - 26 [label="Exit when branch condition"]; + 23 [label="Enter when branch condition "]; + 24 [label="Access variable R|/b|"]; + 25 [label="Exit when branch condition"]; } - 27 [label="Synthetic else branch"]; - 28 [label="Enter when branch result"]; + 26 [label="Synthetic else branch"]; + 27 [label="Enter when branch result"]; subgraph cluster_11 { color=blue - 29 [label="Enter block"]; - 30 [label="Function call: R|/B.B|()"]; - 31 [label="Jump: ^@run R|/B.B|()"]; - 32 [label="Stub" style="filled" fillcolor=gray]; - 33 [label="Exit block" style="filled" fillcolor=gray]; + 28 [label="Enter block"]; + 29 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; + 30 [label="Jump: ^@run R|/B.B|()"]; + 31 [label="Stub" style="filled" fillcolor=gray]; + 32 [label="Exit block" style="filled" fillcolor=gray]; } - 34 [label="Exit when branch result" style="filled" fillcolor=gray]; - 35 [label="Exit when"]; + 33 [label="Exit when branch result" style="filled" fillcolor=gray]; + 34 [label="Exit when"]; } - 36 [label="Function call: R|/C.C|()"]; - 37 [label="Exit block"]; + 35 [label="Function call: R|/C.C|()" style="filled" fillcolor=yellow]; + 36 [label="Exit block"]; } - 38 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 37 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 15 [label="Call arguments union" style="filled" fillcolor=yellow]; - 16 [label="Postponed exit from lambda"]; - 17 [label="Function call: R|kotlin/run|(...)"]; - 18 [label="Variable declaration: lval x: R|A|"]; - 19 [label="Exit block"]; + 15 [label="Postponed exit from lambda"]; + 16 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 17 [label="Variable declaration: lval x: R|A|"]; + 18 [label="Exit block"]; } - 20 [label="Exit function test_1" style="filled" fillcolor=red]; + 19 [label="Exit function test_1" style="filled" fillcolor=red]; } 12 -> {13}; 13 -> {14}; - 14 -> {21}; - 14 -> {16} [color=red]; - 14 -> {21} [style=dashed]; - 15 -> {17} [color=red]; - 16 -> {17} [color=green]; + 14 -> {20}; + 14 -> {15} [color=red]; + 14 -> {20} [style=dashed]; + 15 -> {16}; + 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {28 27}; - 27 -> {35}; + 25 -> {27 26}; + 26 -> {34}; + 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {31}; - 31 -> {38}; + 30 -> {37}; + 30 -> {31} [style=dotted]; 31 -> {32} [style=dotted]; 32 -> {33} [style=dotted]; 33 -> {34} [style=dotted]; - 34 -> {35} [style=dotted]; + 34 -> {35}; 35 -> {36}; 36 -> {37}; - 37 -> {38}; - 38 -> {15} [color=red]; - 38 -> {16} [color=green]; + 37 -> {16} [color=red]; + 37 -> {15} [color=green]; subgraph cluster_12 { color=red - 39 [label="Enter function test_2" style="filled" fillcolor=red]; + 38 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 40 [label="Enter block"]; - 41 [label="Postponed enter to lambda"]; + 39 [label="Enter block"]; + 40 [label="Postponed enter to lambda"]; subgraph cluster_14 { color=blue - 48 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 46 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_15 { color=blue - 49 [label="Enter block"]; - 50 [label="Function call: R|/C.C|()"]; - 51 [label="Jump: ^@run R|/C.C|()"]; - 52 [label="Stub" style="filled" fillcolor=gray]; - 53 [label="Exit block" style="filled" fillcolor=gray]; + 47 [label="Enter block"]; + 48 [label="Function call: R|/C.C|()" style="filled" fillcolor=yellow]; + 49 [label="Jump: ^@run R|/C.C|()"]; + 50 [label="Stub" style="filled" fillcolor=gray]; + 51 [label="Exit block" style="filled" fillcolor=gray]; } - 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 52 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 42 [label="Call arguments union" style="filled" fillcolor=yellow]; - 43 [label="Postponed exit from lambda"]; - 44 [label="Function call: R|kotlin/run|(...)"]; - 45 [label="Variable declaration: lval x: R|C|"]; - 46 [label="Exit block"]; + 41 [label="Postponed exit from lambda"]; + 42 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 43 [label="Variable declaration: lval x: R|C|"]; + 44 [label="Exit block"]; } - 47 [label="Exit function test_2" style="filled" fillcolor=red]; + 45 [label="Exit function test_2" style="filled" fillcolor=red]; } + 38 -> {39}; 39 -> {40}; - 40 -> {41}; - 41 -> {48}; - 41 -> {43} [color=red]; - 41 -> {48} [style=dashed]; - 42 -> {44} [color=red]; - 43 -> {44} [color=green]; + 40 -> {46}; + 40 -> {41} [color=red]; + 40 -> {46} [style=dashed]; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; 44 -> {45}; - 45 -> {46}; 46 -> {47}; + 47 -> {48}; 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {54}; + 49 -> {52}; + 49 -> {50} [style=dotted]; + 50 -> {51} [style=dotted]; 51 -> {52} [style=dotted]; - 52 -> {53} [style=dotted]; - 53 -> {54} [style=dotted]; - 54 -> {42} [color=red]; - 54 -> {43} [color=green]; + 52 -> {42} [color=red]; + 52 -> {41} [color=green]; subgraph cluster_16 { color=red - 55 [label="Enter function test_3" style="filled" fillcolor=red]; + 53 [label="Enter function test_3" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 56 [label="Enter block"]; - 57 [label="Postponed enter to lambda"]; + 54 [label="Enter block"]; + 55 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 65 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 62 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 66 [label="Enter block"]; - 67 [label="Jump: ^test_3 Unit"]; - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Exit block" style="filled" fillcolor=gray]; + 63 [label="Enter block"]; + 64 [label="Jump: ^test_3 Unit"]; + 65 [label="Stub" style="filled" fillcolor=gray]; + 66 [label="Exit block" style="filled" fillcolor=gray]; } - 70 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 67 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; } - 58 [label="Call arguments union" style="filled" fillcolor=gray]; - 59 [label="Postponed exit from lambda" style="filled" fillcolor=gray]; - 60 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=gray]; - 61 [label="Stub" style="filled" fillcolor=gray]; - 62 [label="Variable declaration: lval x: R|kotlin/Nothing|" style="filled" fillcolor=gray]; - 63 [label="Exit block" style="filled" fillcolor=gray]; + 56 [label="Postponed exit from lambda" style="filled" fillcolor=gray]; + 57 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=gray]; + 58 [label="Stub" style="filled" fillcolor=gray]; + 59 [label="Variable declaration: lval x: R|kotlin/Nothing|" style="filled" fillcolor=gray]; + 60 [label="Exit block" style="filled" fillcolor=gray]; } - 64 [label="Exit function test_3" style="filled" fillcolor=red]; + 61 [label="Exit function test_3" style="filled" fillcolor=red]; } - 55 -> {56}; - 56 -> {57}; - 57 -> {65}; - 57 -> {59} [color=red]; - 57 -> {65} [style=dashed]; - 58 -> {60} [style=dotted]; + 53 -> {54}; + 54 -> {55}; + 55 -> {62}; + 55 -> {56} [color=red]; + 55 -> {62} [style=dashed]; + 56 -> {57} [style=dotted]; + 57 -> {58} [style=dotted]; + 57 -> {61} [style=dotted] [label=onUncaughtException]; + 58 -> {59} [style=dotted]; 59 -> {60} [style=dotted]; 60 -> {61} [style=dotted]; - 60 -> {64} [style=dotted] [label=onUncaughtException]; - 61 -> {62} [style=dotted]; - 62 -> {63} [style=dotted]; - 63 -> {64} [style=dotted]; - 65 -> {66}; - 66 -> {67}; - 67 -> {64}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; - 70 -> {59 58} [style=dotted]; + 62 -> {63}; + 63 -> {64}; + 64 -> {61}; + 64 -> {65} [style=dotted]; + 65 -> {66} [style=dotted]; + 66 -> {67} [style=dotted]; + 67 -> {56 57} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot index b3c10d671bb..b0eb5d4b52c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.dot @@ -39,10 +39,10 @@ digraph safeCalls_kt { 9 [label="Enter block"]; 10 [label="Access variable R|/x|"]; 11 [label="Enter safe call"]; - 12 [label="Function call: $subj$.R|/A.foo|()"]; + 12 [label="Function call: $subj$.R|/A.foo|()" style="filled" fillcolor=yellow]; 13 [label="Enter safe call"]; 14 [label="Const: String()"]; - 15 [label="Function call: $subj$.R|/A.bar|(...)"]; + 15 [label="Function call: $subj$.R|/A.bar|(...)" style="filled" fillcolor=yellow]; 16 [label="Exit safe call"]; 17 [label="Exit safe call"]; 18 [label="Exit block"]; @@ -105,7 +105,7 @@ digraph safeCalls_kt { 36 [label="Enter safe call"]; 37 [label="Access variable R|/y|"]; 38 [label="Type operator: (R|/y| as R|kotlin/String|)"]; - 39 [label="Function call: $subj$.R|/A.bar|(...)"]; + 39 [label="Function call: $subj$.R|/A.bar|(...)" style="filled" fillcolor=yellow]; 40 [label="Exit safe call"]; 41 [label="Const: Null(null)"]; 42 [label="Equality operator !="]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/simple.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/simple.dot index cbe4534a2e3..00c23850d1b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/simple.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/simple.dot @@ -27,9 +27,9 @@ digraph simple_kt { 7 [label="Variable declaration: lval x: R|kotlin/Int|"]; 8 [label="Access variable R|/x|"]; 9 [label="Const: Int(1)"]; - 10 [label="Function call: R|/x|.R|kotlin/Int.plus|(...)"]; + 10 [label="Function call: R|/x|.R|kotlin/Int.plus|(...)" style="filled" fillcolor=yellow]; 11 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 12 [label="Function call: R|/foo|()"]; + 12 [label="Function call: R|/foo|()" style="filled" fillcolor=yellow]; 13 [label="Exit block"]; } 14 [label="Exit function test" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.dot index faf8d7f6da7..3ed339e3242 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.dot @@ -202,7 +202,7 @@ digraph tryCatch_kt { color=blue 70 [label="Enter when branch condition "]; 71 [label="Access variable R|/b|"]; - 72 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 72 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 73 [label="Exit when branch condition"]; } 74 [label="Synthetic else branch"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/variableInitializedInTryBlock.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/variableInitializedInTryBlock.dot index 3d52d66515b..bcf9fa40200 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/variableInitializedInTryBlock.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/variableInitializedInTryBlock.dot @@ -19,7 +19,7 @@ digraph variableInitializedInTryBlock_kt { subgraph cluster_4 { color=blue 5 [label="Enter block"]; - 6 [label="Function call: R|/getStringOrNull|()"]; + 6 [label="Function call: R|/getStringOrNull|()" style="filled" fillcolor=yellow]; 7 [label="Exit lhs of ?:"]; 8 [label="Enter rhs of ?:"]; 9 [label="Jump: ^test Unit"]; @@ -42,7 +42,7 @@ digraph variableInitializedInTryBlock_kt { subgraph cluster_6 { color=blue 22 [label="Enter block"]; - 23 [label="Function call: R|/test|()"]; + 23 [label="Function call: R|/test|()" style="filled" fillcolor=yellow]; 24 [label="Exit block"]; } 25 [label="Exit finally"]; @@ -50,7 +50,7 @@ digraph variableInitializedInTryBlock_kt { 26 [label="Try expression exit"]; } 27 [label="Access variable R|/b|"]; - 28 [label="Function call: R|/takeBoolean|(...)"]; + 28 [label="Function call: R|/takeBoolean|(...)" style="filled" fillcolor=yellow]; 29 [label="Exit block"]; } 30 [label="Exit function test" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/when.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/when.dot index 0af26260932..47e2095ab88 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/when.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/when.dot @@ -25,7 +25,7 @@ digraph when_kt { 8 [label="Enter when branch condition "]; 9 [label="Access variable R|/x|"]; 10 [label="Const: Int(2)"]; - 11 [label="Function call: R|/x|.R|kotlin/Int.rem|(...)"]; + 11 [label="Function call: R|/x|.R|kotlin/Int.rem|(...)" style="filled" fillcolor=yellow]; 12 [label="Const: Int(0)"]; 13 [label="Equality operator =="]; 14 [label="Exit when branch condition"]; @@ -35,7 +35,7 @@ digraph when_kt { 15 [label="Enter when branch condition "]; 16 [label="Const: Int(1)"]; 17 [label="Const: Int(1)"]; - 18 [label="Function call: Int(1).R|kotlin/Int.minus|(...)"]; + 18 [label="Function call: Int(1).R|kotlin/Int.minus|(...)" style="filled" fillcolor=yellow]; 19 [label="Const: Int(0)"]; 20 [label="Equality operator =="]; 21 [label="Exit when branch condition"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/classCallInLambda.dot b/compiler/fir/analysis-tests/testData/resolve/classCallInLambda.dot index 0b89489a7aa..ebf405213dd 100644 --- a/compiler/fir/analysis-tests/testData/resolve/classCallInLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/classCallInLambda.dot @@ -13,47 +13,45 @@ digraph classCallInLambda_kt { 3 [label="Postponed enter to lambda"]; subgraph cluster_2 { color=blue - 11 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 10 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 12 [label="Enter block"]; - 13 [label="Access variable R|/it|"]; - 14 [label="::class call"]; - 15 [label="Exit block"]; + 11 [label="Enter block"]; + 12 [label="Access variable R|/it|"]; + 13 [label="::class call"]; + 14 [label="Exit block"]; } - 16 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 15 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 4 [label="Call arguments union" style="filled" fillcolor=yellow]; - 5 [label="Postponed exit from lambda"]; - 6 [label="Function call: R|/x|.R|kotlin/let||>(...)"]; - 7 [label="Jump: ^test R|/x|.R|kotlin/let||>( = let@fun (it: R|kotlin/String|): R|kotlin/reflect/KClass| { + 4 [label="Postponed exit from lambda"]; + 5 [label="Function call: R|/x|.R|kotlin/let||>(...)" style="filled" fillcolor=yellow]; + 6 [label="Jump: ^test R|/x|.R|kotlin/let||>( = let@fun (it: R|kotlin/String|): R|kotlin/reflect/KClass| { ^ (R|/it|) } )"]; - 8 [label="Stub" style="filled" fillcolor=gray]; - 9 [label="Exit block" style="filled" fillcolor=gray]; + 7 [label="Stub" style="filled" fillcolor=gray]; + 8 [label="Exit block" style="filled" fillcolor=gray]; } - 10 [label="Exit function test" style="filled" fillcolor=red]; + 9 [label="Exit function test" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; 2 -> {3}; - 3 -> {11}; - 3 -> {5} [color=red]; - 3 -> {11} [style=dashed]; - 4 -> {6} [color=red]; - 5 -> {6} [color=green]; - 6 -> {7}; - 7 -> {10}; + 3 -> {10}; + 3 -> {4} [color=red]; + 3 -> {10} [style=dashed]; + 4 -> {5}; + 5 -> {6}; + 6 -> {9}; + 6 -> {7} [style=dotted]; 7 -> {8} [style=dotted]; 8 -> {9} [style=dotted]; - 9 -> {10} [style=dotted]; + 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; - 15 -> {16}; - 16 -> {4} [color=red]; - 16 -> {5} [color=green]; + 15 -> {5} [color=red]; + 15 -> {4} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot index 490ae8546d4..4711132565f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot +++ b/compiler/fir/analysis-tests/testData/resolve/exhaustiveness/positive/exhaustiveWhenAndDNNType.dot @@ -6,7 +6,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super|>()"]; + 1 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -22,7 +22,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_2 { color=red 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()"]; + 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 7 [label="Exit function " style="filled" fillcolor=red]; } 5 -> {6}; @@ -62,7 +62,7 @@ digraph exhaustiveWhenAndDNNType_kt { color=blue 19 [label="Enter when"]; 20 [label="Access variable R|/flag|"]; - 21 [label="Check not null: R|/flag|!!"]; + 21 [label="Check not null: R|/flag|!!" style="filled" fillcolor=yellow]; subgraph cluster_9 { color=blue 22 [label="Enter when branch condition "]; @@ -85,7 +85,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_11 { color=blue 35 [label="Enter block"]; - 36 [label="Function call: R|/B.B|()"]; + 36 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 37 [label="Exit block"]; } 38 [label="Exit when branch result"]; @@ -93,7 +93,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_12 { color=blue 40 [label="Enter block"]; - 41 [label="Function call: R|/B.B|()"]; + 41 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 42 [label="Exit block"]; } 43 [label="Exit when branch result"]; @@ -101,7 +101,7 @@ digraph exhaustiveWhenAndDNNType_kt { } 45 [label="Variable declaration: lval b: R|B|"]; 46 [label="Access variable R|/b|"]; - 47 [label="Function call: R|/takeB|(...)"]; + 47 [label="Function call: R|/takeB|(...)" style="filled" fillcolor=yellow]; 48 [label="Exit block"]; } 49 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -155,7 +155,7 @@ digraph exhaustiveWhenAndDNNType_kt { color=blue 55 [label="Enter when"]; 56 [label="Access variable R|/flag|"]; - 57 [label="Check not null: R|/flag|!!"]; + 57 [label="Check not null: R|/flag|!!" style="filled" fillcolor=yellow]; subgraph cluster_16 { color=blue 58 [label="Enter when branch condition "]; @@ -178,7 +178,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_18 { color=blue 71 [label="Enter block"]; - 72 [label="Function call: R|/B.B|()"]; + 72 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 73 [label="Exit block"]; } 74 [label="Exit when branch result"]; @@ -186,7 +186,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_19 { color=blue 76 [label="Enter block"]; - 77 [label="Function call: R|/B.B|()"]; + 77 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 78 [label="Exit block"]; } 79 [label="Exit when branch result"]; @@ -194,7 +194,7 @@ digraph exhaustiveWhenAndDNNType_kt { } 81 [label="Variable declaration: lval b: R|B|"]; 82 [label="Access variable R|/b|"]; - 83 [label="Function call: R|/takeB|(...)"]; + 83 [label="Function call: R|/takeB|(...)" style="filled" fillcolor=yellow]; 84 [label="Exit block"]; } 85 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -270,7 +270,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_25 { color=blue 106 [label="Enter block"]; - 107 [label="Function call: R|/B.B|()"]; + 107 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 108 [label="Exit block"]; } 109 [label="Exit when branch result"]; @@ -278,7 +278,7 @@ digraph exhaustiveWhenAndDNNType_kt { subgraph cluster_26 { color=blue 111 [label="Enter block"]; - 112 [label="Function call: R|/B.B|()"]; + 112 [label="Function call: R|/B.B|()" style="filled" fillcolor=yellow]; 113 [label="Exit block"]; } 114 [label="Exit when branch result"]; @@ -286,7 +286,7 @@ digraph exhaustiveWhenAndDNNType_kt { } 116 [label="Variable declaration: lval b: R|B|"]; 117 [label="Access variable R|/b|"]; - 118 [label="Function call: R|/takeB|(...)"]; + 118 [label="Function call: R|/takeB|(...)" style="filled" fillcolor=yellow]; 119 [label="Exit block"]; } 120 [label="Exit function test_3" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot b/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot index 6054bc68e51..13719739f16 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot +++ b/compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.dot @@ -6,7 +6,7 @@ digraph secondaryConstructorCfg_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -38,7 +38,7 @@ digraph secondaryConstructorCfg_kt { color=red 10 [label="Enter function " style="filled" fillcolor=red]; 11 [label="Access variable R|/p0|"]; - 12 [label="Delegated constructor call: this(...)"]; + 12 [label="Delegated constructor call: this(...)" style="filled" fillcolor=yellow]; subgraph cluster_4 { color=blue 13 [label="Enter block"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot index 7b8374e3fac..8eadcad5e42 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot @@ -24,11 +24,11 @@ digraph bangbang_kt { color=blue 5 [label="Enter block"]; 6 [label="Access variable R|/a|"]; - 7 [label="Check not null: R|/a|!!"]; - 8 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 7 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 8 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 9 [label="Access variable R|/a|"]; 10 [label="Smart cast: R|/a|"]; - 11 [label="Function call: R|/a|.R|/A.foo|()"]; + 11 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 12 [label="Exit block"]; } 13 [label="Exit function test_0" style="filled" fillcolor=red]; @@ -56,8 +56,8 @@ digraph bangbang_kt { color=blue 17 [label="Enter when branch condition "]; 18 [label="Access variable R|/a|"]; - 19 [label="Check not null: R|/a|!!"]; - 20 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 19 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 20 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 21 [label="Exit when branch condition"]; } 22 [label="Synthetic else branch"]; @@ -67,7 +67,7 @@ digraph bangbang_kt { 24 [label="Enter block"]; 25 [label="Access variable R|/a|"]; 26 [label="Smart cast: R|/a|"]; - 27 [label="Function call: R|/a|.R|/A.foo|()"]; + 27 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 28 [label="Exit block"]; } 29 [label="Exit when branch result"]; @@ -75,7 +75,7 @@ digraph bangbang_kt { } 31 [label="Access variable R|/a|"]; 32 [label="Smart cast: R|/a|"]; - 33 [label="Function call: R|/a|.R|/A.foo|()"]; + 33 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 34 [label="Exit block"]; } 35 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -118,8 +118,8 @@ digraph bangbang_kt { color=blue 40 [label="Enter &&"]; 41 [label="Access variable R|/a|"]; - 42 [label="Check not null: R|/a|!!"]; - 43 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 42 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 43 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 44 [label="Exit left part of &&"]; 45 [label="Enter right part of &&"]; 46 [label="Access variable R|/b|"]; @@ -134,7 +134,7 @@ digraph bangbang_kt { 51 [label="Enter block"]; 52 [label="Access variable R|/a|"]; 53 [label="Smart cast: R|/a|"]; - 54 [label="Function call: R|/a|.R|/A.foo|()"]; + 54 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 55 [label="Exit block"]; } 56 [label="Exit when branch result"]; @@ -142,7 +142,7 @@ digraph bangbang_kt { } 58 [label="Access variable R|/a|"]; 59 [label="Smart cast: R|/a|"]; - 60 [label="Function call: R|/a|.R|/A.foo|()"]; + 60 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 61 [label="Exit block"]; } 62 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -193,8 +193,8 @@ digraph bangbang_kt { 69 [label="Exit left part of &&"]; 70 [label="Enter right part of &&"]; 71 [label="Access variable R|/a|"]; - 72 [label="Check not null: R|/a|!!"]; - 73 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 72 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 73 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 74 [label="Exit &&"]; } 75 [label="Exit when branch condition"]; @@ -206,14 +206,14 @@ digraph bangbang_kt { 78 [label="Enter block"]; 79 [label="Access variable R|/a|"]; 80 [label="Smart cast: R|/a|"]; - 81 [label="Function call: R|/a|.R|/A.foo|()"]; + 81 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 82 [label="Exit block"]; } 83 [label="Exit when branch result"]; 84 [label="Exit when"]; } 85 [label="Access variable R|/a|"]; - 86 [label="Function call: R|/a|.#()"]; + 86 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 87 [label="Exit block"]; } 88 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -260,8 +260,8 @@ digraph bangbang_kt { color=blue 93 [label="Enter ||"]; 94 [label="Access variable R|/a|"]; - 95 [label="Check not null: R|/a|!!"]; - 96 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 95 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 96 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 97 [label="Exit left part of ||"]; 98 [label="Enter right part of ||"]; 99 [label="Access variable R|/b|"]; @@ -276,7 +276,7 @@ digraph bangbang_kt { 104 [label="Enter block"]; 105 [label="Access variable R|/a|"]; 106 [label="Smart cast: R|/a|"]; - 107 [label="Function call: R|/a|.R|/A.foo|()"]; + 107 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 108 [label="Exit block"]; } 109 [label="Exit when branch result"]; @@ -284,7 +284,7 @@ digraph bangbang_kt { } 111 [label="Access variable R|/a|"]; 112 [label="Smart cast: R|/a|"]; - 113 [label="Function call: R|/a|.R|/A.foo|()"]; + 113 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 114 [label="Exit block"]; } 115 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -335,8 +335,8 @@ digraph bangbang_kt { 122 [label="Exit left part of ||"]; 123 [label="Enter right part of ||"]; 124 [label="Access variable R|/a|"]; - 125 [label="Check not null: R|/a|!!"]; - 126 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 125 [label="Check not null: R|/a|!!" style="filled" fillcolor=yellow]; + 126 [label="Function call: R|/a|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 127 [label="Exit ||"]; } 128 [label="Exit when branch condition"]; @@ -347,14 +347,14 @@ digraph bangbang_kt { color=blue 131 [label="Enter block"]; 132 [label="Access variable R|/a|"]; - 133 [label="Function call: R|/a|.#()"]; + 133 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 134 [label="Exit block"]; } 135 [label="Exit when branch result"]; 136 [label="Exit when"]; } 137 [label="Access variable R|/a|"]; - 138 [label="Function call: R|/a|.#()"]; + 138 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 139 [label="Exit block"]; } 140 [label="Exit function test_5" style="filled" fillcolor=red]; @@ -391,8 +391,8 @@ digraph bangbang_kt { color=blue 142 [label="Enter block"]; 143 [label="Access variable R|/x|"]; - 144 [label="Check not null: R|/x|!!"]; - 145 [label="Function call: R|/x|!!.R|/A.foo|()"]; + 144 [label="Check not null: R|/x|!!" style="filled" fillcolor=yellow]; + 145 [label="Function call: R|/x|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 146 [label="Exit block"]; } 147 [label="Exit function test_6" style="filled" fillcolor=red]; @@ -411,8 +411,8 @@ digraph bangbang_kt { color=blue 149 [label="Enter block"]; 150 [label="Access variable R|/x|"]; - 151 [label="Check not null: R|/x|!!"]; - 152 [label="Function call: R|/x|!!.R|/A.foo|()"]; + 151 [label="Check not null: R|/x|!!" style="filled" fillcolor=yellow]; + 152 [label="Function call: R|/x|!!.R|/A.foo|()" style="filled" fillcolor=yellow]; 153 [label="Exit block"]; } 154 [label="Exit function test_7" style="filled" fillcolor=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 58d7fec75cf..683cc2720f7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.dot @@ -85,13 +85,13 @@ digraph booleanOperators_kt { 30 [label="Enter block"]; 31 [label="Access variable R|/x|"]; 32 [label="Smart cast: R|/x|"]; - 33 [label="Function call: R|/x|.R|/A.foo|()"]; + 33 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 34 [label="Access variable R|/x|"]; 35 [label="Smart cast: R|/x|"]; - 36 [label="Function call: R|/x|.R|/B.bar|()"]; + 36 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 37 [label="Access variable R|/x|"]; 38 [label="Smart cast: R|/x|"]; - 39 [label="Function call: R|/x|.R|/C.baz|()"]; + 39 [label="Function call: R|/x|.R|/C.baz|()" style="filled" fillcolor=yellow]; 40 [label="Exit block"]; } 41 [label="Exit when branch result"]; @@ -164,13 +164,13 @@ digraph booleanOperators_kt { 60 [label="Enter block"]; 61 [label="Access variable R|/x|"]; 62 [label="Smart cast: R|/x|"]; - 63 [label="Function call: R|/x|.R|/A.foo|()"]; + 63 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 64 [label="Access variable R|/x|"]; 65 [label="Smart cast: R|/x|"]; - 66 [label="Function call: R|/x|.#()"]; + 66 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 67 [label="Access variable R|/x|"]; 68 [label="Smart cast: R|/x|"]; - 69 [label="Function call: R|/x|.#()"]; + 69 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 70 [label="Exit block"]; } 71 [label="Exit when branch result"]; @@ -224,7 +224,7 @@ digraph booleanOperators_kt { 78 [label="Enter when branch condition "]; 79 [label="Access variable R|/x|"]; 80 [label="Type operator: (R|/x| !is R|A|)"]; - 81 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; + 81 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 82 [label="Exit when branch condition"]; } 83 [label="Synthetic else branch"]; @@ -234,7 +234,7 @@ digraph booleanOperators_kt { 85 [label="Enter block"]; 86 [label="Access variable R|/x|"]; 87 [label="Smart cast: R|/x|"]; - 88 [label="Function call: R|/x|.R|/A.foo|()"]; + 88 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 89 [label="Exit block"]; } 90 [label="Exit when branch result"]; @@ -358,7 +358,7 @@ digraph booleanOperators_kt { 130 [label="Enter right part of &&"]; 131 [label="Access variable R|/x|"]; 132 [label="Smart cast: R|/x|"]; - 133 [label="Function call: R|/x|.R|/A.bool|()"]; + 133 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=yellow]; 134 [label="Exit &&"]; } 135 [label="Exit when branch condition"]; @@ -370,7 +370,7 @@ digraph booleanOperators_kt { 138 [label="Enter block"]; 139 [label="Access variable R|/x|"]; 140 [label="Smart cast: R|/x|"]; - 141 [label="Function call: R|/x|.R|/A.foo|()"]; + 141 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 142 [label="Exit block"]; } 143 [label="Exit when branch result"]; @@ -419,7 +419,7 @@ digraph booleanOperators_kt { 150 [label="Enter when branch condition "]; 151 [label="Access variable R|/x|"]; 152 [label="Type operator: (R|/x| !is R|A|)"]; - 153 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; + 153 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 154 [label="Exit when branch condition"]; } 155 [label="Synthetic else branch"]; @@ -429,7 +429,7 @@ digraph booleanOperators_kt { 157 [label="Enter block"]; 158 [label="Access variable R|/x|"]; 159 [label="Smart cast: R|/x|"]; - 160 [label="Function call: R|/x|.R|/A.foo|()"]; + 160 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 161 [label="Exit block"]; } 162 [label="Exit when branch result"]; @@ -488,7 +488,7 @@ digraph booleanOperators_kt { color=blue 180 [label="Enter block"]; 181 [label="Access variable R|/x|"]; - 182 [label="Function call: R|/x|.#()"]; + 182 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 183 [label="Exit block"]; } 184 [label="Exit when branch result"]; @@ -550,7 +550,7 @@ digraph booleanOperators_kt { color=blue 202 [label="Enter block"]; 203 [label="Access variable R|/x|"]; - 204 [label="Function call: R|/x|.#()"]; + 204 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 205 [label="Exit block"]; } 206 [label="Exit when branch result"]; @@ -613,7 +613,7 @@ digraph booleanOperators_kt { color=blue 224 [label="Enter block"]; 225 [label="Access variable R|/x|"]; - 226 [label="Function call: R|/x|.#()"]; + 226 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 227 [label="Exit block"]; } 228 [label="Exit when branch result"]; @@ -675,7 +675,7 @@ digraph booleanOperators_kt { color=blue 246 [label="Enter block"]; 247 [label="Access variable R|/x|"]; - 248 [label="Function call: R|/x|.#()"]; + 248 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 249 [label="Exit block"]; } 250 [label="Exit when branch result"]; @@ -738,7 +738,7 @@ digraph booleanOperators_kt { color=blue 268 [label="Enter block"]; 269 [label="Access variable R|/x|"]; - 270 [label="Function call: R|/x|.#()"]; + 270 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 271 [label="Exit block"]; } 272 [label="Exit when branch result"]; @@ -802,7 +802,7 @@ digraph booleanOperators_kt { 290 [label="Enter block"]; 291 [label="Access variable R|/x|"]; 292 [label="Smart cast: R|/x|"]; - 293 [label="Function call: R|/x|.R|/A.foo|()"]; + 293 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 294 [label="Exit block"]; } 295 [label="Exit when branch result"]; @@ -866,7 +866,7 @@ digraph booleanOperators_kt { 313 [label="Enter block"]; 314 [label="Access variable R|/x|"]; 315 [label="Smart cast: R|/x|"]; - 316 [label="Function call: R|/x|.R|/A.foo|()"]; + 316 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 317 [label="Exit block"]; } 318 [label="Exit when branch result"]; @@ -931,7 +931,7 @@ digraph booleanOperators_kt { 336 [label="Enter block"]; 337 [label="Access variable R|/x|"]; 338 [label="Smart cast: R|/x|"]; - 339 [label="Function call: R|/x|.R|/A.foo|()"]; + 339 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 340 [label="Exit block"]; } 341 [label="Exit when branch result"]; 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 8aa9afaf4d1..561c0e31959 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot @@ -46,7 +46,7 @@ digraph equalsToBoolean_kt { color=blue 17 [label="Enter block"]; 18 [label="Access variable R|/b|"]; - 19 [label="Function call: R|/b|.#()"]; + 19 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 20 [label="Exit block"]; } 21 [label="Exit when branch result"]; @@ -56,7 +56,7 @@ digraph equalsToBoolean_kt { 23 [label="Enter block"]; 24 [label="Access variable R|/b|"]; 25 [label="Smart cast: R|/b|"]; - 26 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 26 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 27 [label="Exit block"]; } 28 [label="Exit when branch result"]; @@ -124,7 +124,7 @@ digraph equalsToBoolean_kt { 45 [label="Enter block"]; 46 [label="Access variable R|/b|"]; 47 [label="Smart cast: R|/b|"]; - 48 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 48 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 49 [label="Exit block"]; } 50 [label="Exit when branch result"]; @@ -133,7 +133,7 @@ digraph equalsToBoolean_kt { color=blue 52 [label="Enter block"]; 53 [label="Access variable R|/b|"]; - 54 [label="Function call: R|/b|.#()"]; + 54 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 55 [label="Exit block"]; } 56 [label="Exit when branch result"]; @@ -201,7 +201,7 @@ digraph equalsToBoolean_kt { 73 [label="Enter block"]; 74 [label="Access variable R|/b|"]; 75 [label="Smart cast: R|/b|"]; - 76 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 76 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 77 [label="Exit block"]; } 78 [label="Exit when branch result"]; @@ -210,7 +210,7 @@ digraph equalsToBoolean_kt { color=blue 80 [label="Enter block"]; 81 [label="Access variable R|/b|"]; - 82 [label="Function call: R|/b|.#()"]; + 82 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 83 [label="Exit block"]; } 84 [label="Exit when branch result"]; @@ -277,7 +277,7 @@ digraph equalsToBoolean_kt { color=blue 101 [label="Enter block"]; 102 [label="Access variable R|/b|"]; - 103 [label="Function call: R|/b|.#()"]; + 103 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 104 [label="Exit block"]; } 105 [label="Exit when branch result"]; @@ -287,7 +287,7 @@ digraph equalsToBoolean_kt { 107 [label="Enter block"]; 108 [label="Access variable R|/b|"]; 109 [label="Smart cast: R|/b|"]; - 110 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 110 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 111 [label="Exit block"]; } 112 [label="Exit when branch result"]; @@ -355,7 +355,7 @@ digraph equalsToBoolean_kt { 129 [label="Enter block"]; 130 [label="Access variable R|/b|"]; 131 [label="Smart cast: R|/b|"]; - 132 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 132 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 133 [label="Exit block"]; } 134 [label="Exit when branch result"]; @@ -364,7 +364,7 @@ digraph equalsToBoolean_kt { color=blue 136 [label="Enter block"]; 137 [label="Access variable R|/b|"]; - 138 [label="Function call: R|/b|.#()"]; + 138 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 139 [label="Exit block"]; } 140 [label="Exit when branch result"]; @@ -431,7 +431,7 @@ digraph equalsToBoolean_kt { color=blue 157 [label="Enter block"]; 158 [label="Access variable R|/b|"]; - 159 [label="Function call: R|/b|.#()"]; + 159 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 160 [label="Exit block"]; } 161 [label="Exit when branch result"]; @@ -441,7 +441,7 @@ digraph equalsToBoolean_kt { 163 [label="Enter block"]; 164 [label="Access variable R|/b|"]; 165 [label="Smart cast: R|/b|"]; - 166 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 166 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 167 [label="Exit block"]; } 168 [label="Exit when branch result"]; @@ -508,7 +508,7 @@ digraph equalsToBoolean_kt { color=blue 185 [label="Enter block"]; 186 [label="Access variable R|/b|"]; - 187 [label="Function call: R|/b|.#()"]; + 187 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 188 [label="Exit block"]; } 189 [label="Exit when branch result"]; @@ -518,7 +518,7 @@ digraph equalsToBoolean_kt { 191 [label="Enter block"]; 192 [label="Access variable R|/b|"]; 193 [label="Smart cast: R|/b|"]; - 194 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 194 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 195 [label="Exit block"]; } 196 [label="Exit when branch result"]; @@ -586,7 +586,7 @@ digraph equalsToBoolean_kt { 213 [label="Enter block"]; 214 [label="Access variable R|/b|"]; 215 [label="Smart cast: R|/b|"]; - 216 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 216 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 217 [label="Exit block"]; } 218 [label="Exit when branch result"]; @@ -595,7 +595,7 @@ digraph equalsToBoolean_kt { color=blue 220 [label="Enter block"]; 221 [label="Access variable R|/b|"]; - 222 [label="Function call: R|/b|.#()"]; + 222 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 223 [label="Exit block"]; } 224 [label="Exit when branch result"]; 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 a6c351b20a7..19c19b1d481 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot @@ -31,14 +31,14 @@ digraph jumpFromRhsOfOperator_kt { 9 [label="Equality operator !="]; 10 [label="Exit left part of ||"]; 11 [label="Enter right part of ||"]; - 12 [label="Function call: R|java/lang/Exception.Exception|()"]; + 12 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 13 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 14 [label="Stub" style="filled" fillcolor=gray]; 15 [label="Exit ||"]; } 16 [label="Access variable R|/a|"]; 17 [label="Smart cast: R|/a|"]; - 18 [label="Function call: R|/a|.R|/A.foo|()"]; + 18 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 19 [label="Exit block"]; } 20 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -75,14 +75,14 @@ digraph jumpFromRhsOfOperator_kt { 26 [label="Equality operator =="]; 27 [label="Exit left part of &&"]; 28 [label="Enter right part of &&"]; - 29 [label="Function call: R|java/lang/Exception.Exception|()"]; + 29 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 30 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 31 [label="Stub" style="filled" fillcolor=gray]; 32 [label="Exit &&"]; } 33 [label="Access variable R|/a|"]; 34 [label="Smart cast: R|/a|"]; - 35 [label="Function call: R|/a|.R|/A.foo|()"]; + 35 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 36 [label="Exit block"]; } 37 [label="Exit function teat_2" style="filled" fillcolor=red]; @@ -125,7 +125,7 @@ digraph jumpFromRhsOfOperator_kt { 45 [label="Equality operator !="]; 46 [label="Exit left part of ||"]; 47 [label="Enter right part of ||"]; - 48 [label="Function call: R|java/lang/Exception.Exception|()"]; + 48 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 49 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 50 [label="Stub" style="filled" fillcolor=gray]; 51 [label="Exit ||"]; @@ -139,7 +139,7 @@ digraph jumpFromRhsOfOperator_kt { 55 [label="Enter block"]; 56 [label="Access variable R|/a|"]; 57 [label="Smart cast: R|/a|"]; - 58 [label="Function call: R|/a|.R|/A.foo|()"]; + 58 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 59 [label="Exit block"]; } 60 [label="Exit when branch result"]; @@ -147,7 +147,7 @@ digraph jumpFromRhsOfOperator_kt { } 62 [label="Access variable R|/a|"]; 63 [label="Smart cast: R|/a|"]; - 64 [label="Function call: R|/a|.R|/A.foo|()"]; + 64 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 65 [label="Exit block"]; } 66 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -202,7 +202,7 @@ digraph jumpFromRhsOfOperator_kt { 74 [label="Equality operator =="]; 75 [label="Exit left part of &&"]; 76 [label="Enter right part of &&"]; - 77 [label="Function call: R|java/lang/Exception.Exception|()"]; + 77 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 78 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 79 [label="Stub" style="filled" fillcolor=gray]; 80 [label="Exit &&"]; @@ -216,7 +216,7 @@ digraph jumpFromRhsOfOperator_kt { 84 [label="Enter block"]; 85 [label="Access variable R|/a|"]; 86 [label="Smart cast: R|/a|"]; - 87 [label="Function call: R|/a|.R|/A.foo|()"]; + 87 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 88 [label="Exit block"]; } 89 [label="Exit when branch result"]; @@ -224,7 +224,7 @@ digraph jumpFromRhsOfOperator_kt { } 91 [label="Access variable R|/a|"]; 92 [label="Smart cast: R|/a|"]; - 93 [label="Function call: R|/a|.R|/A.foo|()"]; + 93 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 94 [label="Exit block"]; } 95 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -273,14 +273,14 @@ digraph jumpFromRhsOfOperator_kt { 101 [label="Equality operator =="]; 102 [label="Exit left part of ||"]; 103 [label="Enter right part of ||"]; - 104 [label="Function call: R|java/lang/Exception.Exception|()"]; + 104 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 105 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 106 [label="Stub" style="filled" fillcolor=gray]; 107 [label="Exit ||"]; } 108 [label="Access variable R|/a|"]; 109 [label="Smart cast: R|/a|"]; - 110 [label="Function call: R|/a|.#()"]; + 110 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 111 [label="Exit block"]; } 112 [label="Exit function test_5" style="filled" fillcolor=red]; @@ -317,14 +317,14 @@ digraph jumpFromRhsOfOperator_kt { 118 [label="Equality operator !="]; 119 [label="Exit left part of &&"]; 120 [label="Enter right part of &&"]; - 121 [label="Function call: R|java/lang/Exception.Exception|()"]; + 121 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 122 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 123 [label="Stub" style="filled" fillcolor=gray]; 124 [label="Exit &&"]; } 125 [label="Access variable R|/a|"]; 126 [label="Smart cast: R|/a|"]; - 127 [label="Function call: R|/a|.#()"]; + 127 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 128 [label="Exit block"]; } 129 [label="Exit function teat_6" style="filled" fillcolor=red]; @@ -367,7 +367,7 @@ digraph jumpFromRhsOfOperator_kt { 137 [label="Equality operator =="]; 138 [label="Exit left part of ||"]; 139 [label="Enter right part of ||"]; - 140 [label="Function call: R|java/lang/Exception.Exception|()"]; + 140 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 141 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 142 [label="Stub" style="filled" fillcolor=gray]; 143 [label="Exit ||"]; @@ -381,7 +381,7 @@ digraph jumpFromRhsOfOperator_kt { 147 [label="Enter block"]; 148 [label="Access variable R|/a|"]; 149 [label="Smart cast: R|/a|"]; - 150 [label="Function call: R|/a|.#()"]; + 150 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 151 [label="Exit block"]; } 152 [label="Exit when branch result"]; @@ -389,7 +389,7 @@ digraph jumpFromRhsOfOperator_kt { } 154 [label="Access variable R|/a|"]; 155 [label="Smart cast: R|/a|"]; - 156 [label="Function call: R|/a|.#()"]; + 156 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 157 [label="Exit block"]; } 158 [label="Exit function test_7" style="filled" fillcolor=red]; @@ -444,7 +444,7 @@ digraph jumpFromRhsOfOperator_kt { 166 [label="Equality operator !="]; 167 [label="Exit left part of &&"]; 168 [label="Enter right part of &&"]; - 169 [label="Function call: R|java/lang/Exception.Exception|()"]; + 169 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 170 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 171 [label="Stub" style="filled" fillcolor=gray]; 172 [label="Exit &&"]; @@ -458,7 +458,7 @@ digraph jumpFromRhsOfOperator_kt { 176 [label="Enter block"]; 177 [label="Access variable R|/a|"]; 178 [label="Smart cast: R|/a|"]; - 179 [label="Function call: R|/a|.#()"]; + 179 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 180 [label="Exit block"]; } 181 [label="Exit when branch result"]; @@ -466,7 +466,7 @@ digraph jumpFromRhsOfOperator_kt { } 183 [label="Access variable R|/a|"]; 184 [label="Smart cast: R|/a|"]; - 185 [label="Function call: R|/a|.#()"]; + 185 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 186 [label="Exit block"]; } 187 [label="Exit function test_8" style="filled" fillcolor=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 81e735d9183..49b18ec5ae1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.dot @@ -56,10 +56,10 @@ digraph boundSmartcasts_kt { 19 [label="Enter block"]; 20 [label="Access variable R|/x|"]; 21 [label="Smart cast: R|/x|"]; - 22 [label="Function call: R|/x|.R|/A.foo|()"]; + 22 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 23 [label="Access variable R|/y|"]; 24 [label="Smart cast: R|/y|"]; - 25 [label="Function call: R|/y|.R|/A.foo|()"]; + 25 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 26 [label="Exit block"]; } 27 [label="Exit when branch result"]; @@ -117,10 +117,10 @@ digraph boundSmartcasts_kt { 42 [label="Enter block"]; 43 [label="Access variable R|/x|"]; 44 [label="Smart cast: R|/x|"]; - 45 [label="Function call: R|/x|.R|/A.foo|()"]; + 45 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 46 [label="Access variable R|/y|"]; 47 [label="Smart cast: R|/y|"]; - 48 [label="Function call: R|/y|.R|/A.foo|()"]; + 48 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 49 [label="Exit block"]; } 50 [label="Exit when branch result"]; @@ -178,7 +178,7 @@ digraph boundSmartcasts_kt { 65 [label="Enter block"]; 66 [label="Access variable R|/z|"]; 67 [label="Smart cast: R|/z|"]; - 68 [label="Function call: R|/z|.R|/A.foo|()"]; + 68 [label="Function call: R|/z|.R|/A.foo|()" style="filled" fillcolor=yellow]; 69 [label="Exit block"]; } 70 [label="Exit when branch result"]; @@ -203,10 +203,10 @@ digraph boundSmartcasts_kt { 81 [label="Enter block"]; 82 [label="Access variable R|/z|"]; 83 [label="Smart cast: R|/z|"]; - 84 [label="Function call: R|/z|.#()"]; + 84 [label="Function call: R|/z|.#()" style="filled" fillcolor=yellow]; 85 [label="Access variable R|/z|"]; 86 [label="Smart cast: R|/z|"]; - 87 [label="Function call: R|/z|.R|/B.bar|()"]; + 87 [label="Function call: R|/z|.R|/B.bar|()" style="filled" fillcolor=yellow]; 88 [label="Exit block"]; } 89 [label="Exit when branch result"]; @@ -267,11 +267,11 @@ digraph boundSmartcasts_kt { 98 [label="Type operator: (R|/x| as R|kotlin/Int|)"]; 99 [label="Access variable R|/x|"]; 100 [label="Smart cast: R|/x|"]; - 101 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 101 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 102 [label="Access variable R|/y|"]; 103 [label="Assignment: R|/x|"]; 104 [label="Access variable R|/x|"]; - 105 [label="Function call: R|/x|.#()"]; + 105 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; subgraph cluster_24 { color=blue 106 [label="Enter when"]; @@ -289,10 +289,10 @@ digraph boundSmartcasts_kt { 113 [label="Enter block"]; 114 [label="Access variable R|/x|"]; 115 [label="Smart cast: R|/x|"]; - 116 [label="Function call: R|/x|.R|/A.foo|()"]; + 116 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 117 [label="Access variable R|/y|"]; 118 [label="Smart cast: R|/y|"]; - 119 [label="Function call: R|/y|.R|/A.foo|()"]; + 119 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 120 [label="Exit block"]; } 121 [label="Exit when branch result"]; @@ -337,7 +337,7 @@ digraph boundSmartcasts_kt { subgraph cluster_27 { color=red 125 [label="Enter function " style="filled" fillcolor=red]; - 126 [label="Delegated constructor call: super()"]; + 126 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 127 [label="Exit function " style="filled" fillcolor=red]; } 125 -> {126}; @@ -394,16 +394,16 @@ digraph boundSmartcasts_kt { 147 [label="Exit ?:"]; 148 [label="Variable declaration: lval a: R|kotlin/Any|"]; 149 [label="Access variable R|/a|"]; - 150 [label="Function call: R|/a|.R|/baz|()"]; + 150 [label="Function call: R|/a|.R|/baz|()" style="filled" fillcolor=yellow]; 151 [label="Access variable R|/d|"]; 152 [label="Access variable R|/D.any|"]; 153 [label="Smart cast: R|/d|.R|/D.any|"]; - 154 [label="Function call: R|/d|.R|/D.any|.R|/baz|()"]; + 154 [label="Function call: R|/d|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow]; 155 [label="Access variable R|/a|"]; 156 [label="Type operator: (R|/a| as R|A|)"]; 157 [label="Access variable R|/a|"]; 158 [label="Smart cast: R|/a|"]; - 159 [label="Function call: R|/a|.R|/A.foo|()"]; + 159 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 160 [label="Exit block"]; } 161 [label="Exit function test_5" style="filled" fillcolor=red]; @@ -446,15 +446,15 @@ digraph boundSmartcasts_kt { 168 [label="Type operator: (R|/a| as R|A|)"]; 169 [label="Access variable R|/a|"]; 170 [label="Smart cast: R|/a|"]; - 171 [label="Function call: R|/a|.R|/A.foo|()"]; + 171 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 172 [label="Access variable R|/d1|"]; 173 [label="Access variable R|/D.any|"]; 174 [label="Smart cast: R|/d1|.R|/D.any|"]; - 175 [label="Function call: R|/d1|.R|/D.any|.R|/A.foo|()"]; + 175 [label="Function call: R|/d1|.R|/D.any|.R|/A.foo|()" style="filled" fillcolor=yellow]; 176 [label="Access variable R|/d1|"]; 177 [label="Access variable R|/D.any|"]; 178 [label="Smart cast: R|/d1|.R|/D.any|"]; - 179 [label="Function call: R|/d1|.R|/D.any|.R|/baz|()"]; + 179 [label="Function call: R|/d1|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow]; 180 [label="Exit block"]; } 181 [label="Exit function test_6" style="filled" fillcolor=red]; @@ -499,12 +499,12 @@ digraph boundSmartcasts_kt { 195 [label="Type operator: (R|/a| as R|A|)"]; 196 [label="Access variable R|/a|"]; 197 [label="Smart cast: R|/a|"]; - 198 [label="Function call: R|/a|.R|/A.foo|()"]; + 198 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 199 [label="Access variable R|/b|"]; 200 [label="Type operator: (R|/b| as R|B|)"]; 201 [label="Access variable R|/b|"]; 202 [label="Smart cast: R|/b|"]; - 203 [label="Function call: R|/b|.R|/B.bar|()"]; + 203 [label="Function call: R|/b|.R|/B.bar|()" style="filled" fillcolor=yellow]; 204 [label="Exit block"]; } 205 [label="Exit function test_7" style="filled" fillcolor=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 1b6b5adc9aa..903bb64296b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -6,7 +6,7 @@ digraph boundSmartcastsInBranches_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -45,7 +45,7 @@ digraph boundSmartcastsInBranches_kt { color=blue 13 [label="Enter block"]; 14 [label="Access variable R|/list|"]; - 15 [label="Function call: R|/list|.R|SubstitutionOverride|>|()"]; + 15 [label="Function call: R|/list|.R|SubstitutionOverride|>|()" style="filled" fillcolor=yellow]; 16 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_6 { color=blue @@ -54,7 +54,7 @@ digraph boundSmartcastsInBranches_kt { color=blue 18 [label="Enter loop condition"]; 19 [label="Access variable R|/|"]; - 20 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 20 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 21 [label="Exit loop condition"]; } subgraph cluster_8 { @@ -64,7 +64,7 @@ digraph boundSmartcastsInBranches_kt { color=blue 23 [label="Enter block"]; 24 [label="Access variable R|/|"]; - 25 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 25 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 26 [label="Variable declaration: lval a: R|A|"]; subgraph cluster_10 { color=blue @@ -184,7 +184,7 @@ digraph boundSmartcastsInBranches_kt { subgraph cluster_19 { color=blue 68 [label="Enter block"]; - 69 [label="Function call: R|/A.A|()"]; + 69 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; 70 [label="Assignment: R|/x|"]; 71 [label="Exit block"]; } @@ -261,7 +261,7 @@ digraph boundSmartcastsInBranches_kt { subgraph cluster_26 { color=blue 97 [label="Enter block"]; - 98 [label="Function call: R|/A.A|()"]; + 98 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; 99 [label="Assignment: R|/x|"]; 100 [label="Exit block"]; } @@ -341,7 +341,7 @@ digraph boundSmartcastsInBranches_kt { subgraph cluster_33 { color=blue 127 [label="Enter block"]; - 128 [label="Function call: R|/A.A|()"]; + 128 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; 129 [label="Assignment: R|/x|"]; 130 [label="Exit block"]; } 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 1b36d7b1b4c..7e3504fac2b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.dot @@ -6,7 +6,7 @@ digraph functionCallBound_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -22,7 +22,7 @@ digraph functionCallBound_kt { subgraph cluster_2 { color=red 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()"]; + 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 7 [label="Exit function " style="filled" fillcolor=red]; } 5 -> {6}; @@ -85,7 +85,7 @@ digraph functionCallBound_kt { 25 [label="Access variable R|/base|"]; 26 [label="Type operator: (R|/base| as? R|Sub|)"]; 27 [label="Enter safe call"]; - 28 [label="Function call: $subj$.R|/isOk|()"]; + 28 [label="Function call: $subj$.R|/isOk|()" style="filled" fillcolor=yellow]; 29 [label="Exit safe call"]; 30 [label="Const: Boolean(true)"]; 31 [label="Equality operator =="]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.dot index 0b65c59f402..2b9cdeaeeb7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.dot @@ -50,7 +50,7 @@ digraph casts_kt { 18 [label="Enter block"]; 19 [label="Access variable R|/x|"]; 20 [label="Smart cast: R|/x|"]; - 21 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 21 [label="Function call: R|/x|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 22 [label="Exit block"]; } 23 [label="Exit when branch result"]; @@ -58,7 +58,7 @@ digraph casts_kt { } 25 [label="Access variable R|/x|"]; 26 [label="Smart cast: R|/x|"]; - 27 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 27 [label="Function call: R|/x|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 28 [label="Exit block"]; } 29 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -115,14 +115,14 @@ digraph casts_kt { 44 [label="Enter block"]; 45 [label="Access variable R|/x|"]; 46 [label="Smart cast: R|/x|"]; - 47 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 47 [label="Function call: R|/x|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 48 [label="Exit block"]; } 49 [label="Exit when branch result"]; 50 [label="Exit when"]; } 51 [label="Access variable R|/x|"]; - 52 [label="Function call: R|/x|.#()"]; + 52 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; subgraph cluster_13 { color=blue 53 [label="Enter when"]; @@ -150,14 +150,14 @@ digraph casts_kt { 67 [label="Enter block"]; 68 [label="Access variable R|/x|"]; 69 [label="Smart cast: R|/x|"]; - 70 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 70 [label="Function call: R|/x|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 71 [label="Exit block"]; } 72 [label="Exit when branch result"]; 73 [label="Exit when"]; } 74 [label="Access variable R|/x|"]; - 75 [label="Function call: R|/x|.#()"]; + 75 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; subgraph cluster_17 { color=blue 76 [label="Enter when"]; @@ -182,14 +182,14 @@ digraph casts_kt { color=blue 88 [label="Enter block"]; 89 [label="Access variable R|/x|"]; - 90 [label="Function call: R|/x|.#()"]; + 90 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 91 [label="Exit block"]; } 92 [label="Exit when branch result"]; 93 [label="Exit when"]; } 94 [label="Access variable R|/x|"]; - 95 [label="Function call: R|/x|.#()"]; + 95 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 96 [label="Exit block"]; } 97 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -290,7 +290,7 @@ digraph casts_kt { color=blue 110 [label="Enter block"]; 111 [label="Access variable R|/b|"]; - 112 [label="Function call: R|/b|.#()"]; + 112 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 113 [label="Exit block"]; } 114 [label="Exit when branch result"]; @@ -300,14 +300,14 @@ digraph casts_kt { 116 [label="Enter block"]; 117 [label="Access variable R|/b|"]; 118 [label="Smart cast: R|/b|"]; - 119 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 119 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 120 [label="Exit block"]; } 121 [label="Exit when branch result"]; 122 [label="Exit when"]; } 123 [label="Access variable R|/b|"]; - 124 [label="Function call: R|/b|.#()"]; + 124 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_28 { color=blue 125 [label="Enter when"]; @@ -331,7 +331,7 @@ digraph casts_kt { 135 [label="Enter block"]; 136 [label="Access variable R|/b|"]; 137 [label="Smart cast: R|/b|"]; - 138 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 138 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 139 [label="Exit block"]; } 140 [label="Exit when branch result"]; @@ -340,14 +340,14 @@ digraph casts_kt { color=blue 142 [label="Enter block"]; 143 [label="Access variable R|/b|"]; - 144 [label="Function call: R|/b|.#()"]; + 144 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 145 [label="Exit block"]; } 146 [label="Exit when branch result"]; 147 [label="Exit when"]; } 148 [label="Access variable R|/b|"]; - 149 [label="Function call: R|/b|.#()"]; + 149 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 150 [label="Exit block"]; } 151 [label="Exit function test_4" style="filled" fillcolor=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 73dc7ddea88..31e9a087f00 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.dot @@ -48,7 +48,7 @@ digraph elvis_kt { 21 [label="Enter block"]; 22 [label="Access variable R|/x|"]; 23 [label="Smart cast: R|/x|"]; - 24 [label="Function call: R|/x|.R|/A.foo|()"]; + 24 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 25 [label="Exit block"]; } 26 [label="Exit when branch result"]; 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 4b80c880e60..2b4d7508688 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.dot @@ -237,7 +237,7 @@ digraph returns_kt { 85 [label="Enter block"]; 86 [label="Access variable R|/x|"]; 87 [label="Smart cast: R|/x|"]; - 88 [label="Function call: R|/x|.R|/C.baz|()"]; + 88 [label="Function call: R|/x|.R|/C.baz|()" style="filled" fillcolor=yellow]; 89 [label="Exit block"]; } 90 [label="Exit when branch result"]; @@ -247,7 +247,7 @@ digraph returns_kt { 92 [label="Enter block"]; 93 [label="Access variable R|/x|"]; 94 [label="Smart cast: R|/x|"]; - 95 [label="Function call: R|/x|.R|/B.bar|()"]; + 95 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 96 [label="Exit block"]; } 97 [label="Exit when branch result"]; @@ -255,13 +255,13 @@ digraph returns_kt { } 99 [label="Access variable R|/x|"]; 100 [label="Smart cast: R|/x|"]; - 101 [label="Function call: R|/x|.R|/A.foo|()"]; + 101 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 102 [label="Access variable R|/x|"]; 103 [label="Smart cast: R|/x|"]; - 104 [label="Function call: R|/x|.#()"]; + 104 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 105 [label="Access variable R|/x|"]; 106 [label="Smart cast: R|/x|"]; - 107 [label="Function call: R|/x|.#()"]; + 107 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 108 [label="Exit block"]; } 109 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -342,7 +342,7 @@ digraph returns_kt { 123 [label="Enter block"]; 124 [label="Access variable R|/x|"]; 125 [label="Smart cast: R|/x|"]; - 126 [label="Function call: R|/x|.R|/C.baz|()"]; + 126 [label="Function call: R|/x|.R|/C.baz|()" style="filled" fillcolor=yellow]; 127 [label="Exit block"]; } 128 [label="Exit when branch result"]; @@ -352,18 +352,18 @@ digraph returns_kt { 130 [label="Enter block"]; 131 [label="Access variable R|/x|"]; 132 [label="Smart cast: R|/x|"]; - 133 [label="Function call: R|/x|.R|/B.bar|()"]; + 133 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 134 [label="Exit block"]; } 135 [label="Exit when branch result"]; 136 [label="Exit when"]; } 137 [label="Access variable R|/x|"]; - 138 [label="Function call: R|/x|.#()"]; + 138 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 139 [label="Access variable R|/x|"]; - 140 [label="Function call: R|/x|.#()"]; + 140 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 141 [label="Access variable R|/x|"]; - 142 [label="Function call: R|/x|.#()"]; + 142 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 143 [label="Exit block"]; } 144 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -409,7 +409,7 @@ digraph returns_kt { subgraph cluster_37 { color=blue 146 [label="Enter block"]; - 147 [label="Function call: R|/f|.R|SubstitutionOverride|()"]; + 147 [label="Function call: R|/f|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 148 [label="Jump: ^runHigherOrder R|/f|.R|SubstitutionOverride|()"]; 149 [label="Stub" style="filled" fillcolor=gray]; 150 [label="Exit block" style="filled" fillcolor=gray]; @@ -480,7 +480,7 @@ digraph returns_kt { 186 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 176 [label="Postponed exit from lambda"]; - 177 [label="Function call: R|/runHigherOrder|(...)"]; + 177 [label="Function call: R|/runHigherOrder|(...)" style="filled" fillcolor=yellow]; 178 [label="Exit block"]; } 179 [label="Exit function test_4" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.dot index c6ae77b4b56..3af95f23af2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.dot @@ -155,7 +155,7 @@ digraph simpleIf_kt { 60 [label="Access variable R|kotlin/String.length|"]; 61 [label="Access variable R|/x|"]; 62 [label="Smart cast: R|/x|"]; - 63 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 63 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 64 [label="Exit block"]; } 65 [label="Exit when branch result"]; 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 9f10ef0f3a3..719664310c9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.dot @@ -58,7 +58,7 @@ digraph smartcastFromArgument_kt { 20 [label="Stub" style="filled" fillcolor=gray]; 21 [label="Lhs of ?: is not null"]; 22 [label="Exit ?:"]; - 23 [label="Function call: R|/takeA|(...)"]; + 23 [label="Function call: R|/takeA|(...)" style="filled" fillcolor=yellow]; 24 [label="Exit when branch condition"]; } 25 [label="Synthetic else branch"]; @@ -68,7 +68,7 @@ digraph smartcastFromArgument_kt { 27 [label="Enter block"]; 28 [label="Access variable R|/a|"]; 29 [label="Smart cast: R|/a|"]; - 30 [label="Function call: R|/a|.R|/A.foo|()"]; + 30 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 31 [label="Exit block"]; } 32 [label="Exit when branch result"]; 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 de82071e2ad..01ef7ee4406 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.dot @@ -61,7 +61,7 @@ digraph when_kt { 21 [label="Enter block"]; 22 [label="Access variable R|/x|"]; 23 [label="Smart cast: R|/x|"]; - 24 [label="Function call: R|/x|.R|/B.bar|()"]; + 24 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 25 [label="Exit block"]; } 26 [label="Exit when branch result"]; @@ -71,7 +71,7 @@ digraph when_kt { 28 [label="Enter block"]; 29 [label="Access variable R|/x|"]; 30 [label="Smart cast: R|/x|"]; - 31 [label="Function call: R|/x|.R|/A.foo|()"]; + 31 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 32 [label="Exit block"]; } 33 [label="Exit when branch result"]; @@ -114,10 +114,10 @@ digraph when_kt { 53 [label="Enter block"]; 54 [label="Access variable R|/x|"]; 55 [label="Smart cast: R|/x|"]; - 56 [label="Function call: R|/x|.R|/A.foo|()"]; + 56 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 57 [label="Access variable R|/x|"]; 58 [label="Smart cast: R|/x|"]; - 59 [label="Function call: R|/x|.R|/B.bar|()"]; + 59 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 60 [label="Exit block"]; } 61 [label="Exit when branch result"]; @@ -127,13 +127,13 @@ digraph when_kt { 63 [label="Enter block"]; 64 [label="Access variable R|/x|"]; 65 [label="Smart cast: R|/x|"]; - 66 [label="Function call: R|/x|.R|/A.foo|()"]; + 66 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 67 [label="Access variable R|/x|"]; 68 [label="Smart cast: R|/x|"]; - 69 [label="Function call: R|/x|.R|/B.bar|()"]; + 69 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 70 [label="Access variable R|/x|"]; 71 [label="Smart cast: R|/x|"]; - 72 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 72 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 73 [label="Exit block"]; } 74 [label="Exit when branch result"]; @@ -143,7 +143,7 @@ digraph when_kt { 76 [label="Enter block"]; 77 [label="Access variable R|/x|"]; 78 [label="Smart cast: R|/x|"]; - 79 [label="Function call: R|/x|.R|/A.foo|()"]; + 79 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 80 [label="Exit block"]; } 81 [label="Exit when branch result"]; @@ -272,7 +272,7 @@ digraph when_kt { 103 [label="Enter block"]; 104 [label="Access variable R|/x|"]; 105 [label="Smart cast: R|/x|"]; - 106 [label="Function call: R|/x|.R|/B.bar|()"]; + 106 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 107 [label="Exit block"]; } 108 [label="Exit when branch result"]; @@ -282,7 +282,7 @@ digraph when_kt { 110 [label="Enter block"]; 111 [label="Access variable R|/x|"]; 112 [label="Smart cast: R|/x|"]; - 113 [label="Function call: R|/x|.R|/A.foo|()"]; + 113 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 114 [label="Exit block"]; } 115 [label="Exit when branch result"]; @@ -324,10 +324,10 @@ digraph when_kt { 134 [label="Enter block"]; 135 [label="Access variable R|/x|"]; 136 [label="Smart cast: R|/x|"]; - 137 [label="Function call: R|/x|.R|/A.foo|()"]; + 137 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 138 [label="Access variable R|/x|"]; 139 [label="Smart cast: R|/x|"]; - 140 [label="Function call: R|/x|.R|/B.bar|()"]; + 140 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 141 [label="Exit block"]; } 142 [label="Exit when branch result"]; @@ -337,13 +337,13 @@ digraph when_kt { 144 [label="Enter block"]; 145 [label="Access variable R|/x|"]; 146 [label="Smart cast: R|/x|"]; - 147 [label="Function call: R|/x|.R|/A.foo|()"]; + 147 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 148 [label="Access variable R|/x|"]; 149 [label="Smart cast: R|/x|"]; - 150 [label="Function call: R|/x|.R|/B.bar|()"]; + 150 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 151 [label="Access variable R|/x|"]; 152 [label="Smart cast: R|/x|"]; - 153 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 153 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 154 [label="Exit block"]; } 155 [label="Exit when branch result"]; @@ -353,7 +353,7 @@ digraph when_kt { 157 [label="Enter block"]; 158 [label="Access variable R|/x|"]; 159 [label="Smart cast: R|/x|"]; - 160 [label="Function call: R|/x|.R|/A.foo|()"]; + 160 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 161 [label="Exit block"]; } 162 [label="Exit when branch result"]; @@ -483,10 +483,10 @@ digraph when_kt { 185 [label="Enter block"]; 186 [label="Access variable R|/x|"]; 187 [label="Smart cast: R|/x|"]; - 188 [label="Function call: R|/x|.R|/B.bar|()"]; + 188 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 189 [label="Access variable R|/y|"]; 190 [label="Smart cast: R|/y|"]; - 191 [label="Function call: R|/y|.R|/B.bar|()"]; + 191 [label="Function call: R|/y|.R|/B.bar|()" style="filled" fillcolor=yellow]; 192 [label="Exit block"]; } 193 [label="Exit when branch result"]; @@ -496,10 +496,10 @@ digraph when_kt { 195 [label="Enter block"]; 196 [label="Access variable R|/x|"]; 197 [label="Smart cast: R|/x|"]; - 198 [label="Function call: R|/x|.R|/A.foo|()"]; + 198 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 199 [label="Access variable R|/y|"]; 200 [label="Smart cast: R|/y|"]; - 201 [label="Function call: R|/y|.R|/A.foo|()"]; + 201 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 202 [label="Exit block"]; } 203 [label="Exit when branch result"]; @@ -542,16 +542,16 @@ digraph when_kt { 223 [label="Enter block"]; 224 [label="Access variable R|/x|"]; 225 [label="Smart cast: R|/x|"]; - 226 [label="Function call: R|/x|.R|/A.foo|()"]; + 226 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 227 [label="Access variable R|/x|"]; 228 [label="Smart cast: R|/x|"]; - 229 [label="Function call: R|/x|.R|/B.bar|()"]; + 229 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 230 [label="Access variable R|/y|"]; 231 [label="Smart cast: R|/y|"]; - 232 [label="Function call: R|/y|.R|/A.foo|()"]; + 232 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 233 [label="Access variable R|/y|"]; 234 [label="Smart cast: R|/y|"]; - 235 [label="Function call: R|/y|.R|/B.bar|()"]; + 235 [label="Function call: R|/y|.R|/B.bar|()" style="filled" fillcolor=yellow]; 236 [label="Exit block"]; } 237 [label="Exit when branch result"]; @@ -561,22 +561,22 @@ digraph when_kt { 239 [label="Enter block"]; 240 [label="Access variable R|/x|"]; 241 [label="Smart cast: R|/x|"]; - 242 [label="Function call: R|/x|.R|/A.foo|()"]; + 242 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 243 [label="Access variable R|/x|"]; 244 [label="Smart cast: R|/x|"]; - 245 [label="Function call: R|/x|.R|/B.bar|()"]; + 245 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; 246 [label="Access variable R|/x|"]; 247 [label="Smart cast: R|/x|"]; - 248 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 248 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 249 [label="Access variable R|/y|"]; 250 [label="Smart cast: R|/y|"]; - 251 [label="Function call: R|/y|.R|/A.foo|()"]; + 251 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 252 [label="Access variable R|/y|"]; 253 [label="Smart cast: R|/y|"]; - 254 [label="Function call: R|/y|.R|/B.bar|()"]; + 254 [label="Function call: R|/y|.R|/B.bar|()" style="filled" fillcolor=yellow]; 255 [label="Access variable R|/y|"]; 256 [label="Smart cast: R|/y|"]; - 257 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; + 257 [label="Function call: R|/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 258 [label="Exit block"]; } 259 [label="Exit when branch result"]; @@ -586,10 +586,10 @@ digraph when_kt { 261 [label="Enter block"]; 262 [label="Access variable R|/x|"]; 263 [label="Smart cast: R|/x|"]; - 264 [label="Function call: R|/x|.R|/A.foo|()"]; + 264 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 265 [label="Access variable R|/y|"]; 266 [label="Smart cast: R|/y|"]; - 267 [label="Function call: R|/y|.R|/A.foo|()"]; + 267 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 268 [label="Exit block"]; } 269 [label="Exit when branch result"]; @@ -739,7 +739,7 @@ digraph when_kt { 289 [label="Enter block"]; 290 [label="Access variable R|/x|"]; 291 [label="Smart cast: R|/x|"]; - 292 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 292 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 293 [label="Exit block"]; } 294 [label="Exit when branch result"]; @@ -747,7 +747,7 @@ digraph when_kt { } 296 [label="Access variable R|/x|"]; 297 [label="Smart cast: R|/x|"]; - 298 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 298 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 299 [label="Exit block"]; } 300 [label="Exit function test_4" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/whenSubjectExpression.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/whenSubjectExpression.dot index a6064ccd462..3a2f406733f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/whenSubjectExpression.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/whenSubjectExpression.dot @@ -39,7 +39,7 @@ digraph whenSubjectExpression_kt { 16 [label="Enter block"]; 17 [label="Access variable R|/x|"]; 18 [label="Smart cast: R|/x|"]; - 19 [label="Function call: R|/x|.R|kotlin/Double.toInt|()"]; + 19 [label="Function call: R|/x|.R|kotlin/Double.toInt|()" style="filled" fillcolor=yellow]; 20 [label="Exit block"]; } 21 [label="Exit when branch result"]; @@ -137,7 +137,7 @@ digraph whenSubjectExpression_kt { 52 [label="Enter block"]; 53 [label="Access variable R|/y|"]; 54 [label="Smart cast: R|/y|"]; - 55 [label="Function call: R|/y|.R|kotlin/Double.toInt|()"]; + 55 [label="Function call: R|/y|.R|kotlin/Double.toInt|()" style="filled" fillcolor=yellow]; 56 [label="Exit block"]; } 57 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot index 6da163d937f..c1b01a23a58 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot @@ -40,10 +40,10 @@ digraph equalsAndIdentity_kt { color=blue 14 [label="Enter block"]; 15 [label="Access variable R|/x|"]; - 16 [label="Function call: R|/x|.R|/A.foo|()"]; + 16 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 17 [label="Access variable R|/y|"]; 18 [label="Smart cast: R|/y|"]; - 19 [label="Function call: R|/y|.R|/A.foo|()"]; + 19 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 20 [label="Exit block"]; } 21 [label="Exit when branch result"]; @@ -66,10 +66,10 @@ digraph equalsAndIdentity_kt { color=blue 31 [label="Enter block"]; 32 [label="Access variable R|/x|"]; - 33 [label="Function call: R|/x|.R|/A.foo|()"]; + 33 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 34 [label="Access variable R|/y|"]; 35 [label="Smart cast: R|/y|"]; - 36 [label="Function call: R|/y|.R|/A.foo|()"]; + 36 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 37 [label="Exit block"]; } 38 [label="Exit when branch result"]; @@ -140,9 +140,9 @@ digraph equalsAndIdentity_kt { color=blue 52 [label="Enter block"]; 53 [label="Access variable R|/x|"]; - 54 [label="Function call: R|/x|.#()"]; + 54 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 55 [label="Access variable R|/y|"]; - 56 [label="Function call: R|/y|.#()"]; + 56 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; 57 [label="Exit block"]; } 58 [label="Exit when branch result"]; @@ -165,9 +165,9 @@ digraph equalsAndIdentity_kt { color=blue 68 [label="Enter block"]; 69 [label="Access variable R|/x|"]; - 70 [label="Function call: R|/x|.#()"]; + 70 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 71 [label="Access variable R|/y|"]; - 72 [label="Function call: R|/y|.#()"]; + 72 [label="Function call: R|/y|.#()" style="filled" fillcolor=yellow]; 73 [label="Exit block"]; } 74 [label="Exit when branch result"]; @@ -261,10 +261,10 @@ digraph equalsAndIdentity_kt { 103 [label="Enter block"]; 104 [label="Access variable R|/x|"]; 105 [label="Smart cast: R|/x|"]; - 106 [label="Function call: R|/x|.R|/A.foo|()"]; + 106 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 107 [label="Access variable R|/y|"]; 108 [label="Smart cast: R|/y|"]; - 109 [label="Function call: R|/y|.R|/A.foo|()"]; + 109 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 110 [label="Exit block"]; } 111 [label="Exit when branch result"]; @@ -289,10 +289,10 @@ digraph equalsAndIdentity_kt { 122 [label="Enter block"]; 123 [label="Access variable R|/x|"]; 124 [label="Smart cast: R|/x|"]; - 125 [label="Function call: R|/x|.R|/A.foo|()"]; + 125 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 126 [label="Access variable R|/y|"]; 127 [label="Smart cast: R|/y|"]; - 128 [label="Function call: R|/y|.R|/A.foo|()"]; + 128 [label="Function call: R|/y|.R|/A.foo|()" style="filled" fillcolor=yellow]; 129 [label="Exit block"]; } 130 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/incorrectSmartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/incorrectSmartcastToNothing.dot index 834c68a5f34..abbc6be4d9b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/incorrectSmartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/incorrectSmartcastToNothing.dot @@ -7,7 +7,7 @@ digraph incorrectSmartcastToNothing_kt { color=red 0 [label="Enter property" style="filled" fillcolor=red]; 1 [label="Const: String(foo)"]; - 2 [label="Function call: R|java/io/File.File|(...)"]; + 2 [label="Function call: R|java/io/File.File|(...)" style="filled" fillcolor=yellow]; 3 [label="Exit property" style="filled" fillcolor=red]; } 0 -> {1}; @@ -36,7 +36,7 @@ digraph incorrectSmartcastToNothing_kt { 12 [label="Enter when branch condition "]; 13 [label="Access variable R|/cacheExtSetting|"]; 14 [label="Smart cast: R|/cacheExtSetting|"]; - 15 [label="Function call: R|/cacheExtSetting|.R|kotlin/text/isBlank|()"]; + 15 [label="Function call: R|/cacheExtSetting|.R|kotlin/text/isBlank|()" style="filled" fillcolor=yellow]; 16 [label="Exit when branch condition"]; } subgraph cluster_6 { @@ -50,7 +50,7 @@ digraph incorrectSmartcastToNothing_kt { 20 [label="Enter block"]; 21 [label="Access variable R|/cacheExtSetting|"]; 22 [label="Smart cast: R|/cacheExtSetting|"]; - 23 [label="Function call: R|java/io/File.File|(...)"]; + 23 [label="Function call: R|java/io/File.File|(...)" style="filled" fillcolor=yellow]; 24 [label="Exit block"]; } 25 [label="Exit when branch result"]; @@ -71,32 +71,31 @@ digraph incorrectSmartcastToNothing_kt { 35 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 47 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 46 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 48 [label="Enter block"]; - 49 [label="Access variable R|/it|"]; - 50 [label="Const: String(main.kts.compiled.cache)"]; - 51 [label="Function call: R|java/io/File.File|(...)"]; - 52 [label="Exit block"]; + 47 [label="Enter block"]; + 48 [label="Access variable R|/it|"]; + 49 [label="Const: String(main.kts.compiled.cache)"]; + 50 [label="Function call: R|java/io/File.File|(...)" style="filled" fillcolor=yellow]; + 51 [label="Exit block"]; } - 53 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 52 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 36 [label="Postponed exit from lambda"]; - 37 [label="Function call: $subj$.R|kotlin/let|(...)"]; + 37 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; 38 [label="Exit safe call"]; 39 [label="Exit block"]; } 40 [label="Exit when branch result"]; - 41 [label="Exit when"]; + 41 [label="Merge postponed lambda exits"]; + 42 [label="Exit when"]; } - 42 [label="Variable declaration: lval cacheBaseDir: R|java/io/File?|"]; - 43 [label="Exit block"]; + 43 [label="Variable declaration: lval cacheBaseDir: R|java/io/File?|"]; + 44 [label="Exit block"]; } - 44 [label="Exit function test" style="filled" fillcolor=red]; + 45 [label="Exit function test" style="filled" fillcolor=red]; } - 45 [label="Merge postponed lambda exits"]; - 46 [label="Merge postponed lambda exits"]; 4 -> {5}; 5 -> {6}; 6 -> {7}; @@ -118,35 +117,35 @@ digraph incorrectSmartcastToNothing_kt { 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {41}; + 25 -> {42}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {41}; + 30 -> {42}; 31 -> {32}; 32 -> {33}; 33 -> {34 38}; 34 -> {35}; - 35 -> {47}; + 35 -> {46}; 35 -> {36} [color=red]; - 35 -> {47} [style=dashed]; + 35 -> {46} [style=dashed]; 36 -> {37}; 37 -> {38}; - 38 -> {45 39}; + 38 -> {41 39}; 39 -> {40}; - 40 -> {41}; - 41 -> {46 42}; + 40 -> {42}; + 41 -> {42} [color=red]; 42 -> {43}; 43 -> {44}; - 45 -> {46} [color=red]; + 44 -> {45}; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; - 52 -> {53}; - 53 -> {45} [color=red]; - 53 -> {36} [color=green]; + 52 -> {41} [color=red]; + 52 -> {36} [color=green]; } 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 b03d03a44f2..553ccbb6c37 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.dot @@ -55,28 +55,27 @@ digraph inPlaceLambdas_kt { 18 [label="Postponed enter to lambda"]; subgraph cluster_9 { color=blue - 27 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 26 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_10 { color=blue - 28 [label="Enter block"]; - 29 [label="Access variable R|/x|"]; - 30 [label="Smart cast: R|/x|"]; - 31 [label="Function call: R|/x|.R|/A.foo|()"]; - 32 [label="Exit block"]; + 27 [label="Enter block"]; + 28 [label="Access variable R|/x|"]; + 29 [label="Smart cast: R|/x|"]; + 30 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 31 [label="Exit block"]; } - 33 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 32 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 19 [label="Call arguments union" style="filled" fillcolor=yellow]; - 20 [label="Postponed exit from lambda"]; - 21 [label="Function call: R|kotlin/run|(...)"]; - 22 [label="Exit block"]; + 19 [label="Postponed exit from lambda"]; + 20 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 21 [label="Exit block"]; } - 23 [label="Exit when branch result"]; - 24 [label="Exit when"]; + 22 [label="Exit when branch result"]; + 23 [label="Exit when"]; } - 25 [label="Exit block"]; + 24 [label="Exit block"]; } - 26 [label="Exit function test_1" style="filled" fillcolor=red]; + 25 [label="Exit function test_1" style="filled" fillcolor=red]; } 8 -> {9}; 9 -> {10}; @@ -85,163 +84,158 @@ digraph inPlaceLambdas_kt { 12 -> {13}; 13 -> {14}; 14 -> {16 15}; - 15 -> {24}; + 15 -> {23}; 16 -> {17}; 17 -> {18}; - 18 -> {27}; - 18 -> {20} [color=red]; - 18 -> {27} [style=dashed]; - 19 -> {21} [color=red]; - 20 -> {21} [color=green]; + 18 -> {26}; + 18 -> {19} [color=red]; + 18 -> {26} [style=dashed]; + 19 -> {20}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; + 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {19} [color=red]; - 33 -> {20} [color=green]; + 32 -> {20} [color=red]; + 32 -> {19} [color=green]; subgraph cluster_11 { color=red - 34 [label="Enter function test_2" style="filled" fillcolor=red]; + 33 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_12 { color=blue - 35 [label="Enter block"]; - 36 [label="Postponed enter to lambda"]; + 34 [label="Enter block"]; + 35 [label="Postponed enter to lambda"]; subgraph cluster_13 { color=blue - 45 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 43 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_14 { color=blue - 46 [label="Enter block"]; - 47 [label="Access variable R|/x|"]; - 48 [label="Type operator: (R|/x| as R|B|)"]; - 49 [label="Exit block"]; + 44 [label="Enter block"]; + 45 [label="Access variable R|/x|"]; + 46 [label="Type operator: (R|/x| as R|B|)"]; + 47 [label="Exit block"]; } - 50 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 48 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 37 [label="Call arguments union" style="filled" fillcolor=yellow]; - 38 [label="Postponed exit from lambda"]; - 39 [label="Function call: R|kotlin/run|(...)"]; - 40 [label="Access variable R|/x|"]; - 41 [label="Smart cast: R|/x|"]; - 42 [label="Function call: R|/x|.R|/B.bar|()"]; - 43 [label="Exit block"]; + 36 [label="Postponed exit from lambda"]; + 37 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 38 [label="Access variable R|/x|"]; + 39 [label="Smart cast: R|/x|"]; + 40 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; + 41 [label="Exit block"]; } - 44 [label="Exit function test_2" style="filled" fillcolor=red]; + 42 [label="Exit function test_2" style="filled" fillcolor=red]; } + 33 -> {34}; 34 -> {35}; - 35 -> {36}; - 36 -> {45}; - 36 -> {38} [color=red]; - 36 -> {45} [style=dashed]; - 37 -> {39} [color=red]; - 38 -> {39} [color=green]; + 35 -> {43}; + 35 -> {36} [color=red]; + 35 -> {43} [style=dashed]; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; 43 -> {44}; + 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {37} [color=red]; - 50 -> {38} [color=green]; + 48 -> {37} [color=red]; + 48 -> {36} [color=green]; subgraph cluster_15 { color=red - 51 [label="Enter function test_3" style="filled" fillcolor=red]; + 49 [label="Enter function test_3" style="filled" fillcolor=red]; subgraph cluster_16 { color=blue - 52 [label="Enter block"]; + 50 [label="Enter block"]; subgraph cluster_17 { color=blue - 53 [label="Enter when"]; + 51 [label="Enter when"]; subgraph cluster_18 { color=blue - 54 [label="Enter when branch condition "]; - 55 [label="Access variable R|/x|"]; - 56 [label="Type operator: (R|/x| is R|A|)"]; - 57 [label="Exit when branch condition"]; + 52 [label="Enter when branch condition "]; + 53 [label="Access variable R|/x|"]; + 54 [label="Type operator: (R|/x| is R|A|)"]; + 55 [label="Exit when branch condition"]; } - 58 [label="Synthetic else branch"]; - 59 [label="Enter when branch result"]; + 56 [label="Synthetic else branch"]; + 57 [label="Enter when branch result"]; subgraph cluster_19 { color=blue - 60 [label="Enter block"]; - 61 [label="Postponed enter to lambda"]; + 58 [label="Enter block"]; + 59 [label="Postponed enter to lambda"]; subgraph cluster_20 { color=blue - 73 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 70 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 74 [label="Enter block"]; + 71 [label="Enter block"]; + 72 [label="Access variable R|/x|"]; + 73 [label="Smart cast: R|/x|"]; + 74 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 75 [label="Access variable R|/x|"]; 76 [label="Smart cast: R|/x|"]; - 77 [label="Function call: R|/x|.R|/A.foo|()"]; - 78 [label="Access variable R|/x|"]; - 79 [label="Smart cast: R|/x|"]; - 80 [label="Type operator: (R|/x| as R|B|)"]; - 81 [label="Exit block"]; + 77 [label="Type operator: (R|/x| as R|B|)"]; + 78 [label="Exit block"]; } - 82 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 79 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 62 [label="Call arguments union" style="filled" fillcolor=yellow]; - 63 [label="Postponed exit from lambda"]; - 64 [label="Function call: R|kotlin/run|(...)"]; - 65 [label="Access variable R|/x|"]; - 66 [label="Smart cast: R|/x|"]; - 67 [label="Function call: R|/x|.R|/B.bar|()"]; - 68 [label="Exit block"]; + 60 [label="Postponed exit from lambda"]; + 61 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 62 [label="Access variable R|/x|"]; + 63 [label="Smart cast: R|/x|"]; + 64 [label="Function call: R|/x|.R|/B.bar|()" style="filled" fillcolor=yellow]; + 65 [label="Exit block"]; } - 69 [label="Exit when branch result"]; - 70 [label="Exit when"]; + 66 [label="Exit when branch result"]; + 67 [label="Exit when"]; } - 71 [label="Exit block"]; + 68 [label="Exit block"]; } - 72 [label="Exit function test_3" style="filled" fillcolor=red]; + 69 [label="Exit function test_3" style="filled" fillcolor=red]; } + 49 -> {50}; + 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {59 58}; - 58 -> {70}; - 59 -> {60}; + 55 -> {57 56}; + 56 -> {67}; + 57 -> {58}; + 58 -> {59}; + 59 -> {70}; + 59 -> {60} [color=red]; + 59 -> {70} [style=dashed]; 60 -> {61}; - 61 -> {73}; - 61 -> {63} [color=red]; - 61 -> {73} [style=dashed]; - 62 -> {64} [color=red]; - 63 -> {64} [color=green]; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {70}; 70 -> {71}; 71 -> {72}; + 72 -> {73}; 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {62} [color=red]; - 82 -> {63} [color=green]; + 79 -> {61} [color=red]; + 79 -> {60} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot index 529d6ad8760..9a3d1bd497b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.dot @@ -6,7 +6,7 @@ digraph lambdaInWhenBranch_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -22,7 +22,7 @@ digraph lambdaInWhenBranch_kt { subgraph cluster_2 { color=red 5 [label="Enter function " style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super()"]; + 6 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 7 [label="Exit function " style="filled" fillcolor=red]; } 5 -> {6}; @@ -75,7 +75,7 @@ digraph lambdaInWhenBranch_kt { subgraph cluster_8 { color=red 21 [label="Enter function " style="filled" fillcolor=red]; - 22 [label="Delegated constructor call: super()"]; + 22 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 23 [label="Exit function " style="filled" fillcolor=red]; } 21 -> {22}; @@ -135,17 +135,17 @@ digraph lambdaInWhenBranch_kt { 48 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 83 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 82 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 84 [label="Enter block"]; - 85 [label="Access variable R|/it|"]; - 86 [label="Exit block"]; + 83 [label="Enter block"]; + 84 [label="Access variable R|/it|"]; + 85 [label="Exit block"]; } - 87 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 86 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 49 [label="Postponed exit from lambda"]; - 50 [label="Function call: String().R|kotlin/let|(...)"]; + 50 [label="Function call: String().R|kotlin/let|(...)" style="filled" fillcolor=yellow]; 51 [label="Exit block"]; } 52 [label="Exit when branch result"]; @@ -196,7 +196,6 @@ digraph lambdaInWhenBranch_kt { } 81 [label="Exit function foo" style="filled" fillcolor=red]; } - 82 [label="Merge postponed lambda exits"]; 28 -> {29}; 29 -> {30}; 30 -> {31}; @@ -217,14 +216,14 @@ digraph lambdaInWhenBranch_kt { 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {83}; + 48 -> {82}; 48 -> {49} [color=red]; - 48 -> {83} [style=dashed]; + 48 -> {82} [style=dashed]; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; - 53 -> {82 54}; + 53 -> {54}; 54 -> {55}; 55 -> {56}; 56 -> {57}; @@ -252,11 +251,11 @@ digraph lambdaInWhenBranch_kt { 78 -> {79}; 79 -> {80}; 80 -> {81}; + 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; - 86 -> {87}; - 87 -> {82} [color=red]; - 87 -> {49} [color=green]; + 86 -> {53} [color=red]; + 86 -> {49} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.dot index 0683e33e164..5dcfc60c7d2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.dot @@ -25,7 +25,7 @@ digraph smartcastOnLambda_kt { subgraph cluster_4 { color=blue 10 [label="Enter block"]; - 11 [label="Function call: R|/func|.R|SubstitutionOverride|()"]; + 11 [label="Function call: R|/func|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 12 [label="Exit block"]; } 13 [label="Exit when branch result"]; 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 fa565e91c4b..71e873d12e9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.dot @@ -66,7 +66,7 @@ digraph dataFlowInfoFromWhileCondition_kt { 24 [label="Enter block"]; 25 [label="Access variable R|/a|"]; 26 [label="Smart cast: R|/a|"]; - 27 [label="Function call: R|/a|.R|/A.foo|()"]; + 27 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 28 [label="Exit block"]; } 29 [label="Exit loop block"]; 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 80f872bb7d6..c49ef9cce54 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.dot @@ -69,7 +69,7 @@ digraph endlessLoops_kt { } 29 [label="Access variable R|/x|"]; 30 [label="Smart cast: R|/x|"]; - 31 [label="Function call: R|/x|.R|/A.foo|()"]; + 31 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 32 [label="Exit block"]; } 33 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -158,7 +158,7 @@ digraph endlessLoops_kt { } 59 [label="Access variable R|/x|"]; 60 [label="Smart cast: R|/x|"]; - 61 [label="Function call: R|/x|.R|/A.foo|()"]; + 61 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 62 [label="Exit block"]; } 63 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -268,7 +268,7 @@ digraph endlessLoops_kt { } 101 [label="Access variable R|/x|"]; 102 [label="Smart cast: R|/x|"]; - 103 [label="Function call: R|/x|.R|/A.foo|()"]; + 103 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 104 [label="Exit block"]; } 105 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -371,7 +371,7 @@ digraph endlessLoops_kt { 132 [label="Exit whileloop"]; } 133 [label="Access variable R|/x|"]; - 134 [label="Function call: R|/x|.#()"]; + 134 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 135 [label="Exit block"]; } 136 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -462,7 +462,7 @@ digraph endlessLoops_kt { } 162 [label="Access variable R|/x|"]; 163 [label="Smart cast: R|/x|"]; - 164 [label="Function call: R|/x|.R|/A.foo|()"]; + 164 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 165 [label="Exit block"]; } 166 [label="Exit function test_5" style="filled" fillcolor=red]; @@ -551,7 +551,7 @@ digraph endlessLoops_kt { } 192 [label="Access variable R|/x|"]; 193 [label="Smart cast: R|/x|"]; - 194 [label="Function call: R|/x|.R|/A.foo|()"]; + 194 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 195 [label="Exit block"]; } 196 [label="Exit function test_6" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot index 5566cfe3aa0..3a160a19c67 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.dot @@ -58,20 +58,20 @@ digraph multipleCasts_kt { subgraph cluster_7 { color=blue 16 [label="Enter block"]; - 17 [label="Function call: R|/getAny|()"]; + 17 [label="Function call: R|/getAny|()" style="filled" fillcolor=yellow]; 18 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 19 [label="Function call: R|/getAny|()"]; + 19 [label="Function call: R|/getAny|()" style="filled" fillcolor=yellow]; 20 [label="Variable declaration: lval b: R|kotlin/Any?|"]; 21 [label="Access variable R|/a|"]; 22 [label="Type operator: (R|/a| as R|A|)"]; 23 [label="Access variable R|/a|"]; 24 [label="Smart cast: R|/a|"]; - 25 [label="Function call: R|/a|.R|/A.foo|()"]; + 25 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 26 [label="Access variable R|/b|"]; 27 [label="Type operator: (R|/b| as R|B|)"]; 28 [label="Access variable R|/b|"]; 29 [label="Smart cast: R|/b|"]; - 30 [label="Function call: R|/b|.R|/B.foo|()"]; + 30 [label="Function call: R|/b|.R|/B.foo|()" style="filled" fillcolor=yellow]; 31 [label="Exit block"]; } 32 [label="Exit function test_0" style="filled" fillcolor=red]; @@ -100,9 +100,9 @@ digraph multipleCasts_kt { subgraph cluster_9 { color=blue 34 [label="Enter block"]; - 35 [label="Function call: R|/getAny|()"]; + 35 [label="Function call: R|/getAny|()" style="filled" fillcolor=yellow]; 36 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 37 [label="Function call: R|/getAny|()"]; + 37 [label="Function call: R|/getAny|()" style="filled" fillcolor=yellow]; 38 [label="Variable declaration: lval b: R|kotlin/Any?|"]; subgraph cluster_10 { color=blue @@ -130,10 +130,10 @@ digraph multipleCasts_kt { 52 [label="Enter block"]; 53 [label="Access variable R|/a|"]; 54 [label="Smart cast: R|/a|"]; - 55 [label="Function call: R|/a|.R|/A.foo|()"]; + 55 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 56 [label="Access variable R|/b|"]; 57 [label="Smart cast: R|/b|"]; - 58 [label="Function call: R|/b|.R|/B.foo|()"]; + 58 [label="Function call: R|/b|.R|/B.foo|()" style="filled" fillcolor=yellow]; 59 [label="Exit block"]; } 60 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot index f7d377a7193..b5082e1131f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot @@ -55,7 +55,7 @@ digraph nullability_kt { subgraph cluster_7 { color=red 14 [label="Enter function " style="filled" fillcolor=red]; - 15 [label="Delegated constructor call: super()"]; + 15 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 16 [label="Exit function " style="filled" fillcolor=red]; } 14 -> {15}; @@ -106,7 +106,7 @@ digraph nullability_kt { subgraph cluster_12 { color=red 30 [label="Enter function " style="filled" fillcolor=red]; - 31 [label="Delegated constructor call: super()"]; + 31 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 32 [label="Exit function " style="filled" fillcolor=red]; } 30 -> {31}; @@ -157,7 +157,7 @@ digraph nullability_kt { subgraph cluster_17 { color=red 46 [label="Enter function " style="filled" fillcolor=red]; - 47 [label="Delegated constructor call: super()"]; + 47 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 48 [label="Exit function " style="filled" fillcolor=red]; } 46 -> {47}; @@ -240,7 +240,7 @@ digraph nullability_kt { 76 [label="Enter block"]; 77 [label="Access variable R|/x|"]; 78 [label="Smart cast: R|/x|"]; - 79 [label="Function call: R|/x|.#()"]; + 79 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 80 [label="Exit block"]; } 81 [label="Exit when branch result"]; @@ -250,14 +250,14 @@ digraph nullability_kt { 83 [label="Enter block"]; 84 [label="Access variable R|/x|"]; 85 [label="Smart cast: R|/x|"]; - 86 [label="Function call: R|/x|.R|/A.foo|()"]; + 86 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 87 [label="Exit block"]; } 88 [label="Exit when branch result"]; 89 [label="Exit when"]; } 90 [label="Access variable R|/x|"]; - 91 [label="Function call: R|/x|.#()"]; + 91 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 92 [label="Exit block"]; } 93 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -319,7 +319,7 @@ digraph nullability_kt { 105 [label="Enter block"]; 106 [label="Access variable R|/x|"]; 107 [label="Smart cast: R|/x|"]; - 108 [label="Function call: R|/x|.R|/A.foo|()"]; + 108 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 109 [label="Exit block"]; } 110 [label="Exit when branch result"]; @@ -329,14 +329,14 @@ digraph nullability_kt { 112 [label="Enter block"]; 113 [label="Access variable R|/x|"]; 114 [label="Smart cast: R|/x|"]; - 115 [label="Function call: R|/x|.#()"]; + 115 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 116 [label="Exit block"]; } 117 [label="Exit when branch result"]; 118 [label="Exit when"]; } 119 [label="Access variable R|/x|"]; - 120 [label="Function call: R|/x|.#()"]; + 120 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 121 [label="Exit block"]; } 122 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -385,7 +385,7 @@ digraph nullability_kt { 131 [label="Exit ?:"]; 132 [label="Access variable R|/x|"]; 133 [label="Smart cast: R|/x|"]; - 134 [label="Function call: R|/x|.R|/A.foo|()"]; + 134 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 135 [label="Exit block"]; } 136 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -419,7 +419,7 @@ digraph nullability_kt { 140 [label="Enter when branch condition "]; 141 [label="Access variable R|/x|"]; 142 [label="Enter safe call"]; - 143 [label="Function call: $subj$.R|/A.getA|()"]; + 143 [label="Function call: $subj$.R|/A.getA|()" style="filled" fillcolor=yellow]; 144 [label="Exit safe call"]; 145 [label="Const: Null(null)"]; 146 [label="Equality operator =="]; @@ -439,7 +439,7 @@ digraph nullability_kt { } 156 [label="Access variable R|/x|"]; 157 [label="Smart cast: R|/x|"]; - 158 [label="Function call: R|/x|.R|/A.foo|()"]; + 158 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 159 [label="Exit block"]; } 160 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -487,7 +487,7 @@ digraph nullability_kt { 168 [label="Enter safe call"]; 169 [label="Access variable R|/MyData.s|"]; 170 [label="Enter safe call"]; - 171 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 171 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 172 [label="Exit safe call"]; 173 [label="Exit safe call"]; 174 [label="Exit safe call"]; @@ -514,7 +514,7 @@ digraph nullability_kt { 192 [label="Access variable R|/Q.data|"]; 193 [label="Smart cast: R|/q|.R|/Q.data|"]; 194 [label="Access variable #"]; - 195 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()"]; + 195 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 196 [label="Exit block"]; } 197 [label="Exit when branch result"]; @@ -576,7 +576,7 @@ digraph nullability_kt { 206 [label="Enter safe call"]; 207 [label="Access variable R|/MyData.s|"]; 208 [label="Enter safe call"]; - 209 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 209 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 210 [label="Exit safe call"]; 211 [label="Exit lhs of ?:"]; 212 [label="Lhs of ?: is not null"]; @@ -600,7 +600,7 @@ digraph nullability_kt { 230 [label="Access variable R|/Q.data|"]; 231 [label="Smart cast: R|/q|.R|/Q.data|"]; 232 [label="Access variable #"]; - 233 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()"]; + 233 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 234 [label="Exit block"]; } 235 [label="Exit function test_6" style="filled" fillcolor=red]; @@ -655,11 +655,11 @@ digraph nullability_kt { 239 [label="Enter when branch condition "]; 240 [label="Access variable R|/q|"]; 241 [label="Enter safe call"]; - 242 [label="Function call: $subj$.R|/Q.fdata|()"]; + 242 [label="Function call: $subj$.R|/Q.fdata|()" style="filled" fillcolor=yellow]; 243 [label="Enter safe call"]; - 244 [label="Function call: $subj$.R|/MyData.fs|()"]; + 244 [label="Function call: $subj$.R|/MyData.fs|()" style="filled" fillcolor=yellow]; 245 [label="Enter safe call"]; - 246 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 246 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 247 [label="Exit safe call"]; 248 [label="Exit safe call"]; 249 [label="Exit safe call"]; @@ -674,16 +674,16 @@ digraph nullability_kt { 255 [label="Enter block"]; 256 [label="Access variable R|/q|"]; 257 [label="Smart cast: R|/q|"]; - 258 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 258 [label="Function call: R|/q|.R|/Q.fdata|()" style="filled" fillcolor=yellow]; 259 [label="Access variable R|/q|"]; 260 [label="Smart cast: R|/q|"]; - 261 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 262 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 261 [label="Function call: R|/q|.R|/Q.fdata|()" style="filled" fillcolor=yellow]; + 262 [label="Function call: R|/q|.R|/Q.fdata|().#()" style="filled" fillcolor=yellow]; 263 [label="Access variable R|/q|"]; 264 [label="Smart cast: R|/q|"]; - 265 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 266 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 267 [label="Function call: R|/q|.R|/Q.fdata|().#().R|kotlin/Int.inc|()"]; + 265 [label="Function call: R|/q|.R|/Q.fdata|()" style="filled" fillcolor=yellow]; + 266 [label="Function call: R|/q|.R|/Q.fdata|().#()" style="filled" fillcolor=yellow]; + 267 [label="Function call: R|/q|.R|/Q.fdata|().#().R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 268 [label="Exit block"]; } 269 [label="Exit when branch result"]; @@ -754,7 +754,7 @@ digraph nullability_kt { 283 [label="Enter block"]; 284 [label="Access variable R|/b|"]; 285 [label="Smart cast: R|/b|"]; - 286 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 286 [label="Function call: R|/b|.R|kotlin/Boolean.not|()" style="filled" fillcolor=yellow]; 287 [label="Exit block"]; } 288 [label="Exit when branch result"]; @@ -807,14 +807,14 @@ digraph nullability_kt { 302 [label="Enter block"]; 303 [label="Access variable R|/b|"]; 304 [label="Smart cast: R|/b|"]; - 305 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 305 [label="Function call: R|/b|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 306 [label="Exit block"]; } 307 [label="Exit when branch result"]; 308 [label="Exit when"]; } 309 [label="Access variable R|/b|"]; - 310 [label="Function call: R|/b|.#()"]; + 310 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_66 { color=blue 311 [label="Enter when"]; @@ -833,14 +833,14 @@ digraph nullability_kt { 319 [label="Enter block"]; 320 [label="Access variable R|/b|"]; 321 [label="Smart cast: R|/b|"]; - 322 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 322 [label="Function call: R|/b|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 323 [label="Exit block"]; } 324 [label="Exit when branch result"]; 325 [label="Exit when"]; } 326 [label="Access variable R|/b|"]; - 327 [label="Function call: R|/b|.#()"]; + 327 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_69 { color=blue 328 [label="Enter when"]; @@ -859,14 +859,14 @@ digraph nullability_kt { 336 [label="Enter block"]; 337 [label="Access variable R|/b|"]; 338 [label="Smart cast: R|/b|"]; - 339 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 339 [label="Function call: R|/b|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 340 [label="Exit block"]; } 341 [label="Exit when branch result"]; 342 [label="Exit when"]; } 343 [label="Access variable R|/b|"]; - 344 [label="Function call: R|/b|.#()"]; + 344 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_72 { color=blue 345 [label="Enter when"]; @@ -885,14 +885,14 @@ digraph nullability_kt { 353 [label="Enter block"]; 354 [label="Access variable R|/b|"]; 355 [label="Smart cast: R|/b|"]; - 356 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 356 [label="Function call: R|/b|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 357 [label="Exit block"]; } 358 [label="Exit when branch result"]; 359 [label="Exit when"]; } 360 [label="Access variable R|/b|"]; - 361 [label="Function call: R|/b|.#()"]; + 361 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 362 [label="Exit block"]; } 363 [label="Exit function test_9" style="filled" fillcolor=red]; @@ -992,14 +992,14 @@ digraph nullability_kt { color=blue 374 [label="Enter block"]; 375 [label="Access variable R|/b|"]; - 376 [label="Function call: R|/b|.#()"]; + 376 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 377 [label="Exit block"]; } 378 [label="Exit when branch result"]; 379 [label="Exit when"]; } 380 [label="Access variable R|/b|"]; - 381 [label="Function call: R|/b|.#()"]; + 381 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_80 { color=blue 382 [label="Enter when"]; @@ -1017,14 +1017,14 @@ digraph nullability_kt { color=blue 390 [label="Enter block"]; 391 [label="Access variable R|/b|"]; - 392 [label="Function call: R|/b|.#()"]; + 392 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 393 [label="Exit block"]; } 394 [label="Exit when branch result"]; 395 [label="Exit when"]; } 396 [label="Access variable R|/b|"]; - 397 [label="Function call: R|/b|.#()"]; + 397 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_83 { color=blue 398 [label="Enter when"]; @@ -1042,14 +1042,14 @@ digraph nullability_kt { color=blue 406 [label="Enter block"]; 407 [label="Access variable R|/b|"]; - 408 [label="Function call: R|/b|.#()"]; + 408 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 409 [label="Exit block"]; } 410 [label="Exit when branch result"]; 411 [label="Exit when"]; } 412 [label="Access variable R|/b|"]; - 413 [label="Function call: R|/b|.#()"]; + 413 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; subgraph cluster_86 { color=blue 414 [label="Enter when"]; @@ -1067,14 +1067,14 @@ digraph nullability_kt { color=blue 422 [label="Enter block"]; 423 [label="Access variable R|/b|"]; - 424 [label="Function call: R|/b|.#()"]; + 424 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 425 [label="Exit block"]; } 426 [label="Exit when branch result"]; 427 [label="Exit when"]; } 428 [label="Access variable R|/b|"]; - 429 [label="Function call: R|/b|.#()"]; + 429 [label="Function call: R|/b|.#()" style="filled" fillcolor=yellow]; 430 [label="Exit block"]; } 431 [label="Exit function test_10" style="filled" fillcolor=red]; @@ -1165,7 +1165,7 @@ digraph nullability_kt { 439 [label="Enter safe call"]; 440 [label="Access variable R|/MyData.s|"]; 441 [label="Enter safe call"]; - 442 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 442 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 443 [label="Exit safe call"]; 444 [label="Exit safe call"]; 445 [label="Exit safe call"]; @@ -1192,7 +1192,7 @@ digraph nullability_kt { 463 [label="Access variable R|/QImpl.data|"]; 464 [label="Smart cast: R|/q|.R|/QImpl.data|"]; 465 [label="Access variable R|/MyData.s|"]; - 466 [label="Function call: R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 466 [label="Function call: R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 467 [label="Access variable R|/q2|"]; 468 [label="Access variable R|/QImpl.data|"]; 469 [label="Access variable R|/q2|"]; @@ -1201,7 +1201,7 @@ digraph nullability_kt { 472 [label="Access variable R|/q2|"]; 473 [label="Access variable R|/QImpl.data|"]; 474 [label="Access variable #"]; - 475 [label="Function call: R|/q2|.R|/QImpl.data|.#.R|kotlin/Int.inc|()"]; + 475 [label="Function call: R|/q2|.R|/QImpl.data|.#.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; subgraph cluster_94 { color=blue 476 [label="Enter when"]; @@ -1227,7 +1227,7 @@ digraph nullability_kt { 491 [label="Access variable R|/QImpl.data|"]; 492 [label="Smart cast: R|/q2|.R|/QImpl.data|"]; 493 [label="Access variable R|/MyData.s|"]; - 494 [label="Function call: R|/q2|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 494 [label="Function call: R|/q2|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 495 [label="Exit block"]; } 496 [label="Exit when branch result"]; @@ -1331,7 +1331,7 @@ digraph nullability_kt { 510 [label="Enter safe call"]; 511 [label="Access variable R|/MyData.s|"]; 512 [label="Enter safe call"]; - 513 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 513 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 514 [label="Exit safe call"]; 515 [label="Exit safe call"]; 516 [label="Exit safe call"]; @@ -1358,7 +1358,7 @@ digraph nullability_kt { 534 [label="Access variable R|/QImplWithCustomGetter.data|"]; 535 [label="Smart cast: R|/q|.R|/QImplWithCustomGetter.data|"]; 536 [label="Access variable #"]; - 537 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.#.R|kotlin/Int.inc|()"]; + 537 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.#.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 538 [label="Exit block"]; } 539 [label="Exit when branch result"]; @@ -1426,7 +1426,7 @@ digraph nullability_kt { 550 [label="Enter safe call"]; 551 [label="Access variable R|/MyData.s|"]; 552 [label="Enter safe call"]; - 553 [label="Function call: $subj$.R|kotlin/Int.inc|()"]; + 553 [label="Function call: $subj$.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 554 [label="Exit safe call"]; 555 [label="Exit safe call"]; 556 [label="Exit safe call"]; @@ -1453,7 +1453,7 @@ digraph nullability_kt { 574 [label="Access variable R|/QImplMutable.data|"]; 575 [label="Smart cast: R|/q|.R|/QImplMutable.data|"]; 576 [label="Access variable #"]; - 577 [label="Function call: R|/q|.R|/QImplMutable.data|.#.R|kotlin/Int.inc|()"]; + 577 [label="Function call: R|/q|.R|/QImplMutable.data|.#.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 578 [label="Exit block"]; } 579 [label="Exit when branch result"]; 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 1296cd9b1bf..7d0f4147e01 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.dot @@ -6,7 +6,7 @@ digraph implicitReceivers_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -36,7 +36,7 @@ digraph implicitReceivers_kt { subgraph cluster_4 { color=red 9 [label="Enter function " style="filled" fillcolor=red]; - 10 [label="Delegated constructor call: super()"]; + 10 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 11 [label="Exit function " style="filled" fillcolor=red]; } 9 -> {10}; @@ -103,8 +103,8 @@ digraph implicitReceivers_kt { color=blue 32 [label="Enter block"]; 33 [label="Access variable this@R|/test_1|"]; - 34 [label="Function call: this@R|/test_1|.#()"]; - 35 [label="Function call: #()"]; + 34 [label="Function call: this@R|/test_1|.#()" style="filled" fillcolor=yellow]; + 35 [label="Function call: #()" style="filled" fillcolor=yellow]; 36 [label="Exit block"]; } 37 [label="Exit when branch result"]; @@ -114,16 +114,16 @@ digraph implicitReceivers_kt { 39 [label="Enter block"]; 40 [label="Access variable this@R|/test_1|"]; 41 [label="Smart cast: this@R|/test_1|"]; - 42 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; - 43 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; + 42 [label="Function call: this@R|/test_1|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 43 [label="Function call: this@R|/test_1|.R|/A.foo|()" style="filled" fillcolor=yellow]; 44 [label="Exit block"]; } 45 [label="Exit when branch result"]; 46 [label="Exit when"]; } 47 [label="Access variable this@R|/test_1|"]; - 48 [label="Function call: this@R|/test_1|.#()"]; - 49 [label="Function call: #()"]; + 48 [label="Function call: this@R|/test_1|.#()" style="filled" fillcolor=yellow]; + 49 [label="Function call: #()" style="filled" fillcolor=yellow]; 50 [label="Exit block"]; } 51 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -185,8 +185,8 @@ digraph implicitReceivers_kt { 62 [label="Enter block"]; 63 [label="Access variable this@R|/test_2|"]; 64 [label="Smart cast: this@R|/test_2|"]; - 65 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; - 66 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; + 65 [label="Function call: this@R|/test_2|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 66 [label="Function call: this@R|/test_2|.R|/A.foo|()" style="filled" fillcolor=yellow]; 67 [label="Exit block"]; } 68 [label="Exit when branch result"]; @@ -195,16 +195,16 @@ digraph implicitReceivers_kt { color=blue 70 [label="Enter block"]; 71 [label="Access variable this@R|/test_2|"]; - 72 [label="Function call: this@R|/test_2|.#()"]; - 73 [label="Function call: #()"]; + 72 [label="Function call: this@R|/test_2|.#()" style="filled" fillcolor=yellow]; + 73 [label="Function call: #()" style="filled" fillcolor=yellow]; 74 [label="Exit block"]; } 75 [label="Exit when branch result"]; 76 [label="Exit when"]; } 77 [label="Access variable this@R|/test_2|"]; - 78 [label="Function call: this@R|/test_2|.#()"]; - 79 [label="Function call: #()"]; + 78 [label="Function call: this@R|/test_2|.#()" style="filled" fillcolor=yellow]; + 79 [label="Function call: #()" style="filled" fillcolor=yellow]; 80 [label="Exit block"]; } 81 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -249,96 +249,94 @@ digraph implicitReceivers_kt { 85 [label="Postponed enter to lambda"]; subgraph cluster_26 { color=blue - 91 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 90 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 92 [label="Enter block"]; - 93 [label="Access variable R|/b|"]; - 94 [label="Postponed enter to lambda"]; + 91 [label="Enter block"]; + 92 [label="Access variable R|/b|"]; + 93 [label="Postponed enter to lambda"]; subgraph cluster_28 { color=blue - 99 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 98 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_29 { color=blue - 100 [label="Enter block"]; - 101 [label="Access variable R|/c|"]; - 102 [label="Postponed enter to lambda"]; + 99 [label="Enter block"]; + 100 [label="Access variable R|/c|"]; + 101 [label="Postponed enter to lambda"]; subgraph cluster_30 { color=blue - 112 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 110 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_31 { color=blue - 113 [label="Enter block"]; + 111 [label="Enter block"]; + 112 [label="Access variable this@R|special/anonymous|"]; + 113 [label="Type operator: (this@R|special/anonymous| as R|A|)"]; 114 [label="Access variable this@R|special/anonymous|"]; - 115 [label="Type operator: (this@R|special/anonymous| as R|A|)"]; - 116 [label="Access variable this@R|special/anonymous|"]; - 117 [label="Smart cast: this@R|special/anonymous|"]; - 118 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 119 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 120 [label="Exit block"]; + 115 [label="Smart cast: this@R|special/anonymous|"]; + 116 [label="Function call: this@R|special/anonymous|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 117 [label="Function call: this@R|special/anonymous|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 118 [label="Exit block"]; } - 121 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 119 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 103 [label="Call arguments union" style="filled" fillcolor=yellow]; - 104 [label="Postponed exit from lambda"]; - 105 [label="Function call: R|kotlin/with|(...)"]; - 106 [label="Access variable this@R|special/anonymous|"]; - 107 [label="Smart cast: this@R|special/anonymous|"]; - 108 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 109 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 110 [label="Exit block"]; + 102 [label="Postponed exit from lambda"]; + 103 [label="Function call: R|kotlin/with|(...)" style="filled" fillcolor=yellow]; + 104 [label="Access variable this@R|special/anonymous|"]; + 105 [label="Smart cast: this@R|special/anonymous|"]; + 106 [label="Function call: this@R|special/anonymous|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 107 [label="Function call: this@R|special/anonymous|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 108 [label="Exit block"]; } - 111 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 109 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 95 [label="Postponed exit from lambda"]; - 96 [label="Function call: R|kotlin/with|(...)"]; - 97 [label="Exit block"]; + 94 [label="Postponed exit from lambda"]; + 95 [label="Function call: R|kotlin/with|(...)" style="filled" fillcolor=yellow]; + 96 [label="Exit block"]; } - 98 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 97 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 86 [label="Call arguments union" style="filled" fillcolor=yellow]; - 87 [label="Postponed exit from lambda"]; - 88 [label="Function call: R|kotlin/with|(...)"]; - 89 [label="Exit block"]; + 86 [label="Postponed exit from lambda"]; + 87 [label="Function call: R|kotlin/with|(...)" style="filled" fillcolor=yellow]; + 88 [label="Exit block"]; } - 90 [label="Exit function test_3" style="filled" fillcolor=red]; + 89 [label="Exit function test_3" style="filled" fillcolor=red]; } 82 -> {83}; 83 -> {84}; 84 -> {85}; - 85 -> {91}; - 85 -> {87} [color=red]; - 85 -> {91} [style=dashed]; - 86 -> {88} [color=red]; - 87 -> {88} [color=green]; + 85 -> {90}; + 85 -> {86} [color=red]; + 85 -> {90} [style=dashed]; + 86 -> {87}; + 87 -> {88}; 88 -> {89}; - 89 -> {90}; + 90 -> {91}; 91 -> {92}; 92 -> {93}; - 93 -> {94}; - 94 -> {99}; - 94 -> {95} [color=red]; - 94 -> {99} [style=dashed]; + 93 -> {98}; + 93 -> {94} [color=red]; + 93 -> {98} [style=dashed]; + 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {98}; - 98 -> {86} [color=red]; - 98 -> {87} [color=green]; + 97 -> {87} [color=red]; + 97 -> {86} [color=green]; + 98 -> {99}; 99 -> {100}; 100 -> {101}; - 101 -> {102}; - 102 -> {112}; - 102 -> {104} [color=red]; - 102 -> {112} [style=dashed]; - 103 -> {105} [color=red]; - 104 -> {105} [color=green]; + 101 -> {110}; + 101 -> {102} [color=red]; + 101 -> {110} [style=dashed]; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; 108 -> {109}; - 109 -> {110}; + 109 -> {94} [color=green]; 110 -> {111}; - 111 -> {95} [color=green]; + 111 -> {112}; 112 -> {113}; 113 -> {114}; 114 -> {115}; @@ -346,107 +344,107 @@ digraph implicitReceivers_kt { 116 -> {117}; 117 -> {118}; 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {103} [color=red]; - 121 -> {104} [color=green]; + 119 -> {103} [color=red]; + 119 -> {102} [color=green]; subgraph cluster_32 { color=red - 122 [label="Enter function test_4" style="filled" fillcolor=red]; + 120 [label="Enter function test_4" style="filled" fillcolor=red]; subgraph cluster_33 { color=blue - 123 [label="Enter block"]; + 121 [label="Enter block"]; subgraph cluster_34 { color=blue - 124 [label="Enter when"]; + 122 [label="Enter when"]; subgraph cluster_35 { color=blue - 125 [label="Enter when branch condition "]; - 126 [label="Access variable this@R|/test_4|"]; - 127 [label="Type operator: (this@R|/test_4| !is R|A|)"]; - 128 [label="Exit when branch condition"]; + 123 [label="Enter when branch condition "]; + 124 [label="Access variable this@R|/test_4|"]; + 125 [label="Type operator: (this@R|/test_4| !is R|A|)"]; + 126 [label="Exit when branch condition"]; } subgraph cluster_36 { color=blue - 129 [label="Enter when branch condition "]; - 130 [label="Access variable this@R|/test_4|"]; - 131 [label="Smart cast: this@R|/test_4|"]; - 132 [label="Type operator: (this@R|/test_4| !is R|B|)"]; - 133 [label="Exit when branch condition"]; + 127 [label="Enter when branch condition "]; + 128 [label="Access variable this@R|/test_4|"]; + 129 [label="Smart cast: this@R|/test_4|"]; + 130 [label="Type operator: (this@R|/test_4| !is R|B|)"]; + 131 [label="Exit when branch condition"]; } subgraph cluster_37 { color=blue - 134 [label="Enter when branch condition else"]; - 135 [label="Exit when branch condition"]; + 132 [label="Enter when branch condition else"]; + 133 [label="Exit when branch condition"]; } - 136 [label="Enter when branch result"]; + 134 [label="Enter when branch result"]; subgraph cluster_38 { color=blue - 137 [label="Enter block"]; - 138 [label="Access variable this@R|/test_4|"]; - 139 [label="Smart cast: this@R|/test_4|"]; - 140 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 141 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 142 [label="Access variable this@R|/test_4|"]; - 143 [label="Smart cast: this@R|/test_4|"]; - 144 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; - 145 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; - 146 [label="Exit block"]; + 135 [label="Enter block"]; + 136 [label="Access variable this@R|/test_4|"]; + 137 [label="Smart cast: this@R|/test_4|"]; + 138 [label="Function call: this@R|/test_4|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 139 [label="Function call: this@R|/test_4|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 140 [label="Access variable this@R|/test_4|"]; + 141 [label="Smart cast: this@R|/test_4|"]; + 142 [label="Function call: this@R|/test_4|.R|/B.bar|()" style="filled" fillcolor=yellow]; + 143 [label="Function call: this@R|/test_4|.R|/B.bar|()" style="filled" fillcolor=yellow]; + 144 [label="Exit block"]; } - 147 [label="Exit when branch result"]; - 148 [label="Enter when branch result"]; + 145 [label="Exit when branch result"]; + 146 [label="Enter when branch result"]; subgraph cluster_39 { color=blue - 149 [label="Enter block"]; - 150 [label="Access variable this@R|/test_4|"]; - 151 [label="Smart cast: this@R|/test_4|"]; - 152 [label="Function call: this@R|/test_4|.#()"]; - 153 [label="Function call: #()"]; - 154 [label="Access variable this@R|/test_4|"]; - 155 [label="Smart cast: this@R|/test_4|"]; - 156 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 157 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 158 [label="Exit block"]; + 147 [label="Enter block"]; + 148 [label="Access variable this@R|/test_4|"]; + 149 [label="Smart cast: this@R|/test_4|"]; + 150 [label="Function call: this@R|/test_4|.#()" style="filled" fillcolor=yellow]; + 151 [label="Function call: #()" style="filled" fillcolor=yellow]; + 152 [label="Access variable this@R|/test_4|"]; + 153 [label="Smart cast: this@R|/test_4|"]; + 154 [label="Function call: this@R|/test_4|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 155 [label="Function call: this@R|/test_4|.R|/A.foo|()" style="filled" fillcolor=yellow]; + 156 [label="Exit block"]; } - 159 [label="Exit when branch result"]; - 160 [label="Enter when branch result"]; + 157 [label="Exit when branch result"]; + 158 [label="Enter when branch result"]; subgraph cluster_40 { color=blue - 161 [label="Enter block"]; - 162 [label="Access variable this@R|/test_4|"]; - 163 [label="Function call: this@R|/test_4|.#()"]; - 164 [label="Function call: #()"]; - 165 [label="Access variable this@R|/test_4|"]; - 166 [label="Function call: this@R|/test_4|.#()"]; - 167 [label="Function call: #()"]; - 168 [label="Exit block"]; + 159 [label="Enter block"]; + 160 [label="Access variable this@R|/test_4|"]; + 161 [label="Function call: this@R|/test_4|.#()" style="filled" fillcolor=yellow]; + 162 [label="Function call: #()" style="filled" fillcolor=yellow]; + 163 [label="Access variable this@R|/test_4|"]; + 164 [label="Function call: this@R|/test_4|.#()" style="filled" fillcolor=yellow]; + 165 [label="Function call: #()" style="filled" fillcolor=yellow]; + 166 [label="Exit block"]; } - 169 [label="Exit when branch result"]; - 170 [label="Exit when"]; + 167 [label="Exit when branch result"]; + 168 [label="Exit when"]; } - 171 [label="Access variable this@R|/test_4|"]; - 172 [label="Function call: this@R|/test_4|.#()"]; - 173 [label="Function call: #()"]; - 174 [label="Access variable this@R|/test_4|"]; - 175 [label="Function call: this@R|/test_4|.#()"]; - 176 [label="Function call: #()"]; - 177 [label="Exit block"]; + 169 [label="Access variable this@R|/test_4|"]; + 170 [label="Function call: this@R|/test_4|.#()" style="filled" fillcolor=yellow]; + 171 [label="Function call: #()" style="filled" fillcolor=yellow]; + 172 [label="Access variable this@R|/test_4|"]; + 173 [label="Function call: this@R|/test_4|.#()" style="filled" fillcolor=yellow]; + 174 [label="Function call: #()" style="filled" fillcolor=yellow]; + 175 [label="Exit block"]; } - 178 [label="Exit function test_4" style="filled" fillcolor=red]; + 176 [label="Exit function test_4" style="filled" fillcolor=red]; } + 120 -> {121}; + 121 -> {122}; 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; - 126 -> {127}; + 126 -> {158 127}; 127 -> {128}; - 128 -> {160 129}; + 128 -> {129}; 129 -> {130}; 130 -> {131}; - 131 -> {132}; + 131 -> {146 132}; 132 -> {133}; - 133 -> {148 134}; + 133 -> {134}; 134 -> {135}; 135 -> {136}; 136 -> {137}; @@ -458,9 +456,9 @@ digraph implicitReceivers_kt { 142 -> {143}; 143 -> {144}; 144 -> {145}; - 145 -> {146}; + 145 -> {168}; 146 -> {147}; - 147 -> {170}; + 147 -> {148}; 148 -> {149}; 149 -> {150}; 150 -> {151}; @@ -470,9 +468,9 @@ digraph implicitReceivers_kt { 154 -> {155}; 155 -> {156}; 156 -> {157}; - 157 -> {158}; + 157 -> {168}; 158 -> {159}; - 159 -> {170}; + 159 -> {160}; 160 -> {161}; 161 -> {162}; 162 -> {163}; @@ -489,64 +487,62 @@ digraph implicitReceivers_kt { 173 -> {174}; 174 -> {175}; 175 -> {176}; - 176 -> {177}; - 177 -> {178}; subgraph cluster_41 { color=red - 179 [label="Enter function test_5" style="filled" fillcolor=red]; + 177 [label="Enter function test_5" style="filled" fillcolor=red]; subgraph cluster_42 { color=blue - 180 [label="Enter block"]; + 178 [label="Enter block"]; subgraph cluster_43 { color=blue - 181 [label="Enter when"]; + 179 [label="Enter when"]; subgraph cluster_44 { color=blue - 182 [label="Enter when branch condition "]; - 183 [label="Access variable this@R|/test_5|"]; - 184 [label="Type operator: (this@R|/test_5| is R|kotlin/collections/List<*>|)"]; - 185 [label="Exit when branch condition"]; + 180 [label="Enter when branch condition "]; + 181 [label="Access variable this@R|/test_5|"]; + 182 [label="Type operator: (this@R|/test_5| is R|kotlin/collections/List<*>|)"]; + 183 [label="Exit when branch condition"]; } subgraph cluster_45 { color=blue - 186 [label="Enter when branch condition "]; - 187 [label="Access variable this@R|/test_5|"]; - 188 [label="Type operator: (this@R|/test_5| is R|kotlin/String|)"]; - 189 [label="Exit when branch condition"]; + 184 [label="Enter when branch condition "]; + 185 [label="Access variable this@R|/test_5|"]; + 186 [label="Type operator: (this@R|/test_5| is R|kotlin/String|)"]; + 187 [label="Exit when branch condition"]; } subgraph cluster_46 { color=blue - 190 [label="Enter when branch condition else"]; - 191 [label="Exit when branch condition"]; + 188 [label="Enter when branch condition else"]; + 189 [label="Exit when branch condition"]; } - 192 [label="Enter when branch result"]; + 190 [label="Enter when branch result"]; subgraph cluster_47 { color=blue - 193 [label="Enter block"]; - 194 [label="Const: Int(0)"]; - 195 [label="Exit block"]; + 191 [label="Enter block"]; + 192 [label="Const: Int(0)"]; + 193 [label="Exit block"]; } - 196 [label="Exit when branch result"]; - 197 [label="Enter when branch result"]; + 194 [label="Exit when branch result"]; + 195 [label="Enter when branch result"]; subgraph cluster_48 { color=blue - 198 [label="Enter block"]; - 199 [label="Access variable R|kotlin/String.length|"]; - 200 [label="Exit block"]; + 196 [label="Enter block"]; + 197 [label="Access variable R|kotlin/String.length|"]; + 198 [label="Exit block"]; } - 201 [label="Exit when branch result"]; - 202 [label="Enter when branch result"]; + 199 [label="Exit when branch result"]; + 200 [label="Enter when branch result"]; subgraph cluster_49 { color=blue - 203 [label="Enter block"]; - 204 [label="Access variable R|SubstitutionOverride|"]; - 205 [label="Exit block"]; + 201 [label="Enter block"]; + 202 [label="Access variable R|SubstitutionOverride|"]; + 203 [label="Exit block"]; } - 206 [label="Exit when branch result"]; - 207 [label="Exit when"]; + 204 [label="Exit when branch result"]; + 205 [label="Exit when"]; } - 208 [label="Jump: ^test_5 when () { + 206 [label="Jump: ^test_5 when () { (this@R|/test_5| is R|kotlin/collections/List<*>|) -> { this@R|/test_5|.R|SubstitutionOverride| } @@ -558,62 +554,64 @@ digraph implicitReceivers_kt { } } "]; - 209 [label="Stub" style="filled" fillcolor=gray]; - 210 [label="Exit block" style="filled" fillcolor=gray]; + 207 [label="Stub" style="filled" fillcolor=gray]; + 208 [label="Exit block" style="filled" fillcolor=gray]; } - 211 [label="Exit function test_5" style="filled" fillcolor=red]; + 209 [label="Exit function test_5" style="filled" fillcolor=red]; } + 177 -> {178}; + 178 -> {179}; 179 -> {180}; 180 -> {181}; 181 -> {182}; 182 -> {183}; - 183 -> {184}; + 183 -> {200 184}; 184 -> {185}; - 185 -> {202 186}; + 185 -> {186}; 186 -> {187}; - 187 -> {188}; + 187 -> {195 188}; 188 -> {189}; - 189 -> {197 190}; + 189 -> {190}; 190 -> {191}; 191 -> {192}; 192 -> {193}; 193 -> {194}; - 194 -> {195}; + 194 -> {205}; 195 -> {196}; - 196 -> {207}; + 196 -> {197}; 197 -> {198}; 198 -> {199}; - 199 -> {200}; + 199 -> {205}; 200 -> {201}; - 201 -> {207}; + 201 -> {202}; 202 -> {203}; 203 -> {204}; 204 -> {205}; 205 -> {206}; - 206 -> {207}; - 207 -> {208}; - 208 -> {211}; + 206 -> {209}; + 206 -> {207} [style=dotted]; + 207 -> {208} [style=dotted]; 208 -> {209} [style=dotted]; - 209 -> {210} [style=dotted]; - 210 -> {211} [style=dotted]; subgraph cluster_50 { color=red - 212 [label="Enter function test_6" style="filled" fillcolor=red]; + 210 [label="Enter function test_6" style="filled" fillcolor=red]; subgraph cluster_51 { color=blue - 213 [label="Enter block"]; - 214 [label="Access variable this@R|/test_6|"]; - 215 [label="Type operator: (this@R|/test_6| as R|kotlin/collections/List<*>|)"]; - 216 [label="Access variable R|SubstitutionOverride|"]; - 217 [label="Access variable this@R|/test_6|"]; - 218 [label="Smart cast: this@R|/test_6|"]; - 219 [label="Type operator: (this@R|/test_6| as R|kotlin/String|)"]; - 220 [label="Access variable R|kotlin/String.length|"]; - 221 [label="Exit block"]; + 211 [label="Enter block"]; + 212 [label="Access variable this@R|/test_6|"]; + 213 [label="Type operator: (this@R|/test_6| as R|kotlin/collections/List<*>|)"]; + 214 [label="Access variable R|SubstitutionOverride|"]; + 215 [label="Access variable this@R|/test_6|"]; + 216 [label="Smart cast: this@R|/test_6|"]; + 217 [label="Type operator: (this@R|/test_6| as R|kotlin/String|)"]; + 218 [label="Access variable R|kotlin/String.length|"]; + 219 [label="Exit block"]; } - 222 [label="Exit function test_6" style="filled" fillcolor=red]; + 220 [label="Exit function test_6" style="filled" fillcolor=red]; } + 210 -> {211}; + 211 -> {212}; 212 -> {213}; 213 -> {214}; 214 -> {215}; @@ -622,7 +620,5 @@ digraph implicitReceivers_kt { 217 -> {218}; 218 -> {219}; 219 -> {220}; - 220 -> {221}; - 221 -> {222}; } 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 6e223209dad..af64df63c7f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.dot @@ -6,7 +6,7 @@ digraph assignSafeCall_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -97,7 +97,7 @@ digraph assignSafeCall_kt { 35 [label="Enter block"]; 36 [label="Access variable R|/a|"]; 37 [label="Smart cast: R|/a|"]; - 38 [label="Function call: R|/a|.R|/A.bar|()"]; + 38 [label="Function call: R|/a|.R|/A.bar|()" style="filled" fillcolor=yellow]; 39 [label="Exit block"]; } 40 [label="Exit when branch result"]; @@ -139,7 +139,7 @@ digraph assignSafeCall_kt { 45 [label="Enter block"]; 46 [label="Access variable R|/a|"]; 47 [label="Enter safe call"]; - 48 [label="Function call: $subj$.R|/A.foo|()"]; + 48 [label="Function call: $subj$.R|/A.foo|()" style="filled" fillcolor=yellow]; 49 [label="Exit safe call"]; 50 [label="Variable declaration: lval x: R|kotlin/Int?|"]; subgraph cluster_14 { @@ -160,7 +160,7 @@ digraph assignSafeCall_kt { 59 [label="Enter block"]; 60 [label="Access variable R|/a|"]; 61 [label="Smart cast: R|/a|"]; - 62 [label="Function call: R|/a|.R|/A.bar|()"]; + 62 [label="Function call: R|/a|.R|/A.bar|()" style="filled" fillcolor=yellow]; 63 [label="Exit block"]; } 64 [label="Exit when branch result"]; @@ -210,10 +210,10 @@ digraph assignSafeCall_kt { 77 [label="Exit ?:"]; 78 [label="Variable declaration: lval a: R|A|"]; 79 [label="Access variable R|/a|"]; - 80 [label="Function call: R|/a|.R|/A.foo|()"]; + 80 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 81 [label="Access variable R|/x|"]; 82 [label="Smart cast: R|/x|"]; - 83 [label="Function call: R|/x|.R|/A.foo|()"]; + 83 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=yellow]; 84 [label="Exit block"]; } 85 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -287,7 +287,7 @@ digraph assignSafeCall_kt { 107 [label="Enter block"]; 108 [label="Access variable R|/a|"]; 109 [label="Smart cast: R|/a|"]; - 110 [label="Function call: R|/a|.R|/B.bar|()"]; + 110 [label="Function call: R|/a|.R|/B.bar|()" style="filled" fillcolor=yellow]; 111 [label="Exit block"]; } 112 [label="Exit when branch result"]; @@ -329,7 +329,7 @@ digraph assignSafeCall_kt { 117 [label="Enter block"]; 118 [label="Access variable R|/a|"]; 119 [label="Enter safe call"]; - 120 [label="Function call: $subj$.R|/B.foo|()"]; + 120 [label="Function call: $subj$.R|/B.foo|()" style="filled" fillcolor=yellow]; 121 [label="Exit safe call"]; 122 [label="Variable declaration: lval x: R|kotlin/Int?|"]; subgraph cluster_29 { @@ -350,7 +350,7 @@ digraph assignSafeCall_kt { 131 [label="Enter block"]; 132 [label="Access variable R|/a|"]; 133 [label="Smart cast: R|/a|"]; - 134 [label="Function call: R|/a|.R|/B.bar|()"]; + 134 [label="Function call: R|/a|.R|/B.bar|()" style="filled" fillcolor=yellow]; 135 [label="Exit block"]; } 136 [label="Exit when branch result"]; @@ -400,10 +400,10 @@ digraph assignSafeCall_kt { 149 [label="Exit ?:"]; 150 [label="Variable declaration: lval a: R|B|"]; 151 [label="Access variable R|/a|"]; - 152 [label="Function call: R|/a|.R|/B.foo|()"]; + 152 [label="Function call: R|/a|.R|/B.foo|()" style="filled" fillcolor=yellow]; 153 [label="Access variable R|/x|"]; 154 [label="Smart cast: R|/x|"]; - 155 [label="Function call: R|/x|.R|/B.foo|()"]; + 155 [label="Function call: R|/x|.R|/B.foo|()" style="filled" fillcolor=yellow]; 156 [label="Exit block"]; } 157 [label="Exit function test_3" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot index b456db5865d..119f4493640 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot @@ -38,7 +38,7 @@ digraph safeCallAndEqualityToBool_kt { 10 [label="Enter when branch condition "]; 11 [label="Access variable R|/s|"]; 12 [label="Enter safe call"]; - 13 [label="Function call: $subj$.R|/check|()"]; + 13 [label="Function call: $subj$.R|/check|()" style="filled" fillcolor=yellow]; 14 [label="Exit safe call"]; 15 [label="Const: Boolean(true)"]; 16 [label="Equality operator =="]; @@ -117,7 +117,7 @@ digraph safeCallAndEqualityToBool_kt { 39 [label="Enter when branch condition "]; 40 [label="Access variable R|/s|"]; 41 [label="Enter safe call"]; - 42 [label="Function call: $subj$.R|/check|()"]; + 42 [label="Function call: $subj$.R|/check|()" style="filled" fillcolor=yellow]; 43 [label="Exit safe call"]; 44 [label="Const: Boolean(false)"]; 45 [label="Equality operator =="]; @@ -196,7 +196,7 @@ digraph safeCallAndEqualityToBool_kt { 68 [label="Enter when branch condition "]; 69 [label="Access variable R|/s|"]; 70 [label="Enter safe call"]; - 71 [label="Function call: $subj$.R|/check|()"]; + 71 [label="Function call: $subj$.R|/check|()" style="filled" fillcolor=yellow]; 72 [label="Exit safe call"]; 73 [label="Const: Boolean(true)"]; 74 [label="Equality operator !="]; @@ -275,7 +275,7 @@ digraph safeCallAndEqualityToBool_kt { 97 [label="Enter when branch condition "]; 98 [label="Access variable R|/s|"]; 99 [label="Enter safe call"]; - 100 [label="Function call: $subj$.R|/check|()"]; + 100 [label="Function call: $subj$.R|/check|()" style="filled" fillcolor=yellow]; 101 [label="Exit safe call"]; 102 [label="Const: Boolean(false)"]; 103 [label="Equality operator !="]; 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 aa684ef8c9e..081933606b0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot @@ -51,7 +51,7 @@ digraph safeCalls_kt { 17 [label="Access variable R|kotlin/String.length|"]; 18 [label="Const: Int(1)"]; 19 [label="Equality operator =="]; - 20 [label="Function call: $subj$.R|/foo|(...)"]; + 20 [label="Function call: $subj$.R|/foo|(...)" style="filled" fillcolor=yellow]; 21 [label="Exit safe call"]; 22 [label="Access variable R|/x|"]; 23 [label="Access variable #"]; @@ -113,7 +113,7 @@ digraph safeCalls_kt { 38 [label="Enter safe call"]; 39 [label="Access variable R|/x|"]; 40 [label="Smart cast: R|/x|"]; - 41 [label="Function call: $subj$.R|/A.bar|(...)"]; + 41 [label="Function call: $subj$.R|/A.bar|(...)" style="filled" fillcolor=yellow]; 42 [label="Exit safe call"]; 43 [label="Exit block"]; } @@ -141,12 +141,12 @@ digraph safeCalls_kt { 49 [label="Enter safe call"]; 50 [label="Access variable R|/x|"]; 51 [label="Smart cast: R|/x|"]; - 52 [label="Function call: $subj$.R|/A.bar|(...)"]; + 52 [label="Function call: $subj$.R|/A.bar|(...)" style="filled" fillcolor=yellow]; 53 [label="Enter safe call"]; 54 [label="Access variable R|/x|"]; 55 [label="Smart cast: R|/x|"]; - 56 [label="Function call: R|/x|.R|/A.bool|()"]; - 57 [label="Function call: $subj$.R|/foo|(...)"]; + 56 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=yellow]; + 57 [label="Function call: $subj$.R|/foo|(...)" style="filled" fillcolor=yellow]; 58 [label="Enter safe call"]; 59 [label="Postponed enter to lambda"]; subgraph cluster_14 { @@ -157,18 +157,18 @@ digraph safeCalls_kt { 70 [label="Enter block"]; 71 [label="Access variable R|/x|"]; 72 [label="Smart cast: R|/x|"]; - 73 [label="Function call: R|/x|.R|/A.bool|()"]; + 73 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=yellow]; 74 [label="Exit block"]; } 75 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 60 [label="Postponed exit from lambda"]; - 61 [label="Function call: $subj$.R|/let|(...)"]; + 61 [label="Function call: $subj$.R|/let|(...)" style="filled" fillcolor=yellow]; 62 [label="Exit safe call"]; 63 [label="Exit safe call"]; 64 [label="Exit safe call"]; 65 [label="Access variable R|/x|"]; - 66 [label="Function call: R|/x|.#()"]; + 66 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 67 [label="Exit block"]; } 68 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -212,13 +212,13 @@ digraph safeCalls_kt { 77 [label="Enter block"]; 78 [label="Access variable R|/x|"]; 79 [label="Enter safe call"]; - 80 [label="Function call: $subj$.R|/A.id|()"]; + 80 [label="Function call: $subj$.R|/A.id|()" style="filled" fillcolor=yellow]; 81 [label="Enter safe call"]; - 82 [label="Function call: $subj$.R|/A.bool|()"]; + 82 [label="Function call: $subj$.R|/A.bool|()" style="filled" fillcolor=yellow]; 83 [label="Exit safe call"]; 84 [label="Exit safe call"]; 85 [label="Access variable R|/x|"]; - 86 [label="Function call: R|/x|.#()"]; + 86 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; 87 [label="Exit block"]; } 88 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -261,61 +261,59 @@ digraph safeCalls_kt { 97 [label="Postponed enter to lambda"]; subgraph cluster_22 { color=blue - 113 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 112 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 114 [label="Enter block"]; - 115 [label="Jump: ^test_5 Unit"]; - 116 [label="Stub" style="filled" fillcolor=gray]; - 117 [label="Exit block" style="filled" fillcolor=gray]; + 113 [label="Enter block"]; + 114 [label="Jump: ^test_5 Unit"]; + 115 [label="Stub" style="filled" fillcolor=gray]; + 116 [label="Exit block" style="filled" fillcolor=gray]; } - 118 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 117 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray]; } - 98 [label="Call arguments union" style="filled" fillcolor=gray]; - 99 [label="Postponed exit from lambda" style="filled" fillcolor=gray]; - 100 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=gray]; - 101 [label="Stub" style="filled" fillcolor=gray]; - 102 [label="Enter safe call" style="filled" fillcolor=gray]; - 103 [label="Access variable R|/x|" style="filled" fillcolor=gray]; - 104 [label="Smart cast: R|/x|" style="filled" fillcolor=gray]; - 105 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=gray]; - 106 [label="Function call: $subj$.R|/boo|(...)" style="filled" fillcolor=gray]; + 98 [label="Postponed exit from lambda" style="filled" fillcolor=gray]; + 99 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=gray]; + 100 [label="Stub" style="filled" fillcolor=gray]; + 101 [label="Enter safe call" style="filled" fillcolor=gray]; + 102 [label="Access variable R|/x|" style="filled" fillcolor=gray]; + 103 [label="Smart cast: R|/x|" style="filled" fillcolor=gray]; + 104 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=gray]; + 105 [label="Function call: $subj$.R|/boo|(...)" style="filled" fillcolor=gray]; + 106 [label="Exit safe call"]; 107 [label="Exit safe call"]; - 108 [label="Exit safe call"]; - 109 [label="Access variable R|/x|"]; - 110 [label="Function call: R|/x|.#()"]; - 111 [label="Exit block"]; + 108 [label="Access variable R|/x|"]; + 109 [label="Function call: R|/x|.#()" style="filled" fillcolor=yellow]; + 110 [label="Exit block"]; } - 112 [label="Exit function test_5" style="filled" fillcolor=red]; + 111 [label="Exit function test_5" style="filled" fillcolor=red]; } 93 -> {94}; 94 -> {95}; - 95 -> {96 107}; + 95 -> {96 106}; 96 -> {97}; - 97 -> {113}; - 97 -> {99} [color=red]; - 97 -> {113} [style=dashed]; - 98 -> {100} [style=dotted]; + 97 -> {112}; + 97 -> {98} [color=red]; + 97 -> {112} [style=dashed]; + 98 -> {99} [style=dotted]; 99 -> {100} [style=dotted]; - 100 -> {101} [style=dotted]; - 100 -> {112} [style=dotted] [label=onUncaughtException]; - 101 -> {107 102} [style=dotted]; + 99 -> {111} [style=dotted] [label=onUncaughtException]; + 100 -> {106 101} [style=dotted]; + 101 -> {102} [style=dotted]; 102 -> {103} [style=dotted]; 103 -> {104} [style=dotted]; 104 -> {105} [style=dotted]; - 105 -> {106} [style=dotted]; - 106 -> {108} [style=dotted]; + 105 -> {107} [style=dotted]; + 106 -> {107}; 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; - 111 -> {112}; + 112 -> {113}; 113 -> {114}; - 114 -> {115}; - 115 -> {112}; + 114 -> {111}; + 114 -> {115} [style=dotted]; 115 -> {116} [style=dotted]; 116 -> {117} [style=dotted]; - 117 -> {118} [style=dotted]; - 118 -> {99 98} [style=dotted]; + 117 -> {98 99} [style=dotted]; } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot index 59c8ca52585..b0fc911d09c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.dot @@ -30,7 +30,7 @@ digraph smartCastInInit_kt { subgraph cluster_4 { color=blue 7 [label="Enter block"]; - 8 [label="Function call: R|kotlin/TODO|()"]; + 8 [label="Function call: R|kotlin/TODO|()" style="filled" fillcolor=yellow]; 9 [label="Stub" style="filled" fillcolor=gray]; 10 [label="Jump: ^s R|kotlin/TODO|()" style="filled" fillcolor=gray]; 11 [label="Stub" style="filled" fillcolor=gray]; @@ -50,7 +50,7 @@ digraph smartCastInInit_kt { subgraph cluster_5 { color=red 14 [label="Enter function " style="filled" fillcolor=red]; - 15 [label="Delegated constructor call: super()"]; + 15 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 16 [label="Exit function " style="filled" fillcolor=red]; } 14 -> {15}; @@ -62,11 +62,11 @@ digraph smartCastInInit_kt { subgraph cluster_7 { color=blue 18 [label="Enter block"]; - 19 [label="Function call: R|/s|()"]; + 19 [label="Function call: R|/s|()" style="filled" fillcolor=yellow]; 20 [label="Assignment: R|/Main.x|"]; 21 [label="Access variable R|/Main.x|"]; 22 [label="Smart cast: this@R|/Main|.R|/Main.x|"]; - 23 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()"]; + 23 [label="Function call: this@R|/Main|.R|/Main.x|.R|/S.foo|()" style="filled" fillcolor=yellow]; 24 [label="Exit block"]; } 25 [label="Exit init block" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot index 611fc675245..41c6b03842b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot @@ -6,7 +6,7 @@ digraph smartcastInByClause_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -57,7 +57,7 @@ digraph smartcastInByClause_kt { subgraph cluster_5 { color=red 15 [label="Enter function " style="filled" fillcolor=red]; - 16 [label="Delegated constructor call: super()"]; + 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 17 [label="Exit function " style="filled" fillcolor=red]; } 15 -> {16}; @@ -105,7 +105,7 @@ digraph smartcastInByClause_kt { 38 [label="Access variable R|/a|"]; 39 [label="Smart cast: R|/a|"]; 40 [label="Access variable R|/A.index|"]; - 41 [label="Function call: R|/takeInt|(...)"]; + 41 [label="Function call: R|/takeInt|(...)" style="filled" fillcolor=yellow]; 42 [label="Enter anonymous object"]; subgraph cluster_10 { color=blue @@ -180,7 +180,7 @@ digraph smartcastInByClause_kt { subgraph cluster_11 { color=red 53 [label="Enter function " style="filled" fillcolor=red]; - 54 [label="Delegated constructor call: super()"]; + 54 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 55 [label="Exit function " style="filled" fillcolor=red]; } 53 -> {54}; @@ -192,7 +192,7 @@ digraph smartcastInByClause_kt { 57 [label="Access variable R|/a|"]; 58 [label="Smart cast: R|/a|"]; 59 [label="Access variable R|/A.index|"]; - 60 [label="Function call: R|/Derived.Derived|(...)"]; + 60 [label="Function call: R|/Derived.Derived|(...)" style="filled" fillcolor=yellow]; 61 [label="Exit field" style="filled" fillcolor=red]; } 56 -> {57}; @@ -225,7 +225,7 @@ digraph smartcastInByClause_kt { 69 [label="Access variable R|/a|"]; 70 [label="Smart cast: R|/a|"]; 71 [label="Access variable R|/A.index|"]; - 72 [label="Function call: R|/takeInt|(...)"]; + 72 [label="Function call: R|/takeInt|(...)" style="filled" fillcolor=yellow]; 73 [label="Exit block"]; } 74 [label="Exit function foo" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot index 1bed78a8558..155414e7984 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.dot @@ -9,7 +9,7 @@ digraph smartcastToNothing_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|java/lang/Exception.Exception|()"]; + 2 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow]; 3 [label="Throw: throw R|java/lang/Exception.Exception|()"]; 4 [label="Stub" style="filled" fillcolor=gray]; 5 [label="Jump: ^getNothing throw R|java/lang/Exception.Exception|()" style="filled" fillcolor=gray]; @@ -98,7 +98,7 @@ digraph smartcastToNothing_kt { color=blue 31 [label="Enter block"]; 32 [label="Const: Null(null)"]; - 33 [label="Check not null: Null(null)!!"]; + 33 [label="Check not null: Null(null)!!" style="filled" fillcolor=yellow]; 34 [label="Stub" style="filled" fillcolor=gray]; 35 [label="Jump: ^myListOf Null(null)!!" style="filled" fillcolor=gray]; 36 [label="Stub" style="filled" fillcolor=gray]; @@ -119,7 +119,7 @@ digraph smartcastToNothing_kt { subgraph cluster_10 { color=red 39 [label="Enter function " style="filled" fillcolor=red]; - 40 [label="Delegated constructor call: super()"]; + 40 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 41 [label="Exit function " style="filled" fillcolor=red]; } 39 -> {40}; @@ -172,7 +172,7 @@ digraph smartcastToNothing_kt { color=blue 56 [label="Enter block"]; 57 [label="Access variable R|/results|"]; - 58 [label="Function call: R|/results|.R|SubstitutionOverride|>|()"]; + 58 [label="Function call: R|/results|.R|SubstitutionOverride|>|()" style="filled" fillcolor=yellow]; 59 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; subgraph cluster_17 { color=blue @@ -181,7 +181,7 @@ digraph smartcastToNothing_kt { color=blue 61 [label="Enter loop condition"]; 62 [label="Access variable R|/|"]; - 63 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 63 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 64 [label="Exit loop condition"]; } subgraph cluster_19 { @@ -191,7 +191,7 @@ digraph smartcastToNothing_kt { color=blue 66 [label="Enter block"]; 67 [label="Access variable R|/|"]; - 68 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 68 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 69 [label="Stub" style="filled" fillcolor=gray]; 70 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray]; 71 [label="Access variable R|/result|" style="filled" fillcolor=gray]; @@ -233,23 +233,22 @@ digraph smartcastToNothing_kt { 94 [label="Postponed enter to lambda"]; subgraph cluster_24 { color=blue - 101 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 100 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 102 [label="Enter block"]; - 103 [label="Access variable R|/it|"]; - 104 [label="Access variable R|/A.a|"]; - 105 [label="Exit block"]; + 101 [label="Enter block"]; + 102 [label="Access variable R|/it|"]; + 103 [label="Access variable R|/A.a|"]; + 104 [label="Exit block"]; } - 106 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 105 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 95 [label="Call arguments union" style="filled" fillcolor=yellow]; - 96 [label="Postponed exit from lambda"]; - 97 [label="Function call: $subj$.R|kotlin/let|(...)"]; - 98 [label="Exit safe call"]; - 99 [label="Exit block"]; + 95 [label="Postponed exit from lambda"]; + 96 [label="Function call: $subj$.R|kotlin/let|(...)" style="filled" fillcolor=yellow]; + 97 [label="Exit safe call"]; + 98 [label="Exit block"]; } - 100 [label="Exit function test_0" style="filled" fillcolor=red]; + 99 [label="Exit function test_0" style="filled" fillcolor=red]; } 52 -> {53}; 53 -> {54}; @@ -267,18 +266,18 @@ digraph smartcastToNothing_kt { 65 -> {66}; 66 -> {67}; 67 -> {68}; - 68 -> {100} [label=onUncaughtException]; + 68 -> {99} [label=onUncaughtException]; 68 -> {69} [style=dotted]; 69 -> {70} [style=dotted]; 70 -> {71} [style=dotted]; 71 -> {72} [style=dotted]; - 71 -> {100} [style=dotted] [label=onUncaughtException]; + 71 -> {99} [style=dotted] [label=onUncaughtException]; 72 -> {73} [style=dotted]; 73 -> {74} [style=dotted]; 74 -> {75} [style=dotted]; 75 -> {76} [style=dotted]; 76 -> {77} [style=dotted]; - 76 -> {100} [style=dotted] [label=onUncaughtException]; + 76 -> {99} [style=dotted] [label=onUncaughtException]; 77 -> {78} [style=dotted]; 78 -> {79} [style=dotted]; 79 -> {81 80} [style=dotted]; @@ -294,97 +293,97 @@ digraph smartcastToNothing_kt { 89 -> {61} [color=green style=dotted]; 90 -> {91}; 91 -> {92}; - 92 -> {93 98}; + 92 -> {93 97}; 93 -> {94}; - 94 -> {101}; - 94 -> {96} [color=red]; - 94 -> {101} [style=dashed]; - 95 -> {97} [color=red]; - 96 -> {97} [color=green]; + 94 -> {100}; + 94 -> {95} [color=red]; + 94 -> {100} [style=dashed]; + 95 -> {96}; + 96 -> {97}; 97 -> {98}; 98 -> {99}; - 99 -> {100}; + 100 -> {101}; 101 -> {102}; 102 -> {103}; 103 -> {104}; 104 -> {105}; - 105 -> {106}; - 106 -> {95} [color=red]; - 106 -> {96} [color=green]; + 105 -> {96} [color=red]; + 105 -> {95} [color=green]; subgraph cluster_26 { color=red - 107 [label="Enter function test_1" style="filled" fillcolor=red]; + 106 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 108 [label="Enter block"]; + 107 [label="Enter block"]; subgraph cluster_28 { color=blue - 109 [label="Enter when"]; + 108 [label="Enter when"]; subgraph cluster_29 { color=blue - 110 [label="Enter when branch condition "]; - 111 [label="Access variable R|/a|"]; - 112 [label="Type operator: (R|/a| is R|kotlin/Nothing?|)"]; - 113 [label="Exit when branch condition"]; + 109 [label="Enter when branch condition "]; + 110 [label="Access variable R|/a|"]; + 111 [label="Type operator: (R|/a| is R|kotlin/Nothing?|)"]; + 112 [label="Exit when branch condition"]; } - 114 [label="Synthetic else branch"]; - 115 [label="Enter when branch result"]; + 113 [label="Synthetic else branch"]; + 114 [label="Enter when branch result"]; subgraph cluster_30 { color=blue - 116 [label="Enter block"]; - 117 [label="Access variable R|/a|"]; - 118 [label="Smart cast: R|/a|"]; - 119 [label="Enter safe call"]; - 120 [label="Access variable R|kotlin/String.length|"]; - 121 [label="Exit safe call"]; - 122 [label="Variable declaration: lval b: R|kotlin/Int?|"]; - 123 [label="Exit block"]; + 115 [label="Enter block"]; + 116 [label="Access variable R|/a|"]; + 117 [label="Smart cast: R|/a|"]; + 118 [label="Enter safe call"]; + 119 [label="Access variable R|kotlin/String.length|"]; + 120 [label="Exit safe call"]; + 121 [label="Variable declaration: lval b: R|kotlin/Int?|"]; + 122 [label="Exit block"]; } - 124 [label="Exit when branch result"]; - 125 [label="Exit when"]; + 123 [label="Exit when branch result"]; + 124 [label="Exit when"]; } subgraph cluster_31 { color=blue - 126 [label="Enter when"]; + 125 [label="Enter when"]; subgraph cluster_32 { color=blue - 127 [label="Enter when branch condition "]; - 128 [label="Access variable R|/a|"]; - 129 [label="Type operator: (R|/a| is R|kotlin/Nothing|)"]; - 130 [label="Exit when branch condition"]; + 126 [label="Enter when branch condition "]; + 127 [label="Access variable R|/a|"]; + 128 [label="Type operator: (R|/a| is R|kotlin/Nothing|)"]; + 129 [label="Exit when branch condition"]; } - 131 [label="Synthetic else branch"]; - 132 [label="Enter when branch result"]; + 130 [label="Synthetic else branch"]; + 131 [label="Enter when branch result"]; subgraph cluster_33 { color=blue - 133 [label="Enter block"]; - 134 [label="Access variable R|/a|"]; - 135 [label="Smart cast: R|/a|"]; - 136 [label="Stub" style="filled" fillcolor=gray]; - 137 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; - 138 [label="Variable declaration: lval b: R|kotlin/Int|" style="filled" fillcolor=gray]; - 139 [label="Exit block" style="filled" fillcolor=gray]; + 132 [label="Enter block"]; + 133 [label="Access variable R|/a|"]; + 134 [label="Smart cast: R|/a|"]; + 135 [label="Stub" style="filled" fillcolor=gray]; + 136 [label="Access variable R|kotlin/String.length|" style="filled" fillcolor=gray]; + 137 [label="Variable declaration: lval b: R|kotlin/Int|" style="filled" fillcolor=gray]; + 138 [label="Exit block" style="filled" fillcolor=gray]; } - 140 [label="Exit when branch result" style="filled" fillcolor=gray]; - 141 [label="Exit when"]; + 139 [label="Exit when branch result" style="filled" fillcolor=gray]; + 140 [label="Exit when"]; } - 142 [label="Exit block"]; + 141 [label="Exit block"]; } - 143 [label="Exit function test_1" style="filled" fillcolor=red]; + 142 [label="Exit function test_1" style="filled" fillcolor=red]; } + 106 -> {107}; 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; 111 -> {112}; - 112 -> {113}; - 113 -> {115 114}; - 114 -> {125}; + 112 -> {114 113}; + 113 -> {124}; + 114 -> {115}; 115 -> {116}; 116 -> {117}; - 117 -> {118}; - 118 -> {119 121}; + 117 -> {118 120}; + 118 -> {119}; 119 -> {120}; 120 -> {121}; 121 -> {122}; @@ -395,20 +394,19 @@ digraph smartcastToNothing_kt { 126 -> {127}; 127 -> {128}; 128 -> {129}; - 129 -> {130}; - 130 -> {132 131}; - 131 -> {141}; + 129 -> {131 130}; + 130 -> {140}; + 131 -> {132}; 132 -> {133}; 133 -> {134}; - 134 -> {135}; - 135 -> {143} [label=onUncaughtException]; + 134 -> {142} [label=onUncaughtException]; + 134 -> {135} [style=dotted]; 135 -> {136} [style=dotted]; 136 -> {137} [style=dotted]; 137 -> {138} [style=dotted]; 138 -> {139} [style=dotted]; 139 -> {140} [style=dotted]; - 140 -> {141} [style=dotted]; + 140 -> {141}; 141 -> {142}; - 142 -> {143}; } 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 6784b2ea942..8adc3b95003 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.dot @@ -6,7 +6,7 @@ digraph overridenOpenVal_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -37,7 +37,7 @@ digraph overridenOpenVal_kt { color=red 9 [label="Enter function " style="filled" fillcolor=red]; 10 [label="Access variable R|/x|"]; - 11 [label="Delegated constructor call: super(...)"]; + 11 [label="Delegated constructor call: super(...)" style="filled" fillcolor=yellow]; 12 [label="Exit function " style="filled" fillcolor=red]; } 9 -> {10}; 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 77fec0a0a3b..a3027a33494 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot @@ -6,7 +6,7 @@ digraph delayedAssignment_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -67,18 +67,18 @@ digraph delayedAssignment_kt { subgraph cluster_10 { color=blue 25 [label="Enter block"]; - 26 [label="Function call: R|/A.A|()"]; + 26 [label="Function call: R|/A.A|()" style="filled" fillcolor=yellow]; 27 [label="Assignment: R|/a|"]; 28 [label="Access variable R|/a|"]; 29 [label="Smart cast: R|/a|"]; - 30 [label="Function call: R|/a|.R|/A.foo|()"]; + 30 [label="Function call: R|/a|.R|/A.foo|()" style="filled" fillcolor=yellow]; 31 [label="Exit block"]; } 32 [label="Exit when branch result"]; 33 [label="Exit when"]; } 34 [label="Access variable R|/a|"]; - 35 [label="Function call: R|/a|.#()"]; + 35 [label="Function call: R|/a|.#()" style="filled" fillcolor=yellow]; 36 [label="Exit block"]; } 37 [label="Exit function test" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/complexPostponedCfg.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/complexPostponedCfg.dot index 487f64699e1..5b02de8a1f6 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/complexPostponedCfg.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/complexPostponedCfg.dot @@ -24,119 +24,115 @@ digraph complexPostponedCfg_kt { color=blue 5 [label="Enter block"]; 6 [label="Access variable R|/statements|"]; - 7 [label="Function call: R|/statements|.R|kotlin/collections/last|()"]; + 7 [label="Function call: R|/statements|.R|kotlin/collections/last|()" style="filled" fillcolor=yellow]; 8 [label="Type operator: (R|/statements|.R|kotlin/collections/last|() as R|FirFunctionCall|)"]; 9 [label="Postponed enter to lambda"]; subgraph cluster_4 { color=blue - 19 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 18 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 20 [label="Enter block"]; - 21 [label="Postponed enter to lambda"]; + 19 [label="Enter block"]; + 20 [label="Postponed enter to lambda"]; subgraph cluster_6 { color=blue - 26 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 25 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_7 { color=blue - 27 [label="Enter block"]; - 28 [label="Access variable this@R|special/anonymous|"]; - 29 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)"]; - 30 [label="Access variable R|/arguments|"]; - 31 [label="Function call: R|/arguments|.R|kotlin/collections/last|()"]; - 32 [label="Type operator: (R|/arguments|.R|kotlin/collections/last|() as R|FirFunctionCall|)"]; - 33 [label="Postponed enter to lambda"]; + 26 [label="Enter block"]; + 27 [label="Access variable this@R|special/anonymous|"]; + 28 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; + 29 [label="Access variable R|/arguments|"]; + 30 [label="Function call: R|/arguments|.R|kotlin/collections/last|()" style="filled" fillcolor=yellow]; + 31 [label="Type operator: (R|/arguments|.R|kotlin/collections/last|() as R|FirFunctionCall|)"]; + 32 [label="Postponed enter to lambda"]; subgraph cluster_8 { color=blue - 39 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 37 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 40 [label="Enter block"]; - 41 [label="Access variable this@R|special/anonymous|"]; - 42 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)"]; - 43 [label="Access variable R|/explicitReceiver|"]; - 44 [label="Type operator: (R|/explicitReceiver| as R|FirFunctionCall|)"]; - 45 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)"]; - 46 [label="Exit block"]; + 38 [label="Enter block"]; + 39 [label="Access variable this@R|special/anonymous|"]; + 40 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; + 41 [label="Access variable R|/explicitReceiver|"]; + 42 [label="Type operator: (R|/explicitReceiver| as R|FirFunctionCall|)"]; + 43 [label="Function call: this@R|special/anonymous|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; + 44 [label="Exit block"]; } - 47 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 45 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 34 [label="Call arguments union" style="filled" fillcolor=yellow]; - 35 [label="Postponed exit from lambda"]; - 36 [label="Function call: R|kotlin/with|(...)"]; - 37 [label="Exit block"]; + 33 [label="Postponed exit from lambda"]; + 34 [label="Function call: R|kotlin/with|(...)" style="filled" fillcolor=yellow]; + 35 [label="Exit block"]; } - 38 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 36 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 22 [label="Postponed exit from lambda"]; - 23 [label="Function call: R|kotlin/collections/buildList|(...)"]; - 24 [label="Exit block"]; + 21 [label="Postponed exit from lambda"]; + 22 [label="Function call: R|kotlin/collections/buildList|(...)" style="filled" fillcolor=yellow]; + 23 [label="Exit block"]; } - 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 24 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 10 [label="Call arguments union" style="filled" fillcolor=yellow]; - 11 [label="Postponed exit from lambda"]; - 12 [label="Function call: R|kotlin/with||>(...)"]; - 13 [label="Variable declaration: lval firstCalls: R|kotlin/collections/List|"]; - 14 [label="Access variable R|/firstCalls|"]; - 15 [label="Jump: ^foo R|/firstCalls|"]; - 16 [label="Stub" style="filled" fillcolor=gray]; - 17 [label="Exit block" style="filled" fillcolor=gray]; + 10 [label="Postponed exit from lambda"]; + 11 [label="Function call: R|kotlin/with||>(...)" style="filled" fillcolor=yellow]; + 12 [label="Variable declaration: lval firstCalls: R|kotlin/collections/List|"]; + 13 [label="Access variable R|/firstCalls|"]; + 14 [label="Jump: ^foo R|/firstCalls|"]; + 15 [label="Stub" style="filled" fillcolor=gray]; + 16 [label="Exit block" style="filled" fillcolor=gray]; } - 18 [label="Exit function foo" style="filled" fillcolor=red]; + 17 [label="Exit function foo" style="filled" fillcolor=red]; } 4 -> {5}; 5 -> {6}; 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {19}; - 9 -> {11} [color=red]; - 9 -> {19} [style=dashed]; - 10 -> {12} [color=red]; - 11 -> {12} [color=green]; + 9 -> {18}; + 9 -> {10} [color=red]; + 9 -> {18} [style=dashed]; + 10 -> {11}; + 11 -> {12}; 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {18}; + 14 -> {17}; + 14 -> {15} [style=dotted]; 15 -> {16} [style=dotted]; 16 -> {17} [style=dotted]; - 17 -> {18} [style=dotted]; + 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {26}; - 21 -> {22} [color=red]; - 21 -> {26} [style=dashed]; + 20 -> {25}; + 20 -> {21} [color=red]; + 20 -> {25} [style=dashed]; + 21 -> {22}; 22 -> {23}; 23 -> {24}; - 24 -> {25}; - 25 -> {10} [color=red]; - 25 -> {11} [color=green]; + 24 -> {11} [color=red]; + 24 -> {10} [color=green]; + 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {39}; - 33 -> {35} [color=red]; - 33 -> {39} [style=dashed]; - 34 -> {36} [color=red]; - 35 -> {36} [color=green]; - 36 -> {37}; + 32 -> {37}; + 32 -> {33} [color=red]; + 32 -> {37} [style=dashed]; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {11} [color=red]; + 36 -> {21} [color=green]; 37 -> {38}; - 38 -> {10} [color=red]; - 38 -> {22} [color=green]; + 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {34} [color=red]; - 47 -> {35} [color=green]; + 45 -> {34} [color=red]; + 45 -> {33} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot index 95009d6964e..74308a9a30a 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.dot @@ -13,415 +13,409 @@ digraph callsInPlace_kt { 3 [label="Postponed enter to lambda"]; subgraph cluster_2 { color=blue - 11 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 10 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 12 [label="Enter block"]; - 13 [label="Const: Int(1)"]; - 14 [label="Assignment: R|/x|"]; - 15 [label="Exit block"]; + 11 [label="Enter block"]; + 12 [label="Const: Int(1)"]; + 13 [label="Assignment: R|/x|"]; + 14 [label="Exit block"]; } - 16 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 15 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 4 [label="Call arguments union" style="filled" fillcolor=yellow]; - 5 [label="Postponed exit from lambda"]; - 6 [label="Function call: R|kotlin/run|(...)"]; - 7 [label="Access variable R|/x|"]; - 8 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 9 [label="Exit block"]; + 4 [label="Postponed exit from lambda"]; + 5 [label="Function call: R|kotlin/run|(...)" style="filled" fillcolor=yellow]; + 6 [label="Access variable R|/x|"]; + 7 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 8 [label="Exit block"]; } - 10 [label="Exit function test" style="filled" fillcolor=red]; + 9 [label="Exit function test" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; 2 -> {3}; - 3 -> {11}; - 3 -> {5} [color=red]; - 3 -> {11} [style=dashed]; - 4 -> {6} [color=red]; - 5 -> {6} [color=green]; + 3 -> {10}; + 3 -> {4} [color=red]; + 3 -> {10} [style=dashed]; + 4 -> {5}; + 5 -> {6}; 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; + 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; - 15 -> {16}; - 16 -> {4} [color=red]; - 16 -> {5} [color=green]; + 15 -> {5} [color=red]; + 15 -> {4} [color=green]; subgraph cluster_4 { color=red - 17 [label="Enter function test_2" style="filled" fillcolor=red]; + 16 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 18 [label="Enter block"]; - 19 [label="Const: Int(10)"]; - 20 [label="Postponed enter to lambda"]; + 17 [label="Enter block"]; + 18 [label="Const: Int(10)"]; + 19 [label="Postponed enter to lambda"]; subgraph cluster_6 { color=blue - 25 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 24 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_7 { color=blue - 26 [label="Enter block"]; - 27 [label="Const: String(test_2)"]; - 28 [label="Exit block"]; + 25 [label="Enter block"]; + 26 [label="Const: String(test_2)"]; + 27 [label="Exit block"]; } - 29 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 28 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 21 [label="Postponed exit from lambda"]; - 22 [label="Function call: R|kotlin/repeat|(...)"]; - 23 [label="Exit block"]; + 20 [label="Postponed exit from lambda"]; + 21 [label="Function call: R|kotlin/repeat|(...)" style="filled" fillcolor=yellow]; + 22 [label="Exit block"]; } - 24 [label="Exit function test_2" style="filled" fillcolor=red]; + 23 [label="Exit function test_2" style="filled" fillcolor=red]; } + 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20}; - 20 -> {21 25}; - 20 -> {25} [style=dashed]; + 19 -> {20 24}; + 19 -> {24} [style=dashed]; + 20 -> {21}; + 20 -> {19} [color=green style=dashed]; 21 -> {22}; 22 -> {23}; - 23 -> {24}; - 25 -> {29 26}; + 24 -> {25}; + 25 -> {26}; 26 -> {27}; 27 -> {28}; - 28 -> {29}; - 29 -> {21}; - 29 -> {25} [color=green style=dashed]; + 28 -> {20}; subgraph cluster_8 { color=red - 30 [label="Enter function test_3" style="filled" fillcolor=red]; + 29 [label="Enter function test_3" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 31 [label="Enter block"]; - 32 [label="Postponed enter to lambda"]; + 30 [label="Enter block"]; + 31 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 38 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 37 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 39 [label="Enter block"]; - 40 [label="Const: String(test_3)"]; - 41 [label="Exit block"]; + 38 [label="Enter block"]; + 39 [label="Const: String(test_3)"]; + 40 [label="Exit block"]; } - 42 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 33 [label="Postponed exit from lambda"]; - 34 [label="Const: Int(10)"]; - 35 [label="Function call: R|kotlin/repeat|(...)"]; - 36 [label="Exit block"]; + 32 [label="Postponed exit from lambda"]; + 33 [label="Const: Int(10)"]; + 34 [label="Function call: R|kotlin/repeat|(...)" style="filled" fillcolor=yellow]; + 35 [label="Exit block"]; } - 37 [label="Exit function test_3" style="filled" fillcolor=red]; + 36 [label="Exit function test_3" style="filled" fillcolor=red]; } + 29 -> {30}; 30 -> {31}; - 31 -> {32}; - 32 -> {33 38}; - 32 -> {38} [style=dashed]; + 31 -> {32 37}; + 31 -> {37} [style=dashed]; + 32 -> {33}; + 32 -> {31} [color=green style=dashed]; 33 -> {34}; 34 -> {35}; 35 -> {36}; - 36 -> {37}; - 38 -> {42 39}; + 37 -> {38}; + 38 -> {39}; 39 -> {40}; 40 -> {41}; - 41 -> {42}; - 42 -> {33}; - 42 -> {38} [color=green style=dashed]; + 41 -> {32}; subgraph cluster_12 { color=red - 43 [label="Enter function test_4" style="filled" fillcolor=red]; + 42 [label="Enter function test_4" style="filled" fillcolor=red]; subgraph cluster_13 { color=blue - 44 [label="Enter block"]; - 45 [label="Const: Int(1)"]; - 46 [label="Postponed enter to lambda"]; + 43 [label="Enter block"]; + 44 [label="Const: Int(1)"]; + 45 [label="Postponed enter to lambda"]; subgraph cluster_14 { color=blue - 52 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 50 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_15 { color=blue - 53 [label="Enter block"]; - 54 [label="Const: String(test_4)"]; - 55 [label="Access variable R|/it|"]; - 56 [label="Const: Int(0)"]; - 57 [label="Function call: R|/it|.R|kotlin/Int.compareTo|(...)"]; - 58 [label="Comparison >"]; - 59 [label="Exit block"]; + 51 [label="Enter block"]; + 52 [label="Const: String(test_4)"]; + 53 [label="Access variable R|/it|"]; + 54 [label="Const: Int(0)"]; + 55 [label="Function call: R|/it|.R|kotlin/Int.compareTo|(...)" style="filled" fillcolor=yellow]; + 56 [label="Comparison >"]; + 57 [label="Exit block"]; } - 60 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 58 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 47 [label="Call arguments union" style="filled" fillcolor=yellow]; - 48 [label="Postponed exit from lambda"]; - 49 [label="Function call: Int(1).R|kotlin/takeUnless|(...)"]; - 50 [label="Exit block"]; + 46 [label="Postponed exit from lambda"]; + 47 [label="Function call: Int(1).R|kotlin/takeUnless|(...)" style="filled" fillcolor=yellow]; + 48 [label="Exit block"]; } - 51 [label="Exit function test_4" style="filled" fillcolor=red]; + 49 [label="Exit function test_4" style="filled" fillcolor=red]; } + 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; - 46 -> {52}; - 46 -> {48} [color=red]; - 46 -> {52} [style=dashed]; - 47 -> {49} [color=red]; - 48 -> {49} [color=green]; - 49 -> {50}; + 45 -> {50}; + 45 -> {46} [color=red]; + 45 -> {50} [style=dashed]; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; 50 -> {51}; + 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {47} [color=red]; - 60 -> {48} [color=green]; + 58 -> {47} [color=red]; + 58 -> {46} [color=green]; subgraph cluster_16 { color=red - 61 [label="Enter function test_5" style="filled" fillcolor=red]; + 59 [label="Enter function test_5" style="filled" fillcolor=red]; subgraph cluster_17 { color=blue - 62 [label="Enter block"]; - 63 [label="Const: Int(1)"]; - 64 [label="Postponed enter to lambda"]; + 60 [label="Enter block"]; + 61 [label="Const: Int(1)"]; + 62 [label="Postponed enter to lambda"]; subgraph cluster_18 { color=blue - 70 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 67 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_19 { color=blue - 71 [label="Enter block"]; - 72 [label="Const: String(test_5)"]; - 73 [label="Access variable R|/it|"]; - 74 [label="Const: Int(0)"]; - 75 [label="Function call: R|/it|.R|kotlin/Int.compareTo|(...)"]; - 76 [label="Comparison >"]; - 77 [label="Exit block"]; + 68 [label="Enter block"]; + 69 [label="Const: String(test_5)"]; + 70 [label="Access variable R|/it|"]; + 71 [label="Const: Int(0)"]; + 72 [label="Function call: R|/it|.R|kotlin/Int.compareTo|(...)" style="filled" fillcolor=yellow]; + 73 [label="Comparison >"]; + 74 [label="Exit block"]; } - 78 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 75 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 65 [label="Call arguments union" style="filled" fillcolor=yellow]; - 66 [label="Postponed exit from lambda"]; - 67 [label="Function call: Int(1).R|kotlin/takeUnless|(...)"]; - 68 [label="Exit block"]; + 63 [label="Postponed exit from lambda"]; + 64 [label="Function call: Int(1).R|kotlin/takeUnless|(...)" style="filled" fillcolor=yellow]; + 65 [label="Exit block"]; } - 69 [label="Exit function test_5" style="filled" fillcolor=red]; + 66 [label="Exit function test_5" style="filled" fillcolor=red]; } + 59 -> {60}; + 60 -> {61}; 61 -> {62}; - 62 -> {63}; + 62 -> {67}; + 62 -> {63} [color=red]; + 62 -> {67} [style=dashed]; 63 -> {64}; - 64 -> {70}; - 64 -> {66} [color=red]; - 64 -> {70} [style=dashed]; - 65 -> {67} [color=red]; - 66 -> {67} [color=green]; + 64 -> {65}; + 65 -> {66}; 67 -> {68}; 68 -> {69}; + 69 -> {70}; 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {65} [color=red]; - 78 -> {66} [color=green]; + 75 -> {64} [color=red]; + 75 -> {63} [color=green]; subgraph cluster_20 { color=red - 79 [label="Enter function myRun" style="filled" fillcolor=red]; + 76 [label="Enter function myRun" style="filled" fillcolor=red]; subgraph cluster_21 { color=blue - 80 [label="Enter block"]; - 81 [label="Function call: R|/block1|.R|SubstitutionOverride|()"]; - 82 [label="Function call: R|/block2|.R|SubstitutionOverride|()"]; - 83 [label="Exit block"]; + 77 [label="Enter block"]; + 78 [label="Function call: R|/block1|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 79 [label="Function call: R|/block2|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 80 [label="Exit block"]; } - 84 [label="Exit function myRun" style="filled" fillcolor=red]; + 81 [label="Exit function myRun" style="filled" fillcolor=red]; } + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; 79 -> {80}; 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; subgraph cluster_22 { color=red - 85 [label="Enter function test_6" style="filled" fillcolor=red]; + 82 [label="Enter function test_6" style="filled" fillcolor=red]; subgraph cluster_23 { color=blue - 86 [label="Enter block"]; - 87 [label="Postponed enter to lambda"]; + 83 [label="Enter block"]; + 84 [label="Postponed enter to lambda"]; subgraph cluster_24 { color=blue - 99 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 96 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_25 { color=blue - 100 [label="Enter block"]; - 101 [label="Const: String(test_6_2)"]; - 102 [label="Exit block"]; + 97 [label="Enter block"]; + 98 [label="Const: String(test_6_2)"]; + 99 [label="Exit block"]; } - 103 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 100 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 88 [label="Postponed exit from lambda"]; - 89 [label="Postponed enter to lambda"]; + 85 [label="Postponed exit from lambda"]; + 86 [label="Postponed enter to lambda"]; subgraph cluster_26 { color=blue - 94 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 91 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_27 { color=blue - 95 [label="Enter block"]; - 96 [label="Const: String(test_6_1)"]; - 97 [label="Exit block"]; + 92 [label="Enter block"]; + 93 [label="Const: String(test_6_1)"]; + 94 [label="Exit block"]; } - 98 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 95 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 90 [label="Postponed exit from lambda"]; - 91 [label="Function call: R|/myRun|(...)"]; - 92 [label="Exit block"]; + 87 [label="Postponed exit from lambda"]; + 88 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 89 [label="Exit block"]; } - 93 [label="Exit function test_6" style="filled" fillcolor=red]; + 90 [label="Exit function test_6" style="filled" fillcolor=red]; } + 82 -> {83}; + 83 -> {84}; + 84 -> {85 96}; + 84 -> {96} [style=dashed]; 85 -> {86}; - 86 -> {87}; - 87 -> {88 99}; - 87 -> {99} [style=dashed]; + 85 -> {84} [color=green style=dashed]; + 86 -> {87 91}; + 86 -> {91} [style=dashed]; + 87 -> {88}; + 87 -> {86} [color=green style=dashed]; 88 -> {89}; - 89 -> {90 94}; - 89 -> {94} [style=dashed]; - 90 -> {91}; + 89 -> {90}; 91 -> {92}; 92 -> {93}; - 94 -> {98 95}; - 95 -> {96}; + 93 -> {94}; + 94 -> {95}; + 95 -> {87}; 96 -> {97}; 97 -> {98}; - 98 -> {90}; - 98 -> {94} [color=green style=dashed]; - 99 -> {103 100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {88}; - 103 -> {99} [color=green style=dashed]; + 98 -> {99}; + 99 -> {100}; + 100 -> {85}; subgraph cluster_28 { color=red - 104 [label="Enter function test_7" style="filled" fillcolor=red]; + 101 [label="Enter function test_7" style="filled" fillcolor=red]; subgraph cluster_29 { color=blue - 105 [label="Enter block"]; - 106 [label="Postponed enter to lambda"]; + 102 [label="Enter block"]; + 103 [label="Postponed enter to lambda"]; subgraph cluster_30 { color=blue - 113 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 110 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_31 { color=blue - 114 [label="Enter block"]; - 115 [label="Const: String(test_7_2)"]; - 116 [label="Exit block"]; + 111 [label="Enter block"]; + 112 [label="Const: String(test_7_2)"]; + 113 [label="Exit block"]; } - 117 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 114 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 107 [label="Postponed exit from lambda"]; - 108 [label="Postponed enter to lambda"]; + 104 [label="Postponed exit from lambda"]; + 105 [label="Postponed enter to lambda"]; subgraph cluster_32 { color=blue - 118 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 115 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_33 { color=blue - 119 [label="Enter block"]; - 120 [label="Const: String(test_7_1)"]; - 121 [label="Exit block"]; + 116 [label="Enter block"]; + 117 [label="Const: String(test_7_1)"]; + 118 [label="Exit block"]; } - 122 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 119 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 109 [label="Postponed exit from lambda"]; - 110 [label="Function call: R|/myRun|(...)"]; - 111 [label="Exit block"]; + 106 [label="Postponed exit from lambda"]; + 107 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 108 [label="Exit block"]; } - 112 [label="Exit function test_7" style="filled" fillcolor=red]; + 109 [label="Exit function test_7" style="filled" fillcolor=red]; } + 101 -> {102}; + 102 -> {103}; + 103 -> {104 110}; + 103 -> {110} [style=dashed]; 104 -> {105}; - 105 -> {106}; - 106 -> {107 113}; - 106 -> {113} [style=dashed]; + 104 -> {103} [color=green style=dashed]; + 105 -> {106 115}; + 105 -> {115} [style=dashed]; + 106 -> {107}; + 106 -> {105} [color=green style=dashed]; 107 -> {108}; - 108 -> {109 118}; - 108 -> {118} [style=dashed]; - 109 -> {110}; + 108 -> {109}; 110 -> {111}; 111 -> {112}; - 113 -> {117 114}; - 114 -> {115}; + 112 -> {113}; + 113 -> {114}; + 114 -> {104}; 115 -> {116}; 116 -> {117}; - 117 -> {107}; - 117 -> {113} [color=green style=dashed]; - 118 -> {122 119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {109}; - 122 -> {118} [color=green style=dashed]; + 117 -> {118}; + 118 -> {119}; + 119 -> {106}; subgraph cluster_34 { color=red - 123 [label="Enter function myDummyRun" style="filled" fillcolor=red]; + 120 [label="Enter function myDummyRun" style="filled" fillcolor=red]; subgraph cluster_35 { color=blue - 124 [label="Enter block"]; - 125 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; - 126 [label="Exit block"]; + 121 [label="Enter block"]; + 122 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 123 [label="Exit block"]; } - 127 [label="Exit function myDummyRun" style="filled" fillcolor=red]; + 124 [label="Exit function myDummyRun" style="filled" fillcolor=red]; } + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; subgraph cluster_36 { color=red - 128 [label="Enter function test_8" style="filled" fillcolor=red]; + 125 [label="Enter function test_8" style="filled" fillcolor=red]; subgraph cluster_37 { color=blue - 129 [label="Enter block"]; - 130 [label="Postponed enter to lambda"]; + 126 [label="Enter block"]; + 127 [label="Postponed enter to lambda"]; subgraph cluster_38 { color=blue - 135 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 132 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_39 { color=blue - 136 [label="Enter block"]; - 137 [label="Const: String(test_8)"]; - 138 [label="Exit block"]; + 133 [label="Enter block"]; + 134 [label="Const: String(test_8)"]; + 135 [label="Exit block"]; } - 139 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 136 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 131 [label="Postponed exit from lambda"]; - 132 [label="Function call: R|/myDummyRun|(...)"]; - 133 [label="Exit block"]; + 128 [label="Postponed exit from lambda"]; + 129 [label="Function call: R|/myDummyRun|(...)" style="filled" fillcolor=yellow]; + 130 [label="Exit block"]; } - 134 [label="Exit function test_8" style="filled" fillcolor=red]; + 131 [label="Exit function test_8" style="filled" fillcolor=red]; } + 125 -> {126}; + 126 -> {127}; + 127 -> {128 132}; + 127 -> {132} [style=dashed]; 128 -> {129}; 129 -> {130}; - 130 -> {131 135}; - 130 -> {135} [style=dashed]; - 131 -> {132}; + 130 -> {131}; 132 -> {133}; 133 -> {134}; + 134 -> {135}; 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/conditionalEffects.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/conditionalEffects.dot index dd2e6f8ded6..04cc5f09677 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/conditionalEffects.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/conditionalEffects.dot @@ -11,10 +11,10 @@ digraph conditionalEffects_kt { 1 [label="Enter block"]; 2 [label="Access variable R|/x|"]; 3 [label="Type operator: (R|/x| is R|kotlin/Int|)"]; - 4 [label="Function call: R|kotlin/require|(...)"]; + 4 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 5 [label="Access variable R|/x|"]; 6 [label="Smart cast: R|/x|"]; - 7 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 7 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -36,7 +36,7 @@ digraph conditionalEffects_kt { color=blue 11 [label="Enter block"]; 12 [label="Access variable R|/x|"]; - 13 [label="Function call: R|kotlin/requireNotNull|(...)"]; + 13 [label="Function call: R|kotlin/requireNotNull|(...)" style="filled" fillcolor=yellow]; 14 [label="Access variable R|/x|"]; 15 [label="Smart cast: R|/x|"]; 16 [label="Access variable R|kotlin/String.length|"]; @@ -62,7 +62,7 @@ digraph conditionalEffects_kt { 21 [label="Access variable R|/x|"]; 22 [label="Const: Null(null)"]; 23 [label="Equality operator !="]; - 24 [label="Function call: R|kotlin/require|(...)"]; + 24 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 25 [label="Access variable R|/x|"]; 26 [label="Smart cast: R|/x|"]; 27 [label="Access variable R|kotlin/String.length|"]; @@ -99,7 +99,7 @@ digraph conditionalEffects_kt { 39 [label="Equality operator !="]; 40 [label="Exit &&"]; } - 41 [label="Function call: R|kotlin/require|(...)"]; + 41 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 42 [label="Access variable R|/x|"]; 43 [label="Smart cast: R|/x|"]; 44 [label="Access variable R|kotlin/String.length|"]; @@ -165,7 +165,7 @@ digraph conditionalEffects_kt { 65 [label="Enter block"]; 66 [label="Access variable R|/x|"]; 67 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 68 [label="Function call: R|kotlin/require|(...)"]; + 68 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 69 [label="Access variable R|/x|"]; 70 [label="Smart cast: R|/x|"]; 71 [label="Access variable R|kotlin/String.length|"]; @@ -235,7 +235,7 @@ digraph conditionalEffects_kt { 88 [label="Enter block"]; 89 [label="Access variable R|/x|"]; 90 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 91 [label="Function call: R|kotlin/require|(...)"]; + 91 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 92 [label="Access variable R|/x|"]; 93 [label="Smart cast: R|/x|"]; 94 [label="Access variable R|kotlin/String.length|"]; @@ -248,7 +248,7 @@ digraph conditionalEffects_kt { 98 [label="Enter block"]; 99 [label="Access variable R|/x|"]; 100 [label="Type operator: (R|/x| is R|kotlin/String|)"]; - 101 [label="Function call: R|kotlin/require|(...)"]; + 101 [label="Function call: R|kotlin/require|(...)" style="filled" fillcolor=yellow]; 102 [label="Access variable R|/x|"]; 103 [label="Smart cast: R|/x|"]; 104 [label="Access variable R|kotlin/String.length|"]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot index 35553ab1511..0c2f8ac3bd9 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.dot @@ -21,8 +21,8 @@ digraph inAnonymousObject_kt { 4 [label="Exit anonymous object expression"]; 5 [label="Variable declaration: lval obj: R||"]; 6 [label="Access variable R|/obj|"]; - 7 [label="Function call: R|/obj|.R|/.run|()"]; - 8 [label="Function call: R|/d|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/obj|.R|/.run|()" style="filled" fillcolor=yellow]; + 8 [label="Function call: R|/d|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 9 [label="Exit block"]; } 10 [label="Exit function foo" style="filled" fillcolor=red]; @@ -54,7 +54,7 @@ digraph inAnonymousObject_kt { subgraph cluster_3 { color=red 15 [label="Enter function " style="filled" fillcolor=red]; - 16 [label="Delegated constructor call: super()"]; + 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 17 [label="Exit function " style="filled" fillcolor=red]; } 15 -> {16}; @@ -95,7 +95,7 @@ digraph inAnonymousObject_kt { subgraph cluster_8 { color=blue 28 [label="Enter block"]; - 29 [label="Function call: R|/c|.R|SubstitutionOverride|()"]; + 29 [label="Function call: R|/c|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 30 [label="Exit block"]; } 31 [label="Exit function run" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalClass.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalClass.dot index 570287c13e1..259308ad1e8 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalClass.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalClass.dot @@ -10,9 +10,9 @@ digraph inLocalClass_kt { color=blue 1 [label="Enter block"]; 2 [label="Exit local class foo"]; - 3 [label="Function call: R|/LocalClass.LocalClass|()"]; - 4 [label="Function call: R|/LocalClass.LocalClass|().R|/run|()"]; - 5 [label="Function call: R|/e|.R|SubstitutionOverride|()"]; + 3 [label="Function call: R|/LocalClass.LocalClass|()" style="filled" fillcolor=yellow]; + 4 [label="Function call: R|/LocalClass.LocalClass|().R|/run|()" style="filled" fillcolor=yellow]; + 5 [label="Function call: R|/e|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 6 [label="Exit block"]; } 7 [label="Exit function foo" style="filled" fillcolor=red]; @@ -55,11 +55,11 @@ digraph inLocalClass_kt { subgraph cluster_4 { color=red 15 [label="Enter function " style="filled" fillcolor=red]; - 16 [label="Delegated constructor call: super()"]; + 16 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; subgraph cluster_5 { color=blue 17 [label="Enter block"]; - 18 [label="Function call: R|/b|.R|SubstitutionOverride|()"]; + 18 [label="Function call: R|/b|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 19 [label="Exit block"]; } 20 [label="Exit function " style="filled" fillcolor=red]; @@ -95,7 +95,7 @@ digraph inLocalClass_kt { subgraph cluster_9 { color=blue 28 [label="Enter block"]; - 29 [label="Function call: R|/d|.R|SubstitutionOverride|()"]; + 29 [label="Function call: R|/d|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 30 [label="Exit block"]; } 31 [label="Exit function run" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalFunction.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalFunction.dot index 44fb044e50b..ea5ce340799 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalFunction.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalFunction.dot @@ -10,8 +10,8 @@ digraph inLocalFunction_kt { color=blue 1 [label="Enter block"]; 2 [label="Local function declaration foo"]; - 3 [label="Function call: R|/localFun|()"]; - 4 [label="Function call: R|/b|.R|SubstitutionOverride|()"]; + 3 [label="Function call: R|/localFun|()" style="filled" fillcolor=yellow]; + 4 [label="Function call: R|/b|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 5 [label="Exit block"]; } 6 [label="Exit function foo" style="filled" fillcolor=red]; @@ -23,8 +23,8 @@ digraph inLocalFunction_kt { color=blue 8 [label="Enter block"]; 9 [label="Access variable R|/a|"]; - 10 [label="Function call: R|/a|.R|SubstitutionOverride|()"]; - 11 [label="Function call: R|/a|.R|SubstitutionOverride|()"]; + 10 [label="Function call: R|/a|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 11 [label="Function call: R|/a|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 12 [label="Exit block"]; } 13 [label="Exit function localFun" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/toLocalVariables.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/toLocalVariables.dot index bd9ad0da288..fe5fce755c0 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/toLocalVariables.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/toLocalVariables.dot @@ -43,7 +43,7 @@ digraph toLocalVariables_kt { 13 [label="Enter block"]; 14 [label="Access variable R|/y|"]; 15 [label="Variable declaration: lval yCopy: R|() -> kotlin/Unit|"]; - 16 [label="Function call: R|/yCopy|.R|SubstitutionOverride|()"]; + 16 [label="Function call: R|/yCopy|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 17 [label="Exit block"]; } 18 [label="Exit when branch result"]; @@ -52,7 +52,7 @@ digraph toLocalVariables_kt { color=blue 20 [label="Enter block"]; 21 [label="Access variable R|/x|"]; - 22 [label="Function call: R|/bar|(...)"]; + 22 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 23 [label="Exit block"]; } 24 [label="Exit when branch result"]; @@ -61,7 +61,7 @@ digraph toLocalVariables_kt { 26 [label="Variable declaration: lval zCopy: R|() -> kotlin/Unit|"]; 27 [label="Access variable R|/z|"]; 28 [label="Assignment: R|/zCopy|"]; - 29 [label="Function call: R|/zCopy|.R|SubstitutionOverride|()"]; + 29 [label="Function call: R|/zCopy|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 30 [label="Exit block"]; } 31 [label="Exit function foo" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atLeastOnce.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atLeastOnce.dot index e2a6c49fb8d..d9ec5020938 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atLeastOnce.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atLeastOnce.dot @@ -9,7 +9,7 @@ digraph atLeastOnce_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function inlineRun" style="filled" fillcolor=red]; @@ -25,7 +25,7 @@ digraph atLeastOnce_kt { subgraph cluster_3 { color=blue 6 [label="Enter block"]; - 7 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function myRun" style="filled" fillcolor=red]; @@ -45,94 +45,90 @@ digraph atLeastOnce_kt { 13 [label="Postponed enter to lambda"]; subgraph cluster_6 { color=blue - 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 20 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_7 { color=blue - 22 [label="Enter block"]; - 23 [label="Const: Int(1)"]; - 24 [label="Assignment: R|/x|"]; - 25 [label="Exit block"]; + 21 [label="Enter block"]; + 22 [label="Const: Int(1)"]; + 23 [label="Assignment: R|/x|"]; + 24 [label="Exit block"]; } - 26 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 14 [label="Call arguments union" style="filled" fillcolor=yellow]; - 15 [label="Postponed exit from lambda"]; - 16 [label="Function call: R|/inlineRun|(...)"]; - 17 [label="Access variable R|/x|"]; - 18 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 19 [label="Exit block"]; + 14 [label="Postponed exit from lambda"]; + 15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow]; + 16 [label="Access variable R|/x|"]; + 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 18 [label="Exit block"]; } - 20 [label="Exit function test_1" style="filled" fillcolor=red]; + 19 [label="Exit function test_1" style="filled" fillcolor=red]; } 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {21}; - 13 -> {15} [color=red]; - 13 -> {21} [style=dashed]; - 14 -> {16} [color=red]; - 15 -> {16} [color=green]; + 13 -> {20}; + 13 -> {14} [color=red]; + 13 -> {20} [style=dashed]; + 14 -> {15}; + 14 -> {13} [color=green style=dashed]; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {14} [color=red]; - 26 -> {15} [color=green]; - 26 -> {21} [color=green style=dashed]; + 25 -> {15} [color=red]; + 25 -> {14} [color=green]; subgraph cluster_8 { color=red - 27 [label="Enter function test_2" style="filled" fillcolor=red]; + 26 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 28 [label="Enter block"]; - 29 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 30 [label="Postponed enter to lambda"]; + 27 [label="Enter block"]; + 28 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 29 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 38 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 36 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 39 [label="Enter block"]; - 40 [label="Const: Int(1)"]; - 41 [label="Assignment: R|/x|"]; - 42 [label="Exit block"]; + 37 [label="Enter block"]; + 38 [label="Const: Int(1)"]; + 39 [label="Assignment: R|/x|"]; + 40 [label="Exit block"]; } - 43 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 31 [label="Call arguments union" style="filled" fillcolor=yellow]; - 32 [label="Postponed exit from lambda"]; - 33 [label="Function call: R|/myRun|(...)"]; - 34 [label="Access variable R|/x|"]; - 35 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 36 [label="Exit block"]; + 30 [label="Postponed exit from lambda"]; + 31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 32 [label="Access variable R|/x|"]; + 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 34 [label="Exit block"]; } - 37 [label="Exit function test_2" style="filled" fillcolor=red]; + 35 [label="Exit function test_2" style="filled" fillcolor=red]; } + 26 -> {27}; 27 -> {28}; 28 -> {29}; - 29 -> {30}; - 30 -> {38}; - 30 -> {32} [color=red]; - 30 -> {38} [style=dashed]; - 31 -> {33} [color=red]; - 32 -> {33} [color=green]; + 29 -> {36}; + 29 -> {30} [color=red]; + 29 -> {36} [style=dashed]; + 30 -> {31}; + 30 -> {29} [color=green style=dashed]; + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; - 35 -> {36}; 36 -> {37}; + 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {31} [color=red]; - 43 -> {32} [color=green]; - 43 -> {38} [color=green style=dashed]; + 41 -> {31} [color=red]; + 41 -> {30} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.dot index afd183da989..5d1188db3d5 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.dot @@ -9,7 +9,7 @@ digraph atMostOnce_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function inlineRun" style="filled" fillcolor=red]; @@ -25,7 +25,7 @@ digraph atMostOnce_kt { subgraph cluster_3 { color=blue 6 [label="Enter block"]; - 7 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function myRun" style="filled" fillcolor=red]; @@ -56,9 +56,9 @@ digraph atMostOnce_kt { 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 14 [label="Postponed exit from lambda"]; - 15 [label="Function call: R|/inlineRun|(...)"]; + 15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow]; 16 [label="Access variable R|/x|"]; - 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 18 [label="Exit block"]; } 19 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -73,7 +73,7 @@ digraph atMostOnce_kt { 16 -> {17}; 17 -> {18}; 18 -> {19}; - 20 -> {25 21}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; @@ -101,9 +101,9 @@ digraph atMostOnce_kt { 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 30 [label="Postponed exit from lambda"]; - 31 [label="Function call: R|/myRun|(...)"]; + 31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 32 [label="Access variable R|/x|"]; - 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 34 [label="Exit block"]; } 35 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -118,7 +118,7 @@ digraph atMostOnce_kt { 32 -> {33}; 33 -> {34}; 34 -> {35}; - 36 -> {41 37}; + 36 -> {37}; 37 -> {38}; 38 -> {39}; 39 -> {40}; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/contractsUsage.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/contractsUsage.dot index d624bd2311f..41b0c98bfe4 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/contractsUsage.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/contractsUsage.dot @@ -10,7 +10,7 @@ digraph contractsUsage_kt { color=blue 1 [label="Enter block"]; 2 [label="Access variable R|/x|"]; - 3 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 3 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 4 [label="Exit block"]; } 5 [label="Exit function bar" style="filled" fillcolor=red]; @@ -42,7 +42,7 @@ digraph contractsUsage_kt { color=blue 14 [label="Enter block"]; 15 [label="Access variable this@R|/baz|"]; - 16 [label="Function call: this@R|/baz|.R|SubstitutionOverride|()"]; + 16 [label="Function call: this@R|/baz|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 17 [label="Exit block"]; } 18 [label="Exit when branch result"]; @@ -89,9 +89,9 @@ digraph contractsUsage_kt { color=blue 30 [label="Enter block"]; 31 [label="Access variable R|/x|"]; - 32 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 32 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 33 [label="Access variable R|/y|"]; - 34 [label="Function call: R|/y|.R|/baz|()"]; + 34 [label="Function call: R|/y|.R|/baz|()" style="filled" fillcolor=yellow]; 35 [label="Jump: ^foo Unit"]; 36 [label="Stub" style="filled" fillcolor=gray]; 37 [label="Exit block" style="filled" fillcolor=gray]; @@ -100,7 +100,7 @@ digraph contractsUsage_kt { 39 [label="Exit when"]; } 40 [label="Access variable R|/x|"]; - 41 [label="Function call: R|/bar|(...)"]; + 41 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 42 [label="Exit block"]; } 43 [label="Exit function foo" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/exactlyOnce.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/exactlyOnce.dot index a9dc2fbf5ea..38776f759b4 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/exactlyOnce.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/exactlyOnce.dot @@ -9,7 +9,7 @@ digraph exactlyOnce_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function inlineRun" style="filled" fillcolor=red]; @@ -25,7 +25,7 @@ digraph exactlyOnce_kt { subgraph cluster_3 { color=blue 6 [label="Enter block"]; - 7 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function myRun" style="filled" fillcolor=red]; @@ -45,92 +45,88 @@ digraph exactlyOnce_kt { 13 [label="Postponed enter to lambda"]; subgraph cluster_6 { color=blue - 21 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 20 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_7 { color=blue - 22 [label="Enter block"]; - 23 [label="Const: Int(1)"]; - 24 [label="Assignment: R|/x|"]; - 25 [label="Exit block"]; + 21 [label="Enter block"]; + 22 [label="Const: Int(1)"]; + 23 [label="Assignment: R|/x|"]; + 24 [label="Exit block"]; } - 26 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 14 [label="Call arguments union" style="filled" fillcolor=yellow]; - 15 [label="Postponed exit from lambda"]; - 16 [label="Function call: R|/inlineRun|(...)"]; - 17 [label="Access variable R|/x|"]; - 18 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 19 [label="Exit block"]; + 14 [label="Postponed exit from lambda"]; + 15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow]; + 16 [label="Access variable R|/x|"]; + 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 18 [label="Exit block"]; } - 20 [label="Exit function test_1" style="filled" fillcolor=red]; + 19 [label="Exit function test_1" style="filled" fillcolor=red]; } 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {21}; - 13 -> {15} [color=red]; - 13 -> {21} [style=dashed]; - 14 -> {16} [color=red]; - 15 -> {16} [color=green]; + 13 -> {20}; + 13 -> {14} [color=red]; + 13 -> {20} [style=dashed]; + 14 -> {15}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {14} [color=red]; - 26 -> {15} [color=green]; + 25 -> {15} [color=red]; + 25 -> {14} [color=green]; subgraph cluster_8 { color=red - 27 [label="Enter function test_2" style="filled" fillcolor=red]; + 26 [label="Enter function test_2" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 28 [label="Enter block"]; - 29 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 30 [label="Postponed enter to lambda"]; + 27 [label="Enter block"]; + 28 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 29 [label="Postponed enter to lambda"]; subgraph cluster_10 { color=blue - 38 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 36 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; subgraph cluster_11 { color=blue - 39 [label="Enter block"]; - 40 [label="Const: Int(1)"]; - 41 [label="Assignment: R|/x|"]; - 42 [label="Exit block"]; + 37 [label="Enter block"]; + 38 [label="Const: Int(1)"]; + 39 [label="Assignment: R|/x|"]; + 40 [label="Exit block"]; } - 43 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 31 [label="Call arguments union" style="filled" fillcolor=yellow]; - 32 [label="Postponed exit from lambda"]; - 33 [label="Function call: R|/myRun|(...)"]; - 34 [label="Access variable R|/x|"]; - 35 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 36 [label="Exit block"]; + 30 [label="Postponed exit from lambda"]; + 31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; + 32 [label="Access variable R|/x|"]; + 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; + 34 [label="Exit block"]; } - 37 [label="Exit function test_2" style="filled" fillcolor=red]; + 35 [label="Exit function test_2" style="filled" fillcolor=red]; } + 26 -> {27}; 27 -> {28}; 28 -> {29}; - 29 -> {30}; - 30 -> {38}; - 30 -> {32} [color=red]; - 30 -> {38} [style=dashed]; - 31 -> {33} [color=red]; - 32 -> {33} [color=green]; + 29 -> {36}; + 29 -> {30} [color=red]; + 29 -> {36} [style=dashed]; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; - 35 -> {36}; 36 -> {37}; + 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {31} [color=red]; - 43 -> {32} [color=green]; + 41 -> {31} [color=red]; + 41 -> {30} [color=green]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot index bd0bf2598d3..382eb4b226d 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.dot @@ -24,7 +24,7 @@ digraph flow_kt { color=blue 8 [label="Enter block"]; 9 [label="Access variable R|/x|"]; - 10 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 10 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 11 [label="Jump: ^bar Unit"]; 12 [label="Stub" style="filled" fillcolor=gray]; 13 [label="Exit block" style="filled" fillcolor=gray]; @@ -33,7 +33,7 @@ digraph flow_kt { 15 [label="Exit when"]; } 16 [label="Access variable R|/x|"]; - 17 [label="Function call: R|/bar|(...)"]; + 17 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 18 [label="Exit block"]; } 19 [label="Exit function bar" style="filled" fillcolor=red]; @@ -102,9 +102,9 @@ digraph flow_kt { color=blue 37 [label="Enter block"]; 38 [label="Access variable R|/y|"]; - 39 [label="Function call: R|/y|.R|SubstitutionOverride|()"]; + 39 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 40 [label="Access variable R|/z|"]; - 41 [label="Function call: R|/z|.R|SubstitutionOverride|()"]; + 41 [label="Function call: R|/z|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 42 [label="Jump: ^foo Unit"]; 43 [label="Stub" style="filled" fillcolor=gray]; 44 [label="Exit block" style="filled" fillcolor=gray]; @@ -115,7 +115,7 @@ digraph flow_kt { color=blue 47 [label="Enter block"]; 48 [label="Access variable R|/y|"]; - 49 [label="Function call: R|/y|.R|SubstitutionOverride|()"]; + 49 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 50 [label="Exit block"]; } 51 [label="Exit when branch result"]; @@ -133,8 +133,8 @@ digraph flow_kt { 57 [label="Enter block"]; 58 [label="Const: Int(0)"]; 59 [label="Const: Int(0)"]; - 60 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"]; - 61 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"]; + 60 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)" style="filled" fillcolor=yellow]; + 61 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()" style="filled" fillcolor=yellow]; 62 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; subgraph cluster_18 { color=blue @@ -143,7 +143,7 @@ digraph flow_kt { color=blue 64 [label="Enter loop condition"]; 65 [label="Access variable R|/|"]; - 66 [label="Function call: R|/|.R|SubstitutionOverride|()"]; + 66 [label="Function call: R|/|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 67 [label="Exit loop condition"]; } subgraph cluster_20 { @@ -153,10 +153,10 @@ digraph flow_kt { color=blue 69 [label="Enter block"]; 70 [label="Access variable R|/|"]; - 71 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; + 71 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()" style="filled" fillcolor=yellow]; 72 [label="Variable declaration: lval i: R|kotlin/Int|"]; 73 [label="Access variable R|/x|"]; - 74 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 74 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 75 [label="Exit block"]; } 76 [label="Exit loop block"]; @@ -166,7 +166,7 @@ digraph flow_kt { 78 [label="Exit block"]; } 79 [label="Access variable R|/y|"]; - 80 [label="Function call: R|/y|.R|SubstitutionOverride|()"]; + 80 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 81 [label="Exit block"]; } 82 [label="Exit when branch result"]; @@ -182,7 +182,7 @@ digraph flow_kt { color=blue 86 [label="Enter block"]; 87 [label="Access variable R|/z|"]; - 88 [label="Function call: R|/bar|(...)"]; + 88 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 89 [label="Exit block"]; } 90 [label="Exit loop block"]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/inPlaceLambda.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/inPlaceLambda.dot index 7dce21361f3..bdb8ede85c5 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/inPlaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/inPlaceLambda.dot @@ -23,7 +23,7 @@ digraph inPlaceLambda_kt { subgraph cluster_4 { color=blue 8 [label="Enter block"]; - 9 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 9 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 10 [label="Exit block"]; } 11 [label="Exit when branch result"]; @@ -54,7 +54,7 @@ digraph inPlaceLambda_kt { subgraph cluster_6 { color=blue 16 [label="Enter block"]; - 17 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 17 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 18 [label="Postponed enter to lambda"]; subgraph cluster_7 { color=blue @@ -62,13 +62,13 @@ digraph inPlaceLambda_kt { subgraph cluster_8 { color=blue 24 [label="Enter block"]; - 25 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 25 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 26 [label="Exit block"]; } 27 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 19 [label="Postponed exit from lambda"]; - 20 [label="Function call: R|/bar|(...)"]; + 20 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 21 [label="Exit block"]; } 22 [label="Exit function foo" style="filled" fillcolor=red]; @@ -81,7 +81,7 @@ digraph inPlaceLambda_kt { 19 -> {20}; 20 -> {21}; 21 -> {22}; - 23 -> {27 24}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/simple.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/simple.dot index 77a296fd0a4..d9f0a811539 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/simple.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/simple.dot @@ -10,7 +10,7 @@ digraph simple_kt { color=blue 1 [label="Enter block"]; 2 [label="Access variable R|/x|"]; - 3 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 3 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 4 [label="Exit block"]; } 5 [label="Exit function bar" style="filled" fillcolor=red]; @@ -28,7 +28,7 @@ digraph simple_kt { color=blue 7 [label="Enter block"]; 8 [label="Access variable R|/x|"]; - 9 [label="Function call: R|/x|.R|SubstitutionOverride|()"]; + 9 [label="Function call: R|/x|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; subgraph cluster_4 { color=blue 10 [label="Enter when"]; @@ -43,14 +43,14 @@ digraph simple_kt { subgraph cluster_6 { color=blue 16 [label="Enter block"]; - 17 [label="Function call: R|/y|.R|SubstitutionOverride|()"]; + 17 [label="Function call: R|/y|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 18 [label="Exit block"]; } 19 [label="Exit when branch result"]; 20 [label="Exit when"]; } 21 [label="Access variable R|/z|"]; - 22 [label="Function call: R|/bar|(...)"]; + 22 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow]; 23 [label="Exit block"]; } 24 [label="Exit function foo" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.dot index f7be5b2ee24..6a61fcc894e 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.dot @@ -9,7 +9,7 @@ digraph unknown_kt { subgraph cluster_1 { color=blue 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 2 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 3 [label="Exit block"]; } 4 [label="Exit function inlineRun" style="filled" fillcolor=red]; @@ -25,7 +25,7 @@ digraph unknown_kt { subgraph cluster_3 { color=blue 6 [label="Enter block"]; - 7 [label="Function call: R|/block|.R|SubstitutionOverride|()"]; + 7 [label="Function call: R|/block|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; 8 [label="Exit block"]; } 9 [label="Exit function myRun" style="filled" fillcolor=red]; @@ -56,9 +56,9 @@ digraph unknown_kt { 25 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 14 [label="Postponed exit from lambda"]; - 15 [label="Function call: R|/inlineRun|(...)"]; + 15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow]; 16 [label="Access variable R|/x|"]; - 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 17 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 18 [label="Exit block"]; } 19 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -69,17 +69,17 @@ digraph unknown_kt { 13 -> {14 20}; 13 -> {20} [style=dashed]; 14 -> {15}; + 14 -> {13} [color=green style=dashed]; 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; - 20 -> {25 21}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {14}; - 25 -> {20} [color=green style=dashed]; subgraph cluster_8 { color=red @@ -102,9 +102,9 @@ digraph unknown_kt { 41 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 30 [label="Postponed exit from lambda"]; - 31 [label="Function call: R|/myRun|(...)"]; + 31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow]; 32 [label="Access variable R|/x|"]; - 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 33 [label="Function call: R|/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow]; 34 [label="Exit block"]; } 35 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -115,16 +115,16 @@ digraph unknown_kt { 29 -> {30 36}; 29 -> {36} [style=dashed]; 30 -> {31}; + 30 -> {29} [color=green style=dashed]; 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; - 36 -> {41 37}; + 36 -> {37}; 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {30}; - 41 -> {36} [color=green style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot index 525fd7f4c84..9f8d6869674 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.dot @@ -6,7 +6,7 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_0 { color=red 0 [label="Enter function " style="filled" fillcolor=red]; - 1 [label="Delegated constructor call: super()"]; + 1 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 2 [label="Exit function " style="filled" fillcolor=red]; } 0 -> {1}; @@ -26,7 +26,7 @@ digraph delegateWithAnonymousObject_kt { color=blue 6 [label="Enter block"]; 7 [label="Const: Null(null)"]; - 8 [label="Check not null: Null(null)!!"]; + 8 [label="Check not null: Null(null)!!" style="filled" fillcolor=yellow]; 9 [label="Stub" style="filled" fillcolor=gray]; 10 [label="Jump: ^delegate Null(null)!!" style="filled" fillcolor=gray]; 11 [label="Stub" style="filled" fillcolor=gray]; @@ -47,7 +47,7 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_4 { color=red 14 [label="Enter function " style="filled" fillcolor=red]; - 15 [label="Delegated constructor call: super|>()"]; + 15 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; 16 [label="Exit function " style="filled" fillcolor=red]; } 14 -> {15}; @@ -77,7 +77,7 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_8 { color=red 23 [label="Enter function " style="filled" fillcolor=red]; - 24 [label="Delegated constructor call: super|>()"]; + 24 [label="Delegated constructor call: super|>()" style="filled" fillcolor=yellow]; 25 [label="Exit function " style="filled" fillcolor=red]; } 23 -> {24}; @@ -118,7 +118,7 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_12 { color=red 35 [label="Enter function " style="filled" fillcolor=red]; - 36 [label="Delegated constructor call: super()"]; + 36 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 37 [label="Exit function " style="filled" fillcolor=red]; } 35 -> {36}; @@ -130,7 +130,7 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_14 { color=blue 39 [label="Enter block"]; - 40 [label="Function call: R|/IssueListView.IssueListView|()"]; + 40 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; 41 [label="Jump: ^getValue R|/IssueListView.IssueListView|()"]; 42 [label="Stub" style="filled" fillcolor=gray]; 43 [label="Exit block" style="filled" fillcolor=gray]; @@ -151,9 +151,9 @@ digraph delegateWithAnonymousObject_kt { subgraph cluster_16 { color=blue 46 [label="Enter block"]; - 47 [label="Function call: R|/IssueListView.IssueListView|()"]; + 47 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow]; 48 [label="Access variable R|/value|"]; - 49 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)"]; + 49 [label="Function call: R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(...)" style="filled" fillcolor=yellow]; 50 [label="Jump: ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|)"]; 51 [label="Stub" style="filled" fillcolor=gray]; 52 [label="Exit block" style="filled" fillcolor=gray]; @@ -178,7 +178,7 @@ digraph delegateWithAnonymousObject_kt { 55 [label="Enter block"]; 56 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 57 [label="Access variable this@R|/IssuesListUserProfile|"]; - 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; + 58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; 59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"]; 60 [label="Stub" style="filled" fillcolor=gray]; 61 [label="Exit block" style="filled" fillcolor=gray]; @@ -204,7 +204,7 @@ digraph delegateWithAnonymousObject_kt { 65 [label="Access variable D|/IssuesListUserProfile.issueListView|"]; 66 [label="Access variable this@R|/IssuesListUserProfile|"]; 67 [label="Access variable R|/issueListView|"]; - 68 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)"]; + 68 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; 69 [label="Exit block"]; } 70 [label="Exit function setter" style="filled" fillcolor=red]; @@ -222,9 +222,9 @@ digraph delegateWithAnonymousObject_kt { 71 [label="Enter property" style="filled" fillcolor=red]; 72 [label="Postponed enter to lambda"]; 73 [label="Postponed exit from lambda"]; - 74 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)"]; + 74 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...)" style="filled" fillcolor=yellow]; 75 [label="Access variable this@R|/IssuesListUserProfile|"]; - 76 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)"]; + 76 [label="Function call: this@R|/IssuesListUserProfile|.R|/delegate|(...).#(...)" style="filled" fillcolor=yellow]; 77 [label="Exit property" style="filled" fillcolor=red]; } 71 -> {72}; diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot index ada5dbc9388..0bd920692ae 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.dot @@ -10,7 +10,7 @@ digraph plusAssignWithLambdaInRhs_kt { color=blue 1 [label="Enter block"]; 2 [label="Const: Null(null)"]; - 3 [label="Check not null: Null(null)!!"]; + 3 [label="Check not null: Null(null)!!" style="filled" fillcolor=yellow]; 4 [label="Stub" style="filled" fillcolor=gray]; 5 [label="Variable declaration: lval list: R|kotlin/collections/MutableList>|" style="filled" fillcolor=gray]; 6 [label="Access variable R|/list|" style="filled" fillcolor=gray]; @@ -43,19 +43,19 @@ digraph plusAssignWithLambdaInRhs_kt { 7 -> {8 12} [style=dotted]; 7 -> {12} [style=dashed]; 8 -> {9} [style=dotted]; + 8 -> {7} [color=green style=dotted]; 9 -> {10} [style=dotted]; 10 -> {11} [style=dotted]; - 12 -> {16 13} [style=dotted]; + 12 -> {13} [style=dotted]; 13 -> {14} [style=dotted]; 14 -> {15} [style=dotted]; 15 -> {16} [style=dotted]; 16 -> {8} [style=dotted]; - 16 -> {12} [color=green style=dotted]; subgraph cluster_4 { color=red 17 [label="Enter function " style="filled" fillcolor=red]; - 18 [label="Delegated constructor call: super()"]; + 18 [label="Delegated constructor call: super()" style="filled" fillcolor=yellow]; 19 [label="Exit function " style="filled" fillcolor=red]; } 17 -> {18}; @@ -88,7 +88,7 @@ digraph plusAssignWithLambdaInRhs_kt { subgraph cluster_8 { color=blue 27 [label="Enter block"]; - 28 [label="Function call: R|kotlin/collections/mutableListOf| kotlin/Unit|>()"]; + 28 [label="Function call: R|kotlin/collections/mutableListOf| kotlin/Unit|>()" style="filled" fillcolor=yellow]; 29 [label="Variable declaration: lval queue: R|kotlin/collections/MutableList>|"]; 30 [label="Postponed enter to lambda"]; subgraph cluster_9 { @@ -105,20 +105,20 @@ digraph plusAssignWithLambdaInRhs_kt { subgraph cluster_12 { color=blue 46 [label="Enter block"]; - 47 [label="Function call: R|/computation|.R|SubstitutionOverride|()"]; - 48 [label="Function call: R|/resolve|.R|SubstitutionOverride|(...)"]; + 47 [label="Function call: R|/computation|.R|SubstitutionOverride|()" style="filled" fillcolor=yellow]; + 48 [label="Function call: R|/resolve|.R|SubstitutionOverride|(...)" style="filled" fillcolor=yellow]; 49 [label="Exit block"]; } 50 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 41 [label="Postponed exit from lambda"]; - 42 [label="Function call: R|/queue|.R|kotlin/collections/plusAssign| kotlin/Unit|>(...)"]; + 42 [label="Function call: R|/queue|.R|kotlin/collections/plusAssign| kotlin/Unit|>(...)" style="filled" fillcolor=yellow]; 43 [label="Exit block"]; } 44 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 31 [label="Postponed exit from lambda"]; - 32 [label="Function call: R|/A.A|(...)"]; + 32 [label="Function call: R|/A.A|(...)" style="filled" fillcolor=yellow]; 33 [label="Jump: ^postpone R|/A.A|( = A@fun (resolve: R|(T) -> kotlin/Unit|): R|kotlin/Unit| { R|/queue|.R|kotlin/collections/plusAssign| kotlin/Unit|>(A@fun (): R|kotlin/Unit| { R|/resolve|.R|SubstitutionOverride|(R|/computation|.R|SubstitutionOverride|()) @@ -149,14 +149,14 @@ digraph plusAssignWithLambdaInRhs_kt { 40 -> {41 45}; 40 -> {45} [style=dashed]; 41 -> {42}; + 41 -> {40} [color=green style=dashed]; 42 -> {43}; 43 -> {44}; - 45 -> {50 46}; + 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; 50 -> {41}; - 50 -> {45} [color=green style=dashed]; } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot b/compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot index 9736305f499..1d489576feb 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.dot @@ -67,7 +67,7 @@ digraph tryWithLambdaInside_kt { 35 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 18 [label="Postponed exit from lambda"]; - 19 [label="Function call: R|/list|.R|kotlin/collections/filter|(...)"]; + 19 [label="Function call: R|/list|.R|kotlin/collections/filter|(...)" style="filled" fillcolor=yellow]; 20 [label="Exit block"]; } 21 [label="Try main block exit"]; @@ -108,6 +108,7 @@ finally { 17 -> {18 31}; 17 -> {31} [style=dashed]; 18 -> {19}; + 18 -> {17} [color=green style=dashed]; 19 -> {20}; 20 -> {21}; 21 -> {22}; @@ -121,12 +122,11 @@ finally { 27 -> {28} [style=dotted]; 28 -> {29} [style=dotted]; 29 -> {30} [style=dotted]; - 31 -> {35 32}; + 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {18}; - 35 -> {31} [color=green style=dashed]; subgraph cluster_13 { color=red @@ -157,7 +157,7 @@ finally { 60 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } 43 [label="Postponed exit from lambda"]; - 44 [label="Function call: R|/list|.R|/notInPlaceFilter|(...)"]; + 44 [label="Function call: R|/list|.R|/notInPlaceFilter|(...)" style="filled" fillcolor=yellow]; 45 [label="Exit block"]; } 46 [label="Try main block exit"]; diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt index a42442e9411..e3c55fb101c 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/FirCallsEffectAnalyzer.kt @@ -155,6 +155,8 @@ object FirCallsEffectAnalyzer : FirControlFlowChecker() { override fun visitNode(node: CFGNode<*>, data: IllegalScopeContext) {} + override fun visitUnionNode(node: T, data: IllegalScopeContext) where T : CFGNode<*>, T : UnionNodeMarker {} + override fun visitFunctionEnterNode(node: FunctionEnterNode, data: IllegalScopeContext) { data.enterScope(node.fir === rootFunction || node.fir.isInPlaceLambda()) } @@ -235,22 +237,15 @@ object FirCallsEffectAnalyzer : FirControlFlowChecker() { private class InvocationDataCollector( val functionalTypeSymbols: Set> - ) : ControlFlowGraphVisitor>>() { - - override fun visitNode( - node: CFGNode<*>, - data: Collection> - ): PathAwareLambdaInvocationInfo { - if (data.isEmpty()) return PathAwareLambdaInvocationInfo.EMPTY - return data.map { (label, info) -> info.applyLabel(node, label) } - .reduce(PathAwareLambdaInvocationInfo::merge) - } + ) : PathAwareControlFlowGraphVisitor() { + override val emptyInfo: PathAwareLambdaInvocationInfo + get() = PathAwareLambdaInvocationInfo.EMPTY override fun visitFunctionCallNode( node: FunctionCallNode, data: Collection> ): PathAwareLambdaInvocationInfo { - var dataForNode = visitNode(node, data) + var dataForNode = visitUnionNode(node, data) val functionSymbol = node.fir.toResolvedCallableSymbol() as? FirFunctionSymbol<*>? val contractDescription = functionSymbol?.resolvedContractDescription 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 index 5ffba0d9b00..5db3981edb7 100644 --- 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 @@ -63,6 +63,8 @@ object FirPropertyInitializationAnalyzer : AbstractFirPropertyInitializationChec ) : ControlFlowGraphVisitorVoid() { override fun visitNode(node: CFGNode<*>) {} + override fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker {} + private fun getPropertySymbol(node: CFGNode<*>): FirPropertySymbol? { return (node.fir as? FirQualifiedAccess)?.referredPropertySymbol } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/ControlFlowInfo.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/ControlFlowInfo.kt index 37386cd55e7..1a495d77948 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/ControlFlowInfo.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/ControlFlowInfo.kt @@ -36,4 +36,6 @@ abstract class ControlFlowInfo, K : Any, V : Any> p } abstract fun merge(other: S): S + + abstract fun plus(other: S): S } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/LocalPropertyAndCapturedWriteCollector.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/LocalPropertyAndCapturedWriteCollector.kt index 060490a27fa..7950e7586c9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/LocalPropertyAndCapturedWriteCollector.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/LocalPropertyAndCapturedWriteCollector.kt @@ -33,6 +33,8 @@ class LocalPropertyAndCapturedWriteCollector private constructor() : ControlFlow override fun visitNode(node: CFGNode<*>) {} + override fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker {} + override fun visitVariableDeclarationNode(node: VariableDeclarationNode) { symbols[node.fir.symbol] = lambdaOrLocalFunctionStack.lastOrNull() == null } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowGraphVisitor.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowGraphVisitor.kt new file mode 100644 index 00000000000..9aa4aa1f823 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowGraphVisitor.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2010-2022 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.util + +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.CFGNode +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ControlFlowGraphVisitor +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.EdgeLabel +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.UnionNodeMarker +import org.jetbrains.kotlin.utils.addToStdlib.foldMap + +abstract class PathAwareControlFlowGraphVisitor

> + : ControlFlowGraphVisitor>>() { + + protected abstract val emptyInfo: P + + override fun visitNode(node: CFGNode<*>, data: Collection>): P { + if (data.isEmpty()) return emptyInfo + return data.foldMap({ (label, info) -> info.applyLabel(node, label) }) { a, b -> a.merge(b) } + } + + override fun visitUnionNode(node: T, data: Collection>): P where T : CFGNode<*>, T : UnionNodeMarker { + if (data.isEmpty()) return emptyInfo + return data.foldMap({ (label, info) -> info.applyLabel(node, label) }) { a, b -> a.plus(b) } + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowInfo.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowInfo.kt index ee1883e9f82..335ea95ed55 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowInfo.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PathAwareControlFlowInfo.kt @@ -68,7 +68,7 @@ abstract class PathAwareControlFlowInfo

, S : } } - override fun merge(other: P): P { + private fun join(other: P, union: Boolean): P { var resultMap = persistentMapOf() for (label in keys.union(other.keys)) { // disjoint merging to preserve paths. i.e., merge the property initialization info if and only if both have the key. @@ -78,7 +78,7 @@ abstract class PathAwareControlFlowInfo

, S : val i2 = other[label] resultMap = when { i1 != null && i2 != null -> - resultMap.put(label, i1.merge(i2)) + resultMap.put(label, if (union) i1.plus(i2) else i1.merge(i2)) i1 != null -> resultMap.put(label, i1) i2 != null -> @@ -89,4 +89,8 @@ abstract class PathAwareControlFlowInfo

, S : } return constructor(resultMap) } + + override fun merge(other: P): P = join(other, union = false) + + override fun plus(other: P): P = join(other, union = true) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfo.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfo.kt index 004034180b1..9fa733b1935 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfo.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfo.kt @@ -19,7 +19,7 @@ abstract class EventOccurrencesRangeInfo, K override fun merge(other: E): E = operation(other, EventOccurrencesRange::or) - fun plus(other: E): E = + override fun plus(other: E): E = when { isEmpty() -> other other.isEmpty() -> diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfoCollector.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfoCollector.kt index 9dd36780e4d..8593d1b157a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfoCollector.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/cfa/util/PropertyInitializationInfoCollector.kt @@ -16,18 +16,9 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol class PropertyInitializationInfoCollector( private val localProperties: Set, private val declaredVariableCollector: DeclaredVariableCollector = DeclaredVariableCollector(), -) : ControlFlowGraphVisitor>>() { - override fun visitNode( - node: CFGNode<*>, - data: Collection> - ): PathAwarePropertyInitializationInfo { - var result: PathAwarePropertyInitializationInfo? = null - for ((label, info) in data) { - val resultItem = info.applyLabel(node, label) - result = result?.merge(resultItem) ?: resultItem - } - return result ?: PathAwarePropertyInitializationInfo.EMPTY - } +) : PathAwareControlFlowGraphVisitor() { + override val emptyInfo: PathAwarePropertyInitializationInfo + get() = PathAwarePropertyInitializationInfo.EMPTY override fun visitVariableAssignmentNode( node: VariableAssignmentNode, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPropertyInitializationChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPropertyInitializationChecker.kt index 43da023ed84..7e00ca625d1 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPropertyInitializationChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPropertyInitializationChecker.kt @@ -16,10 +16,7 @@ import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.expressions.FirVariableAssignment import org.jetbrains.kotlin.fir.expressions.toResolvedCallableSymbol -import org.jetbrains.kotlin.fir.resolve.dfa.cfg.CFGNode -import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ControlFlowGraphVisitor -import org.jetbrains.kotlin.fir.resolve.dfa.cfg.EdgeLabel -import org.jetbrains.kotlin.fir.resolve.dfa.cfg.VariableAssignmentNode +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.* import org.jetbrains.kotlin.fir.resolve.dfa.controlFlowGraph import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol @@ -62,6 +59,13 @@ object FirPropertyInitializationChecker : FirRegularClassChecker() { return data.map { it.second }.reduce { l, r -> l.intersect(r) } } + override fun visitUnionNode( + node: T, data: Collection> + ): Properties where T : CFGNode<*>, T : UnionNodeMarker { + if (data.isEmpty()) return emptySet() + return data.map { it.second }.reduce { l, r -> l + r } + } + override fun visitVariableAssignmentNode(node: VariableAssignmentNode, data: Collection>): Properties { val input = visitNode(node, data) val propertySymbol = node.fir.lValue.toResolvedCallableSymbol() as? FirPropertySymbol ?: return input diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTailrecFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTailrecFunctionChecker.kt index b0799223f5f..52ee693b8ce 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTailrecFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTailrecFunctionChecker.kt @@ -41,6 +41,8 @@ object FirTailrecFunctionChecker : FirSimpleFunctionChecker() { graph.traverse(TraverseDirection.Forward, object : ControlFlowGraphVisitorVoid() { override fun visitNode(node: CFGNode<*>) {} + override fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker {} + override fun visitTryMainBlockEnterNode(node: TryMainBlockEnterNode) { tryScopeCount++ } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt index f9b7f907797..ae74c8e3c9c 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt @@ -84,6 +84,8 @@ object CanBeValChecker : AbstractFirPropertyInitializationChecker() { ) : ControlFlowGraphVisitorVoid() { override fun visitNode(node: CFGNode<*>) {} + override fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker {} + override fun visitVariableAssignmentNode(node: VariableAssignmentNode) { val symbol = node.fir.calleeReference.resolvedSymbol as? FirPropertySymbol ?: return if (symbol !in localProperties) return diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/UnusedChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/UnusedChecker.kt index 7fba7ac178c..5029c57af4c 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/UnusedChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/UnusedChecker.kt @@ -49,6 +49,8 @@ object UnusedChecker : FirControlFlowChecker() { ) : ControlFlowGraphVisitorVoid() { override fun visitNode(node: CFGNode<*>) {} + override fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker {} + override fun visitVariableAssignmentNode(node: VariableAssignmentNode) { val variableSymbol = node.fir.calleeReference.resolvedSymbol ?: return val dataPerNode = data[node] ?: return @@ -117,6 +119,7 @@ object UnusedChecker : FirControlFlowChecker() { else variableUseState return base.also { + // TODO: is this modifying constant enum values??? it.isRead = this.isRead || variableUseState?.isRead == true it.isRedundantInit = this.isRedundantInit && variableUseState?.isRedundantInit == true } @@ -147,6 +150,8 @@ object UnusedChecker : FirControlFlowChecker() { return result } + override fun plus(other: VariableStatusInfo): VariableStatusInfo = + merge(other) // TODO: not sure } class PathAwareVariableStatusInfo( @@ -166,21 +171,28 @@ object UnusedChecker : FirControlFlowChecker() { private class ValueWritesWithoutReading( private val session: FirSession, private val localProperties: Set - ) : ControlFlowGraphVisitor>>() { + ) : PathAwareControlFlowGraphVisitor() { + override val emptyInfo: PathAwareVariableStatusInfo + get() = PathAwareVariableStatusInfo.EMPTY + fun getData(graph: ControlFlowGraph): Map, PathAwareVariableStatusInfo> { return graph.collectDataForNode(TraverseDirection.Backward, PathAwareVariableStatusInfo.EMPTY, this) } + private fun PathAwareVariableStatusInfo.withAnnotationsFrom(node: CFGNode<*>): PathAwareVariableStatusInfo = + (node.fir as? FirAnnotationContainer)?.annotations?.fold(this, ::visitAnnotation) ?: this + override fun visitNode( node: CFGNode<*>, data: Collection> - ): PathAwareVariableStatusInfo { - if (data.isEmpty()) return PathAwareVariableStatusInfo.EMPTY - val result = data.map { (label, info) -> info.applyLabel(node, label) } - .reduce(PathAwareVariableStatusInfo::merge) - return (node.fir as? FirAnnotationContainer)?.annotations?.fold(result, ::visitAnnotation) - ?: result - } + ): PathAwareVariableStatusInfo = + super.visitNode(node, data).withAnnotationsFrom(node) + + override fun visitUnionNode( + node: T, + data: Collection> + ): PathAwareVariableStatusInfo where T : CFGNode<*>, T : UnionNodeMarker = + super.visitUnionNode(node, data).withAnnotationsFrom(node) override fun visitVariableDeclarationNode( node: VariableDeclarationNode, @@ -284,7 +296,7 @@ object UnusedChecker : FirControlFlowChecker() { node: FunctionCallNode, data: Collection> ): PathAwareVariableStatusInfo { - val dataForNode = visitNode(node, data) + val dataForNode = visitUnionNode(node, data) val reference = node.fir.calleeReference.resolved ?: return dataForNode val functionSymbol = reference.resolvedSymbol as? FirFunctionSymbol<*> ?: return dataForNode val symbol = if (functionSymbol.callableId.callableName.identifier == "invoke") { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt index a7b0c31bcf0..32619da5663 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt @@ -224,21 +224,13 @@ abstract class FirDataFlowAnalyzer( postponedLambdaEnterNode?.mergeIncomingFlow() functionEnterNode.mergeIncomingFlow { if (anonymousFunction.invocationKind?.canBeRevisited() != false) { - // TODO: if invocation can happen 0 times, there will be an edge from `functionEnterNode` - // to `functionExitNode`, so erasing statements here causes all information to be lost - // even though `statements from before && statements made inside the lambda` are correct. - // x = "" - // callUnknownNumberOfTimes { x = "" } - // /* x is String no matter how many times the lambda is called, but that information got lost */ enterCapturingStatement(it, anonymousFunction) } } } private fun exitAnonymousFunction(anonymousFunction: FirAnonymousFunction): FirControlFlowGraphReference { - getOrCreateLocalVariableAssignmentAnalyzer(anonymousFunction)?.exitLocalFunction( - anonymousFunction - ) + getOrCreateLocalVariableAssignmentAnalyzer(anonymousFunction)?.exitLocalFunction(anonymousFunction) val (functionExitNode, postponedLambdaExitNode, graph) = graphBuilder.exitAnonymousFunction(anonymousFunction) if (anonymousFunction.invocationKind?.canBeRevisited() != false) { exitCapturingStatement(anonymousFunction) @@ -248,6 +240,7 @@ abstract class FirDataFlowAnalyzer( // Data flow changed, need to recompute. TODO: this violates the "flow computed only once" principle. postponedLambdaExitNode.mergeIncomingFlow() } else { + // The current node should be `postponedLambdaExitNode` but we don't get a reference to it. resetReceivers() } return FirControlFlowGraphReferenceImpl(graph) @@ -350,13 +343,9 @@ abstract class FirDataFlowAnalyzer( // ----------------------------------- Delegate ----------------------------------- - fun enterDelegateExpression() { - graphBuilder.enterDelegateExpression() - } + fun enterDelegateExpression() {} - fun exitDelegateExpression() { - graphBuilder.exitDelegateExpression() - } + fun exitDelegateExpression() {} // ----------------------------------- Block ----------------------------------- @@ -601,13 +590,15 @@ abstract class FirDataFlowAnalyzer( // ----------------------------------- Check not null call ----------------------------------- + fun enterCheckNotNullCall() { + graphBuilder.enterCall() + } + fun exitCheckNotNullCall(checkNotNullCall: FirCheckNotNullCall, callCompleted: Boolean) { - val (node, unionNode) = graphBuilder.exitCheckNotNullCall(checkNotNullCall, callCompleted) - node.mergeIncomingFlow { flow -> + graphBuilder.exitCheckNotNullCall(checkNotNullCall, callCompleted).mergeIncomingFlow { flow -> val argumentVariable = variableStorage.getOrCreateIfReal(flow, checkNotNullCall.argument) ?: return@mergeIncomingFlow flow.commitOperationStatement(argumentVariable notEq null) } - unionNode?.unionFlowFromArguments() } // ----------------------------------- When ----------------------------------- @@ -644,8 +635,9 @@ abstract class FirDataFlowAnalyzer( graphBuilder.exitWhenBranchResult(whenBranch).mergeIncomingFlow() } - fun exitWhenExpression(whenExpression: FirWhenExpression) { - val (whenExitNode, syntheticElseNode, mergePostponedLambdaExitsNode) = graphBuilder.exitWhenExpression(whenExpression) + fun exitWhenExpression(whenExpression: FirWhenExpression, callCompleted: Boolean) { + val (whenExitNode, syntheticElseNode, mergePostponedLambdaExitsNode) = + graphBuilder.exitWhenExpression(whenExpression, callCompleted) syntheticElseNode?.mergeWhenBranchEntryFlow() whenExitNode.mergeIncomingFlow() mergePostponedLambdaExitsNode?.mergeIncomingFlow() @@ -789,9 +781,9 @@ abstract class FirDataFlowAnalyzer( } fun exitTryExpression(callCompleted: Boolean) { - val (tryExpressionExitNode, unionNode) = graphBuilder.exitTryExpression(callCompleted) + val (tryExpressionExitNode, mergePostponedLambdaExitsNode) = graphBuilder.exitTryExpression(callCompleted) tryExpressionExitNode.mergeIncomingFlow() - unionNode?.unionFlowFromArguments() + mergePostponedLambdaExitsNode?.mergeIncomingFlow() } // ----------------------------------- Resolvable call ----------------------------------- @@ -838,10 +830,6 @@ abstract class FirDataFlowAnalyzer( graphBuilder.exitResolvedQualifierNode(resolvedQualifier).mergeIncomingFlow() } - fun enterCall() { - graphBuilder.enterCall() - } - private tailrec fun FirExpression.getAnonymousFunction(): FirAnonymousFunction? = when (this) { is FirAnonymousFunctionExpression -> anonymousFunction is FirLambdaArgumentExpression -> expression.getAnonymousFunction() @@ -850,7 +838,11 @@ abstract class FirDataFlowAnalyzer( private var functionCallLevel = 0 + @OptIn(PrivateForInline::class) fun enterFunctionCall(functionCall: FirFunctionCall) { + if (!ignoreFunctionCalls) { + graphBuilder.enterCall() + } val lambdaArgs = functionCall.arguments.mapNotNullTo(mutableSetOf()) { it.getAnonymousFunction() } val localVariableAssignmentAnalyzer = context.firLocalVariableAssignmentAnalyzer ?: if (lambdaArgs.isNotEmpty()) getOrCreateLocalVariableAssignmentAnalyzer(lambdaArgs.first()) else null @@ -863,26 +855,27 @@ abstract class FirDataFlowAnalyzer( functionCallLevel-- context.firLocalVariableAssignmentAnalyzer?.exitFunctionCall(callCompleted) if (ignoreFunctionCalls) { - graphBuilder.exitIgnoredCall(functionCall) return } - val (functionCallNode, unionNode) = graphBuilder.exitFunctionCall(functionCall, callCompleted) - unionNode?.unionFlowFromArguments() - functionCallNode.mergeIncomingFlow { + graphBuilder.exitFunctionCall(functionCall, callCompleted).mergeIncomingFlow { processConditionalContract(it, functionCall) } } + fun enterDelegatedConstructorCall() { + graphBuilder.enterCall() + } + fun exitDelegatedConstructorCall(call: FirDelegatedConstructorCall, callCompleted: Boolean) { - val (callNode, unionNode) = graphBuilder.exitDelegatedConstructorCall(call, callCompleted) - unionNode?.unionFlowFromArguments() - callNode.mergeIncomingFlow() + graphBuilder.exitDelegatedConstructorCall(call, callCompleted).mergeIncomingFlow() + } + + fun enterStringConcatenationCall() { + graphBuilder.enterCall() } fun exitStringConcatenationCall(call: FirStringConcatenationCall) { - val (callNode, unionNode) = graphBuilder.exitStringConcatenationCall(call) - unionNode?.unionFlowFromArguments() - callNode.mergeIncomingFlow() + graphBuilder.exitStringConcatenationCall(call).mergeIncomingFlow() } private fun FirQualifiedAccess.orderedArguments(callee: FirFunction): Array? { @@ -1164,8 +1157,8 @@ abstract class FirDataFlowAnalyzer( } } - fun exitElvis(elvisExpression: FirElvisExpression, isLhsNotNull: Boolean) { - val (node, mergePostponedLambdaExitsNode) = graphBuilder.exitElvis(isLhsNotNull) + fun exitElvis(elvisExpression: FirElvisExpression, isLhsNotNull: Boolean, callCompleted: Boolean) { + val (node, mergePostponedLambdaExitsNode) = graphBuilder.exitElvis(isLhsNotNull, callCompleted) node.mergeIncomingFlow { flow -> // If LHS is never null, then the edge from RHS is dead and this node's flow already contains // all statements from LHS unconditionally. @@ -1218,7 +1211,7 @@ abstract class FirDataFlowAnalyzer( val incomingEdgeKind = incomingEdges.getValue(it).kind it.takeIf { incomingEdgeKind.usedInDfa || (isDead && incomingEdgeKind.usedInDeadDfa) }?.flow } - val result = logicSystem.joinFlow(previousFlows, union = false) + val result = logicSystem.joinFlow(previousFlows, union = this is UnionNodeMarker) if (graphBuilder.lastNodeOrNull == this) { // Here it is, the new `lastNode`. If the previous state is the only predecessor, then there is actually // nothing to update; `addTypeStatement` has already ensured we have the correct information. @@ -1230,11 +1223,6 @@ abstract class FirDataFlowAnalyzer( return result } - @OptIn(CfgInternals::class) - private fun UnionFunctionCallArgumentsNode.unionFlowFromArguments() { - flow = logicSystem.joinFlow(previousNodes.map { it.flow }, union = true).freeze() - } - @OptIn(CfgInternals::class) private fun CFGNode<*>.setFlow(builder: MutableFlow): PersistentFlow { val flow = builder.freeze().also { this.flow = it } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt index 65ce231728f..4ff7f3a505a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphBuilder.kt @@ -5,8 +5,7 @@ package org.jetbrains.kotlin.fir.resolve.dfa.cfg -import org.jetbrains.kotlin.contracts.description.EventOccurrencesRange -import org.jetbrains.kotlin.contracts.description.isInPlace +import org.jetbrains.kotlin.contracts.description.* import org.jetbrains.kotlin.fir.FirElement import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.utils.hasExplicitBackingField @@ -23,7 +22,6 @@ import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.util.ListMultimap import org.jetbrains.kotlin.fir.util.listMultimapOf import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor -import org.jetbrains.kotlin.utils.addToStdlib.popLast import org.jetbrains.kotlin.utils.addToStdlib.runIf import kotlin.random.Random @@ -51,21 +49,6 @@ class ControlFlowGraphBuilder { private val modes: Stack = stackOf(Mode.TopLevel) private val mode: Mode get() = modes.top() - /* - * TODO: it's temporary hack for anonymous functions resolved twice in delegate expressions - * Example: val x: Boolean by lazy { true } - * - * Note that this hack breaks passing data flow from inplace lambdas inside lambdas of delegates: - * val x: Boolean by lazy { - * val b: Any = ... - * run { - * require(b is Boolean) - * } - * b // there will be no smartcast, but it should be - * } - */ - private val shouldPassFlowFromInplaceLambda: Stack = stackOf(true) - private enum class Mode { Function, TopLevel, Body, ClassInitializer, PropertyInitializer, FieldInitializer } @@ -80,16 +63,13 @@ class ControlFlowGraphBuilder { //return jumps via finally blocks, target -> jumps private val nonDirectJumps: ListMultimap, CFGNode<*>> = listMultimapOf() - private val postponedLambdas: MutableSet> = mutableSetOf() - private val entersToPostponedAnonymousFunctions: MutableMap, PostponedLambdaEnterNode> = mutableMapOf() - private val exitsFromPostponedAnonymousFunctions: MutableMap, PostponedLambdaExitNode> = mutableMapOf() - private val parentGraphForAnonymousFunctions: MutableMap, ControlFlowGraph> = mutableMapOf() + private val postponedAnonymousFunctionNodes = + mutableMapOf, Pair>() + private val dataFlowSourcesForNextCompletedCall: Stack>> = stackOf() private val loopConditionEnterNodes: NodeStorage = NodeStorage() private val loopExitNodes: NodeStorage = NodeStorage() - private val exitsFromCompletedPostponedAnonymousFunctions: MutableList>> = mutableListOf() - private val whenExitNodes: NodeStorage = NodeStorage() private val whenBranchIndices: Stack> = stackOf() @@ -111,25 +91,6 @@ class ControlFlowGraphBuilder { private val notCompletedFunctionCalls: Stack> = stackOf() - /* - * ignoredFunctionCalls is needed for resolve of += operator: - * we have two different calls for resolve, but we left only one of them, - * so we twice call `enterCall` and twice increase `levelCounter`, but - * `exitFunctionCall` we call only once. - * - * So workflow looks like that: - * Calls: - * - a.plus(b) // (1) - * - a.plusAssign(b) // (2) - * - * enterCall(a.plus(b)), increase counter - * exitIgnoredCall(a.plus(b)) // decrease counter - * enterCall(a.plusAssign(b)) // increase counter - * exitIgnoredCall(a.plusAssign(b)) // decrease counter - * exitFunctionCall(a.plus(b) | a.plusAssign(b)) // don't touch counter - */ - private val ignoredFunctionCalls: MutableSet = mutableSetOf() - // ----------------------------------- API for node builders ----------------------------------- private var idCounter: Int = Random.nextInt() @@ -245,90 +206,76 @@ class ControlFlowGraphBuilder { } // ----------------------------------- Anonymous function ----------------------------------- - + // TODO: this is ALL WRONG. + // + // There are two cases we need to distinguish. + // + // 1. Function calls can have contracts that specify lambdas as "called in place". + // This only works on lambdas DIRECTLY used as function arguments. So `f({ a })`, + // and not `f(if (p) { { a } } else { { b } })`. + // + // 2. Every other place where a lambda's type is context-dependent. In this case + // we can't analyze the lambda just yet, but that doesn't matter since the lambda + // is not "called in place" so neither control nor data flow will pass through it. + // + // So case 2 is simple: add a placeholder node, then when we analyze the lambda attach + // it as a subgraph to that node. If that node is an argument to a function call, + // it should only be placed after every other argument to have control flow pass through + // them before entering the lambda. + // + // Case 1 is where the fun, for some definition of "fun", happens. + // + // In the basic case (completed call), control and data flow should look like this: + // /---> [EXACTLY_ONCE] --\ + // |--> [AT_LEAST_ONCE] --| + // |<-----------------/ | + // [arguments] -+ /------------v +-> function call + // |--> [AT_MOST_ONCE] ---| + // |<--------------\ | + // \-----> [UNKNOWN] -----/ + // \----------^ + // This is already problematic, since all these lambdas should share ONE entry node + // to which control can return after AT_LEAST_ONCE and UNKNOWN lambdas. To make + // matters worse, if the call is not complete, then the lambdas inside it *and* + // other lambdas in whatever expression this is a part of can be resolved in any order, + // so the data flow cannot look like this - until some call is finally completed, there + // will be holes in the graph where some lambdas' subgraphs should be. Instead, we + // should be collecting the lambdas as they are being resolved, filling gaps in the + // control flow graph, and then redirecting the outgoing data flow edges into the next + // completed call node. Unfortunately, I'm not sure how this fits into the subgraph + // design. Also, touching the `PostponedLambda{Enter,Exit}Node`s in any way seem to + // break random stuff that probably looks at `node.fir` with zero regard as to what + // the node even means. fun visitPostponedAnonymousFunction(anonymousFunctionExpression: FirAnonymousFunctionExpression): Pair { val anonymousFunction = anonymousFunctionExpression.anonymousFunction val enterNode = createPostponedLambdaEnterNode(anonymousFunction) val exitNode = createPostponedLambdaExitNode(anonymousFunctionExpression) val symbol = anonymousFunction.symbol - postponedLambdas += symbol - entersToPostponedAnonymousFunctions[symbol] = enterNode - exitsFromPostponedAnonymousFunctions[symbol] = exitNode - parentGraphForAnonymousFunctions[symbol] = currentGraph - popAndAddEdge(enterNode, preferredKind = EdgeKind.Forward) - addEdge(enterNode, exitNode, preferredKind = EdgeKind.DfgForward) - lastNodes.push(exitNode) + postponedAnonymousFunctionNodes[symbol] = enterNode to exitNode + addNewSimpleNode(enterNode) + addNewSimpleNode(exitNode, preferredKind = EdgeKind.DfgForward) return enterNode to exitNode } fun enterAnonymousFunction(anonymousFunction: FirAnonymousFunction): Pair { - val invocationKind = anonymousFunction.invocationKind - - var previousNodeIsNew = false val symbol = anonymousFunction.symbol - val previousNode = entersToPostponedAnonymousFunctions[symbol] - ?: createPostponedLambdaEnterNode(anonymousFunction).also { - addNewSimpleNode(it) - entersToPostponedAnonymousFunctions[symbol] = it - previousNodeIsNew = true - } - - if (previousNodeIsNew) { - assert(symbol !in exitsFromPostponedAnonymousFunctions) - val lambdaExpression = buildAnonymousFunctionExpression { - source = anonymousFunction.source - this.anonymousFunction = anonymousFunction - } - val exitFromLambda = createPostponedLambdaExitNode(lambdaExpression).also { - exitsFromPostponedAnonymousFunctions[symbol] = it - } - addEdge(previousNode, exitFromLambda) - } + val preparedEnterNode = postponedAnonymousFunctionNodes[symbol]?.first + val outerEnterNode = preparedEnterNode ?: createPostponedLambdaEnterNode(anonymousFunction).also { addNewSimpleNode(it) } pushGraph(ControlFlowGraph(anonymousFunction, "", ControlFlowGraph.Kind.AnonymousFunction), Mode.Function) - - val enterNode = createFunctionEnterNode(anonymousFunction).also { - if (previousNodeIsNew) { - addNewSimpleNode(it) - } else { - addEdge(previousNode, it) - lastNodes.push(it) - } - } - val exitNode = createFunctionExitNode(anonymousFunction).also { - exitsOfAnonymousFunctions[symbol] = it - exitTargetsForReturn.push(it) - if (!invocationKind.isInPlace) { - exitTargetsForTry.push(it) - } + val enterNode = createFunctionEnterNode(anonymousFunction) + val exitNode = createFunctionExitNode(anonymousFunction) + exitsOfAnonymousFunctions[symbol] = exitNode + exitTargetsForReturn.push(exitNode) + if (!anonymousFunction.invocationKind.isInPlace) { + exitTargetsForTry.push(exitNode) } - if (invocationKind.hasTowardEdge) { - addEdge(enterNode, exitNode) - } - if (invocationKind.hasBackEdge) { - addBackEdge(exitNode, enterNode) - } - - return if (previousNodeIsNew) { - previousNode to enterNode - } else { - null to enterNode - } + addEdge(outerEnterNode, enterNode) + lastNodes.push(enterNode) + return outerEnterNode.takeIf { preparedEnterNode == null } to enterNode } - private val EventOccurrencesRange?.hasTowardEdge: Boolean - get() = when (this) { - EventOccurrencesRange.AT_MOST_ONCE, EventOccurrencesRange.UNKNOWN -> true - else -> false - } - - private val EventOccurrencesRange?.hasBackEdge: Boolean - get() = when (this) { - EventOccurrencesRange.AT_LEAST_ONCE, EventOccurrencesRange.MORE_THAN_ONCE, EventOccurrencesRange.UNKNOWN -> true - else -> false - } - fun exitAnonymousFunction(anonymousFunction: FirAnonymousFunction): Triple { val symbol = anonymousFunction.symbol val exitNode = exitsOfAnonymousFunctions.remove(symbol)!!.also { @@ -344,51 +291,46 @@ class ControlFlowGraphBuilder { assert(graph.declaration == anonymousFunction) assert(graph.exitNode == exitNode) // TODO: disregarding the edges is probably not correct, though this should never find any nodes anyway - exitsFromCompletedPostponedAnonymousFunctions.lastOrNull()?.removeAll { it.owner == graph } + dataFlowSourcesForNextCompletedCall.topOrNull()?.removeAll { it.owner == graph } } - val postponedEnterNode = entersToPostponedAnonymousFunctions.remove(symbol)!! - val postponedExitNode = exitsFromPostponedAnonymousFunctions.remove(symbol)!! - - val lambdaIsPostponedFromCall = postponedLambdas.remove(symbol) - if (!lambdaIsPostponedFromCall) { - lastNodes.push(postponedExitNode) - } + val (postponedEnterNode, postponedExitNode) = postponedAnonymousFunctionNodes.remove(symbol) + ?: return Triple(exitNode, null, graph).also { (lastNode as PostponedLambdaEnterNode).owner.addSubGraph(graph) } val invocationKind = anonymousFunction.invocationKind - val maybeNonZero = invocationKind != null && invocationKind != EventOccurrencesRange.ZERO - val maybeZero = invocationKind != EventOccurrencesRange.AT_LEAST_ONCE && - invocationKind != EventOccurrencesRange.EXACTLY_ONCE && - invocationKind != EventOccurrencesRange.MORE_THAN_ONCE - // Four cases we handle differently here: - // 1. function not called in-place: data and control flow skips the function, - // and any assignment inside the function invalidates smart casts - // 2. function never executed (EventOccurrencesRange.ZERO): same as above, - // but without smart cast invalidation - // 3. function executed at least once (or exactly once or more than once): - // control flow merged from postponedEnterNode and exitNode into postponedExitNode, - // data flow goes from exitNode to the union of arguments of the call - // 4. function executed an unknown number of times (maybe zero, maybe not): - // both control flow and data flow merged from postponedEnterNode and exitNode - // into postponedExitNode - if (maybeZero) { - val kind = if (postponedExitNode.isDead) EdgeKind.DeadForward else EdgeKind.CfgForward - CFGNode.addJustKindEdge(postponedEnterNode, postponedExitNode, kind, propagateDeadness = true) + var changedExitDataFlow = false + // Lambdas not called in-place behave as if called never, but with extra invalidation of all smart casts + // for all variables that they reassign. That second part is handled by `FirDataFlowAnalyzer`. + if (invocationKind?.isDefinitelyVisited() != true) { + // Data flow from enter -> exit already exists, only need to also mark that edge as control flow. + CFGNode.addJustKindEdge(postponedEnterNode, postponedExitNode, EdgeKind.CfgForward, propagateDeadness = true) } - if (maybeNonZero) { - addEdge(exitNode, postponedExitNode, preferredKind = if (maybeZero) EdgeKind.Forward else EdgeKind.CfgForward) - if (!maybeZero && shouldPassFlowFromInplaceLambda.top()) { - exitsFromCompletedPostponedAnonymousFunctions.lastOrNull()?.add(postponedExitNode) + if (invocationKind?.canBeVisited() == true) { + // TODO: existence of an `invocationKind` should imply that this is an argument to a call, and yet + // replacing this with `top()` breaks things. Hmm. + val currentCallsPostponedLambdas = dataFlowSourcesForNextCompletedCall.topOrNull() + // Since the skipping edge goes to `postponedExitNode` rather than `exitNode`, if + // we try to merge data flow for not-definitely-called lambdas from `exitNode` into the next call + // we won't get a correct result. TODO: that seems hacky and points to the edges being wrong. + if (currentCallsPostponedLambdas != null && invocationKind.isDefinitelyVisited()) { + // When a call has lambda arguments that the function says it will call in place, control goes through + // all other arguments, then through the lambdas in parallel, then out of the function call. This parallel + // (in terms of ordering, not multi-threaded or w/e) execution is represented with the call being a union node. + // TODO: currently this is only done for data flow; control flow incorrectly pretends lambdas + // are called in the order they are provided to the call, which is wrong. This needs to be fixed. Somehow. + addEdge(exitNode, postponedExitNode, preferredKind = EdgeKind.CfgForward, propagateDeadness = true) + currentCallsPostponedLambdas.add(postponedExitNode) + } else { + addEdge(exitNode, postponedExitNode, propagateDeadness = invocationKind.isDefinitelyVisited()) + changedExitDataFlow = true + } + if (invocationKind.canBeRevisited()) { + addBackEdge(postponedExitNode, postponedEnterNode) } } - val containingGraph = parentGraphForAnonymousFunctions.remove(symbol) ?: currentGraph - containingGraph.addSubGraph(graph) - return if (lambdaIsPostponedFromCall && !(maybeNonZero && maybeZero)) { - Triple(exitNode, null, graph) - } else { - Triple(exitNode, postponedExitNode, graph) - } + postponedEnterNode.owner.addSubGraph(graph) + return Triple(exitNode, postponedExitNode.takeIf { changedExitDataFlow }, graph) } fun exitAnonymousFunctionExpression(anonymousFunctionExpression: FirAnonymousFunctionExpression): AnonymousFunctionExpressionExitNode { @@ -397,6 +339,72 @@ class ControlFlowGraphBuilder { } } + private fun splitDataFlowForPostponedLambdas() { + dataFlowSourcesForNextCompletedCall.push(mutableListOf()) + } + + private fun MutableList>.addPostponedLambdaDataFlowEdgesTo(node: CFGNode<*>) { + for (exitNode in this) { + // To avoid storing nodes from subgraphs in the list, we have PostponedLambdaExitNode instead of the real + // exit node of the lambda subgraph. The latter is the previous node of the former. Everything else is + // already a join node in this graph. + val functionExitOrMerge = if (exitNode is PostponedLambdaExitNode) exitNode.lastPreviousNode else exitNode + addEdge(functionExitOrMerge, node, preferredKind = EdgeKind.DfgForward, propagateDeadness = false) + } + } + + private fun unifyDataFlowFromPostponedLambdas(node: T, callCompleted: Boolean) where T : CFGNode<*>, T : UnionNodeMarker { + val currentLevelExits = dataFlowSourcesForNextCompletedCall.pop() + if (currentLevelExits.isEmpty()) return + val nextLevelExits = dataFlowSourcesForNextCompletedCall.topOrNull().takeIf { !callCompleted } + if (nextLevelExits != null) { + // Call is incomplete, don't pass data flow from lambdas inside it to lambdas in the outer call. + nextLevelExits.addAll(currentLevelExits) + } else { + currentLevelExits.addPostponedLambdaDataFlowEdgesTo(node) + } + } + + // There may be branching expressions on the way from a called-in-place lambda + // to the next completed call: + // + // f(if (p) { x; run { a } else { y; run { b } }, c) + // + // which result in a hole-y control flow graph at the time when we need to resolve `c`: + // + // p -+--> x -> ?? -> run#1 --+-> c -> f + // \-> y -> ?? -> run#2 -/ + // + // Ideally, we want to pretend that the lambdas are not called-in-place until we get + // to `f`, at which point the lambdas are guaranteed to be resolved and we should be + // able to reconstruct the entire data flow. The problem is that the call/when/etc. + // exit nodes on the way from the lambda to the function call exit node can have + // statements attached to them, so unless we want to re-do all the work, it's too late + // by the time we get there. And we can't just forever ignore the lambdas either, as + // they may reassign variables and so the data we've gathered about them should be + // invalidated. So what we do here is merge the data from the lambdas with the data + // obtained without them: this can only erase statements that are not provably correct. + private fun mergeDataFlowFromPostponedLambdas(node: CFGNode<*>, callCompleted: Boolean): MergePostponedLambdaExitsNode? { + val currentLevelExits = dataFlowSourcesForNextCompletedCall.pop() + if (currentLevelExits.isEmpty()) return null + + val nextLevelExits = dataFlowSourcesForNextCompletedCall.topOrNull().takeIf { !callCompleted } + return if (nextLevelExits != null) { + // Call is incomplete, don't pass data flow from lambdas inside it to lambdas in the outer call. + // TODO: this is wrong, we don't necessarily have all the lambdas yet... Also, + // the lambdas in the list can come from different branches, and this should be + // more like merge(node, union(lambdas from branch 1), ..., union(from branch N)). + createMergePostponedLambdaExitsNode(node.fir).also { + addEdge(node, it) + currentLevelExits.addPostponedLambdaDataFlowEdgesTo(it) + nextLevelExits.add(it) + } + } else { + currentLevelExits.addPostponedLambdaDataFlowEdgesTo(node) + null + } + } + // ----------------------------------- Classes ----------------------------------- fun enterClass() { @@ -639,16 +647,6 @@ class ControlFlowGraphBuilder { return exitNode to graph } - // ----------------------------------- Delegate ----------------------------------- - - fun enterDelegateExpression() { - shouldPassFlowFromInplaceLambda.push(false) - } - - fun exitDelegateExpression() { - shouldPassFlowFromInplaceLambda.pop() - } - // ----------------------------------- Operator call ----------------------------------- fun exitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall): TypeOperatorCallNode { @@ -709,6 +707,10 @@ class ControlFlowGraphBuilder { return node } + fun exitWhenSubjectExpression(expression: FirWhenSubjectExpression): WhenSubjectExpressionExitNode { + return createWhenSubjectExpressionExitNode(expression).also { addNewSimpleNode(it) } + } + fun enterWhenBranchCondition(whenBranch: FirWhenBranch): WhenBranchConditionEnterNode { levelCounter += whenBranchIndices.top().getValue(whenBranch) return createWhenBranchConditionEnterNode(whenBranch).also { addNewSimpleNode(it) }.also { levelCounter++ } @@ -737,7 +739,8 @@ class ControlFlowGraphBuilder { } fun exitWhenExpression( - whenExpression: FirWhenExpression + whenExpression: FirWhenExpression, + callCompleted: Boolean ): Triple { val whenExitNode = whenExitNodes.pop() // exit from last condition node still on stack @@ -754,7 +757,7 @@ class ControlFlowGraphBuilder { lastNodes.push(whenExitNode) levelCounter-- whenBranchIndices.pop() - return Triple(whenExitNode, syntheticElseBranchNode, joinDataFlowFromPostponedLambdasWith(whenExitNode)) + return Triple(whenExitNode, syntheticElseBranchNode, mergeDataFlowFromPostponedLambdas(whenExitNode, callCompleted)) } // ----------------------------------- While Loop ----------------------------------- @@ -1003,9 +1006,7 @@ class ControlFlowGraphBuilder { } } - fun exitTryExpression( - callCompleted: Boolean - ): Pair { + fun exitTryExpression(callCompleted: Boolean): Pair { levelCounter-- catchNodeStorages.pop() val catchExitNodes = catchExitNodeStorages.pop() @@ -1016,7 +1017,6 @@ class ControlFlowGraphBuilder { val node = tryExitNodes.pop() node.updateDeadStatus() lastNodes.push(node) - val (_, unionNode) = processUnionOfArguments(node, callCompleted) val allCatchesAreDead = tryMainExitNode.fir.catches.all { catch -> catchExitNodes[catch]!!.isDead } val tryMainBlockIsDead = tryMainExitNode.previousNodes.all { prev -> @@ -1029,7 +1029,7 @@ class ControlFlowGraphBuilder { lastNodes.push(stub) } - return node to unionNode + return node to mergeDataFlowFromPostponedLambdas(node, callCompleted) } //this is a workaround to make function call dead when call is completed _after_ building its node in the graph @@ -1088,49 +1088,36 @@ class ControlFlowGraphBuilder { splitDataFlowForPostponedLambdas() } - fun exitIgnoredCall(functionCall: FirFunctionCall) { + fun exitFunctionCall(functionCall: FirFunctionCall, callCompleted: Boolean): FunctionCallNode { levelCounter-- - ignoredFunctionCalls += functionCall - } - - fun exitFunctionCall(functionCall: FirFunctionCall, callCompleted: Boolean): Pair { - val callWasIgnored = ignoredFunctionCalls.remove(functionCall) - if (!callWasIgnored) { - levelCounter-- - } else { - ignoredFunctionCalls.clear() - } val returnsNothing = functionCall.resultType.isNothing val node = createFunctionCallNode(functionCall) - val (kind, unionNode) = processUnionOfArguments(node, callCompleted) + unifyDataFlowFromPostponedLambdas(node, callCompleted) if (returnsNothing) { - addNodeThatReturnsNothing(node, preferredKind = kind) + addNodeThatReturnsNothing(node) } else { - addNewSimpleNode(node, preferredKind = kind) + addNewSimpleNode(node) } if (!returnsNothing && !callCompleted) { notCompletedFunctionCalls.topOrNull()?.add(node) } - return node to unionNode + return node } - fun exitDelegatedConstructorCall( - call: FirDelegatedConstructorCall, - callCompleted: Boolean - ): Pair { + fun exitDelegatedConstructorCall(call: FirDelegatedConstructorCall, callCompleted: Boolean): DelegatedConstructorCallNode { levelCounter-- val node = createDelegatedConstructorCallNode(call) - val (kind, unionNode) = processUnionOfArguments(node, callCompleted) - addNewSimpleNode(node, preferredKind = kind) - return node to unionNode + unifyDataFlowFromPostponedLambdas(node, callCompleted) + addNewSimpleNode(node) + return node } - fun exitStringConcatenationCall(call: FirStringConcatenationCall): Pair { + fun exitStringConcatenationCall(call: FirStringConcatenationCall): StringConcatenationCallNode { levelCounter-- val node = createStringConcatenationCallNode(call) - val (kind, unionNode) = processUnionOfArguments(node, true) - addNewSimpleNode(node, preferredKind = kind) - return node to unionNode + unifyDataFlowFromPostponedLambdas(node, callCompleted = true) + addNewSimpleNode(node) + return node } fun exitConstExpression(constExpression: FirConstExpression<*>): ConstExpressionNode { @@ -1149,111 +1136,16 @@ class ControlFlowGraphBuilder { return createThrowExceptionNode(throwExpression).also { addNodeThatReturnsNothing(it) } } - fun exitCheckNotNullCall( - checkNotNullCall: FirCheckNotNullCall, - callCompleted: Boolean - ): Pair { + fun exitCheckNotNullCall(checkNotNullCall: FirCheckNotNullCall, callCompleted: Boolean): CheckNotNullCallNode { levelCounter-- val node = createCheckNotNullCallNode(checkNotNullCall) + unifyDataFlowFromPostponedLambdas(node, callCompleted) if (checkNotNullCall.resultType.isNothing) { addNodeThatReturnsNothing(node) } else { addNewSimpleNode(node) } - val unionNode = processUnionOfArguments(node, callCompleted).second - return node to unionNode - } - - // Arguments are evaluated left to right, and this is how data flows. - // foo(run { x as String; 1 }, { /* x smartcasted to String */ x.length }) - // - // However, as we need to fix type parameters before analyzing lambdas, this is not always the order of analysis; - // if that is possible, multiple lambdas should be considered to be concurrent. - // - // foo(run { x as String; genericFunction() }, run { /* x not smartcastable because this lambda may be resolved first */ 1 }) - // /* x is smartcastable after the call */ - // - // And if the lambda is conditional, then the data flow needs to be merged with other branches. - // - // foo(nullable?.let { x as String; genericFunction() }, run { 1 }) - // /* x is not smartcastable */ - // - // foo(nullable ?: run { x as String; genericFunction() }, run { 1 }) - // /* x is not smartcastable */ - // - // foo(if (condition) run { x as String; genericFunction() } else { genericFunction() }, run { 1 }) - // /* x is not smartcastable */ - // - // foo(if (condition) run { x as String; genericFunction() } else { x as String; genericFunction() }, run { 1 }) - // /* x is smartcastable */ - // - // `splitDataFlowForPostponedLambdas` in `enterX` should be matched with either `joinDataFlowFromPostponedLambdasWith` - // or `processUnionOfArguments` in `exitX`. The difference is that the latter creates an intersection of all the lambdas' - // type information (like after function calls - all casts from all lambdas are valid) while the former is a union - // (like after `if` - only the casts from one of the lambdas are valid, and we don't know which). - // - private fun splitDataFlowForPostponedLambdas() { - exitsFromCompletedPostponedAnonymousFunctions.add(mutableListOf()) - } - - private fun joinDataFlowFromPostponedLambdasWith(node: CFGNode<*>): MergePostponedLambdaExitsNode? { - val currentLevelExits = exitsFromCompletedPostponedAnonymousFunctions.popLast() - if (currentLevelExits.isEmpty()) { - return null - } - - val joinNode = createMergePostponedLambdaExitsNode(node.fir) - addEdge(node, joinNode) - currentLevelExits.joinDataFlowFromPostponedLambdasTo(joinNode) - exitsFromCompletedPostponedAnonymousFunctions.lastOrNull()?.add(joinNode) - return joinNode - } - - private fun MutableList>.joinDataFlowFromPostponedLambdasTo(node: CFGNode<*>) { - for (exitNode in this) { - // To avoid storing nodes from subgraphs in the list, we have PostponedLambdaExitNode instead of the real - // exit node of the lambda subgraph. The latter is the previous node of the former. Everything else is - // already a join/union node in this graph. - val functionExitOrMerge = if (exitNode is PostponedLambdaExitNode) exitNode.lastPreviousNode else exitNode - addEdge(functionExitOrMerge, node, preferredKind = EdgeKind.DfgForward) - } - } - - private fun processUnionOfArguments( - node: CFGNode<*>, - callCompleted: Boolean - ): Pair { - val currentLevelExits = exitsFromCompletedPostponedAnonymousFunctions.popLast() - if (currentLevelExits.isEmpty()) { - return EdgeKind.Forward to null - } - - if (!callCompleted || !shouldPassFlowFromInplaceLambda.top()) { - currentLevelExits.singleOrNull()?.let { - exitsFromCompletedPostponedAnonymousFunctions.lastOrNull()?.add(it) - return EdgeKind.Forward to null - } - - val unionNode = createUnionFunctionCallArgumentsNode(node.fir) - currentLevelExits.joinDataFlowFromPostponedLambdasTo(unionNode) - exitsFromCompletedPostponedAnonymousFunctions.lastOrNull()?.addAll(currentLevelExits) - return EdgeKind.Forward to unionNode - } - - val unionNode = createUnionFunctionCallArgumentsNode(node.fir) - currentLevelExits.joinDataFlowFromPostponedLambdasTo(unionNode) - - if (lastNode in currentLevelExits) { - popAndAddEdge(node, preferredKind = EdgeKind.CfgForward) - lastNodes.push(unionNode) - return EdgeKind.DfgForward to unionNode - } - addNewSimpleNode(unionNode) - return EdgeKind.Forward to unionNode - } - - fun exitWhenSubjectExpression(expression: FirWhenSubjectExpression): WhenSubjectExpressionExitNode { - return createWhenSubjectExpressionExitNode(expression).also { addNewSimpleNode(it) } + return node } // ----------------------------------- Annotations ----------------------------------- @@ -1354,7 +1246,8 @@ class ControlFlowGraphBuilder { return exitSafeCallNodes.pop().let { addNewSimpleNode(it) it.updateDeadStatus() - it to joinDataFlowFromPostponedLambdasWith(it) + // Safe calls only have one user-specified branch, so if any lambdas were postponed, they still are. + it to mergeDataFlowFromPostponedLambdas(it, callCompleted = false) } } @@ -1389,11 +1282,11 @@ class ControlFlowGraphBuilder { return Triple(lhsExitNode, lhsIsNotNullNode, rhsEnterNode) } - fun exitElvis(lhsIsNotNull: Boolean): Pair { + fun exitElvis(lhsIsNotNull: Boolean, callCompleted: Boolean): Pair { val exitNode = exitElvisExpressionNodes.pop() addNewSimpleNode(exitNode, isDead = lhsIsNotNull) exitNode.updateDeadStatus() - return exitNode to joinDataFlowFromPostponedLambdasWith(exitNode) + return exitNode to mergeDataFlowFromPostponedLambdas(exitNode, callCompleted) } // ----------------------------------- Contract description ----------------------------------- @@ -1417,7 +1310,7 @@ class ControlFlowGraphBuilder { fun reset() { exitsOfAnonymousFunctions.clear() - exitsFromCompletedPostponedAnonymousFunctions.clear() + dataFlowSourcesForNextCompletedCall.reset() lastNodes.reset() } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphNodeBuilder.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphNodeBuilder.kt index a4e3fd108dc..7f184bb14de 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphNodeBuilder.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphNodeBuilder.kt @@ -241,9 +241,6 @@ fun ControlFlowGraphBuilder.createScriptEnterNode(fir: FirScript): ScriptEnterNo fun ControlFlowGraphBuilder.createScriptExitNode(fir: FirScript): ScriptExitNode = ScriptExitNode(currentGraph, fir, levelCounter, createId()) -fun ControlFlowGraphBuilder.createUnionFunctionCallArgumentsNode(fir: FirElement): UnionFunctionCallArgumentsNode = - UnionFunctionCallArgumentsNode(currentGraph, fir, levelCounter, createId()) - fun ControlFlowGraphBuilder.createMergePostponedLambdaExitsNode(fir: FirElement): MergePostponedLambdaExitsNode = MergePostponedLambdaExitsNode(currentGraph, fir, levelCounter, createId()) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt index bec3f8e48f3..5881d9b6785 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt @@ -106,7 +106,7 @@ class FirControlFlowGraphRenderVisitor( } if (node.isDead) { fillColor("gray") - } else if (node is UnionFunctionCallArgumentsNode) { + } else if (node is UnionNodeMarker) { fillColor("yellow") } println(indices.getValue(node), attributes.joinToString(separator = " ", prefix = " [", postfix = "];")) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirControlFlowStatementsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirControlFlowStatementsResolveTransformer.kt index 0055733ecc5..656740e05ae 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirControlFlowStatementsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirControlFlowStatementsResolveTransformer.kt @@ -64,19 +64,21 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirAbstractBodyRes @Suppress("NAME_SHADOWING") var whenExpression = whenExpression.transformSubject(transformer, ResolutionMode.ContextIndependent) val subjectType = whenExpression.subject?.typeRef?.coneType?.fullyExpandedType(session) + var callCompleted = false context.withWhenSubjectType(subjectType, components) { when { whenExpression.branches.isEmpty() -> {} whenExpression.isOneBranch() -> { whenExpression = whenExpression.transformBranches(transformer, ResolutionMode.ContextIndependent) whenExpression.resultType = whenExpression.branches.first().result.resultType + // when with one branch cannot be completed if it's not already complete in the first place } else -> { whenExpression = whenExpression.transformBranches(transformer, ResolutionMode.ContextDependent) whenExpression = syntheticCallGenerator.generateCalleeForWhenExpression(whenExpression, resolutionContext) ?: run { whenExpression = whenExpression.transformSingle(whenExhaustivenessTransformer, null) - dataFlowAnalyzer.exitWhenExpression(whenExpression) + dataFlowAnalyzer.exitWhenExpression(whenExpression, callCompleted) whenExpression.resultType = buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Can't resolve when expression", DiagnosticKind.InferenceError) } @@ -85,10 +87,11 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirAbstractBodyRes val completionResult = callCompleter.completeCall(whenExpression, data) whenExpression = completionResult.result + callCompleted = completionResult.callCompleted } } whenExpression = whenExpression.transformSingle(whenExhaustivenessTransformer, null) - dataFlowAnalyzer.exitWhenExpression(whenExpression) + dataFlowAnalyzer.exitWhenExpression(whenExpression, callCompleted) whenExpression = whenExpression.replaceReturnTypeIfNotExhaustive() whenExpression } @@ -145,20 +148,12 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirAbstractBodyRes dataFlowAnalyzer.exitTryMainBlock() tryExpression.transformCatches(this, ResolutionMode.ContextDependent) - var callCompleted: Boolean - - @Suppress("NAME_SHADOWING") - var result = syntheticCallGenerator.generateCalleeForTryExpression(tryExpression, resolutionContext).let { - val completionResult = callCompleter.completeCall(it, data) - callCompleted = completionResult.callCompleted - completionResult.result - } - result = if (result.finallyBlock != null) { - result.also { dataFlowAnalyzer.enterFinallyBlock() } - .transformFinallyBlock(transformer, ResolutionMode.ContextIndependent) - .also { dataFlowAnalyzer.exitFinallyBlock() } - } else { - result + val incomplete = syntheticCallGenerator.generateCalleeForTryExpression(tryExpression, resolutionContext) + var (result, callCompleted) = callCompleter.completeCall(incomplete, data) + if (result.finallyBlock != null) { + dataFlowAnalyzer.enterFinallyBlock() + result = result.transformFinallyBlock(transformer, ResolutionMode.ContextIndependent) + dataFlowAnalyzer.exitFinallyBlock() } dataFlowAnalyzer.exitTryExpression(callCompleted) return result @@ -237,8 +232,11 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirAbstractBodyRes ) elvisExpression.transformRhs(transformer, resolutionModeForRhs) + var callCompleted = false val result = syntheticCallGenerator.generateCalleeForElvisExpression(elvisExpression, resolutionContext)?.let { - callCompleter.completeCall(it, data).result + val completed = callCompleter.completeCall(it, data) + callCompleted = completed.callCompleted + completed.result } ?: elvisExpression.also { it.resultType = buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Can't resolve ?: operator call", DiagnosticKind.InferenceError) @@ -270,7 +268,7 @@ class FirControlFlowStatementsResolveTransformer(transformer: FirAbstractBodyRes } } - dataFlowAnalyzer.exitElvis(elvisExpression, isLhsNotNull = isLhsNotNull) + dataFlowAnalyzer.exitElvis(elvisExpression, isLhsNotNull, callCompleted) return result } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 5e863f2022e..5ae2fd61687 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -270,6 +270,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirAbstractBodyResolve private fun transformPropertyAccessorsWithDelegate(property: FirProperty) { context.forPropertyDelegateAccessors(property, resolutionContext, callCompleter) { + dataFlowAnalyzer.enterDelegateExpression() // Resolve delegate expression, after that, delegate will contain either expr.provideDelegate or expr if (property.isLocal) { property.transformDelegate(transformer, ResolutionMode.ContextDependentDelegate) @@ -281,7 +282,6 @@ open class FirDeclarationsResolveTransformer(transformer: FirAbstractBodyResolve property.transformAccessors() val completedCalls = completeCandidates() - dataFlowAnalyzer.exitDelegateExpression() val finalSubstitutor = createFinalSubstitutor() @@ -297,6 +297,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirAbstractBodyResolve it.transformSingle(callCompletionResultsWriter, null) } + dataFlowAnalyzer.exitDelegateExpression() property } } @@ -311,7 +312,6 @@ open class FirDeclarationsResolveTransformer(transformer: FirAbstractBodyResolve wrappedDelegateExpression: FirWrappedDelegateExpression, data: ResolutionMode, ): FirStatement { - dataFlowAnalyzer.enterDelegateExpression() // First, resolve delegate expression in dependent context val delegateExpression = wrappedDelegateExpression.expression.transformSingle(transformer, ResolutionMode.ContextDependent) .transformSingle(components.integerLiteralAndOperatorApproximationTransformer, null) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index 904787a1853..ae44734ba3b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -376,7 +376,6 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT return functionCall } if (calleeReference is FirNamedReferenceWithCandidate) return functionCall - dataFlowAnalyzer.enterCall() functionCall.transformAnnotations(transformer, data) functionCall.transformSingle(InvocationKindTransformer, null) functionCall.transformTypeArguments(transformer, ResolutionMode.ContextIndependent) @@ -799,7 +798,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT return checkNotNullCall } - dataFlowAnalyzer.enterCall() + dataFlowAnalyzer.enterCheckNotNullCall() checkNotNullCall.argumentList.transformArguments(transformer, ResolutionMode.ContextDependent) checkNotNullCall.transformAnnotations(transformer, ResolutionMode.ContextIndependent) @@ -1120,7 +1119,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT }) } - dataFlowAnalyzer.enterCall() + dataFlowAnalyzer.enterDelegatedConstructorCall() var callCompleted = true var result = delegatedConstructorCall try { @@ -1468,7 +1467,7 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT stringConcatenationCall: FirStringConcatenationCall, data: ResolutionMode ): FirStatement = whileAnalysing(stringConcatenationCall) { - dataFlowAnalyzer.enterCall() + dataFlowAnalyzer.enterStringConcatenationCall() stringConcatenationCall.transformChildren(transformer, ResolutionMode.ContextIndependent) dataFlowAnalyzer.exitStringConcatenationCall(stringConcatenationCall) return stringConcatenationCall diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNode.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNode.kt index 18383894fb4..4a20db3b7e6 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNode.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNode.kt @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.fir.resolve.dfa.PersistentFlow import org.jetbrains.kotlin.fir.resolve.dfa.controlFlowGraph import org.jetbrains.kotlin.fir.visitors.FirTransformer import org.jetbrains.kotlin.fir.visitors.FirVisitor -import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addToStdlib.runIf @RequiresOptIn @@ -134,9 +133,14 @@ sealed class CFGNode(val owner: ControlFlowGraph, val level: @CfgInternals fun updateDeadStatus() { - isDead = incomingEdges.size == previousNodes.size && incomingEdges.values.all { - it.kind == EdgeKind.DeadForward || !it.kind.usedInCfa - } + isDead = if (this is UnionNodeMarker) + incomingEdges.values.any { + it.kind == EdgeKind.DeadForward + } + else + incomingEdges.size == previousNodes.size && incomingEdges.values.all { + it.kind == EdgeKind.DeadForward || !it.kind.usedInCfa + } } abstract fun accept(visitor: ControlFlowGraphVisitor, data: D): R @@ -161,6 +165,12 @@ val CFGNode<*>.lastPreviousNode: CFGNode<*> get() = previousNodes.last() interface EnterNodeMarker interface ExitNodeMarker +// a ---> b ---> d +// \-> c -/ +// Normal CFG semantics: a, then either b or c, then d +// If d is an instance of this interface: a, then *both* b and c in some unknown order, then d +interface UnionNodeMarker + // ----------------------------------- EnterNode for declaration with CFG ----------------------------------- sealed class CFGNodeWithSubgraphs(owner: ControlFlowGraph, level: Int, id: Int) : CFGNode(owner, level, id) { @@ -242,12 +252,6 @@ class PostponedLambdaExitNode(owner: ControlFlowGraph, override val fir: FirAnon } } -class UnionFunctionCallArgumentsNode(owner: ControlFlowGraph, override val fir: FirElement, level: Int, id: Int) : CFGNode(owner, level, id) { - override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { - return visitor.visitUnionFunctionCallArgumentsNode(this, data) - } -} - class MergePostponedLambdaExitsNode(owner: ControlFlowGraph, override val fir: FirElement, level: Int, id: Int) : CFGNode(owner, level, id) { override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { return visitor.visitMergePostponedLambdaExitsNode(this, data) @@ -661,7 +665,8 @@ class ConstExpressionNode(owner: ControlFlowGraph, override val fir: FirConstExp // ----------------------------------- Check not null call ----------------------------------- -class CheckNotNullCallNode(owner: ControlFlowGraph, override val fir: FirCheckNotNullCall, level: Int, id: Int) : CFGNode(owner, level, id) { +class CheckNotNullCallNode(owner: ControlFlowGraph, override val fir: FirCheckNotNullCall, level: Int, id: Int) + : CFGNode(owner, level, id), UnionNodeMarker { override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { return visitor.visitCheckNotNullCallNode(this, data) } @@ -689,11 +694,8 @@ class ResolvedQualifierNode( } } -class FunctionCallNode( - owner: ControlFlowGraph, - override val fir: FirFunctionCall, - level: Int, id: Int -) : CFGNode(owner, level, id) { +class FunctionCallNode(owner: ControlFlowGraph, override val fir: FirFunctionCall, level: Int, id: Int) + : CFGNode(owner, level, id), UnionNodeMarker { override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { return visitor.visitFunctionCallNode(this, data) } @@ -715,23 +717,15 @@ class GetClassCallNode(owner: ControlFlowGraph, override val fir: FirGetClassCal } } -class DelegatedConstructorCallNode( - owner: ControlFlowGraph, - override val fir: FirDelegatedConstructorCall, - level: Int, - id: Int -) : CFGNode(owner, level, id) { +class DelegatedConstructorCallNode(owner: ControlFlowGraph, override val fir: FirDelegatedConstructorCall, level: Int, id: Int) + : CFGNode(owner, level, id), UnionNodeMarker { override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { return visitor.visitDelegatedConstructorCallNode(this, data) } } -class StringConcatenationCallNode( - owner: ControlFlowGraph, - override val fir: FirStringConcatenationCall, - level: Int, - id: Int -) : CFGNode(owner, level, id) { +class StringConcatenationCallNode(owner: ControlFlowGraph, override val fir: FirStringConcatenationCall, level: Int, id: Int) + : CFGNode(owner, level, id), UnionNodeMarker { override fun accept(visitor: ControlFlowGraphVisitor, data: D): R { return visitor.visitStringConcatenationCallNode(this, data) } diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNodeRenderer.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNodeRenderer.kt index c46d359261b..a1c7b8bb482 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNodeRenderer.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/CFGNodeRenderer.kt @@ -102,7 +102,6 @@ fun CFGNode<*>.render(): String = is AnonymousFunctionExpressionExitNode -> "Exit anonymous function expression" - is UnionFunctionCallArgumentsNode -> "Call arguments union" is MergePostponedLambdaExitsNode -> "Merge postponed lambda exits" is ClassEnterNode -> "Enter class ${owner.name}" diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitor.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitor.kt index 7587ea5f24e..cb849c9b16f 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitor.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitor.kt @@ -8,6 +8,8 @@ package org.jetbrains.kotlin.fir.resolve.dfa.cfg abstract class ControlFlowGraphVisitor { abstract fun visitNode(node: CFGNode<*>, data: D): R + abstract fun visitUnionNode(node: T, data: D): R where T : CFGNode<*>, T : UnionNodeMarker + // ----------------------------------- Simple function ----------------------------------- open fun visitFunctionEnterNode(node: FunctionEnterNode, data: D): R { @@ -42,10 +44,6 @@ abstract class ControlFlowGraphVisitor { return visitNode(node, data) } - open fun visitUnionFunctionCallArgumentsNode(node: UnionFunctionCallArgumentsNode, data: D): R { - return visitNode(node, data) - } - open fun visitMergePostponedLambdaExitsNode(node: MergePostponedLambdaExitsNode, data: D): R { return visitNode(node, data) } @@ -296,7 +294,7 @@ abstract class ControlFlowGraphVisitor { // ----------------------------------- Check not null call ----------------------------------- open fun visitCheckNotNullCallNode(node: CheckNotNullCallNode, data: D): R { - return visitNode(node, data) + return visitUnionNode(node, data) } // ----------------------------------- Resolvable call ----------------------------------- @@ -310,7 +308,7 @@ abstract class ControlFlowGraphVisitor { } open fun visitFunctionCallNode(node: FunctionCallNode, data: D): R { - return visitNode(node, data) + return visitUnionNode(node, data) } open fun visitCallableReferenceNode(node: CallableReferenceNode, data: D): R { @@ -322,11 +320,11 @@ abstract class ControlFlowGraphVisitor { } open fun visitDelegatedConstructorCallNode(node: DelegatedConstructorCallNode, data: D): R { - return visitNode(node, data) + return visitUnionNode(node, data) } open fun visitStringConcatenationCallNode(node: StringConcatenationCallNode, data: D): R { - return visitNode(node, data) + return visitUnionNode(node, data) } open fun visitThrowExceptionNode(node: ThrowExceptionNode, data: D): R { diff --git a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitorVoid.kt b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitorVoid.kt index efe5cede981..f1dfeac56c5 100644 --- a/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitorVoid.kt +++ b/compiler/fir/semantics/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphVisitorVoid.kt @@ -8,7 +8,9 @@ package org.jetbrains.kotlin.fir.resolve.dfa.cfg abstract class ControlFlowGraphVisitorVoid : ControlFlowGraphVisitor() { abstract fun visitNode(node: CFGNode<*>) - // ----------------------------------- Simple function ----------------------------------- + abstract fun visitUnionNode(node: T) where T : CFGNode<*>, T : UnionNodeMarker + + // ----------------------------------- Simple function ----------------------------------- open fun visitFunctionEnterNode(node: FunctionEnterNode) { visitNode(node) @@ -28,10 +30,6 @@ abstract class ControlFlowGraphVisitorVoid : ControlFlowGraphVisitor visitUnionNode(node: T, data: Nothing?) where T : CFGNode<*>, T : UnionNodeMarker { + visitUnionNode(node) + } + // ----------------------------------- Simple function ----------------------------------- final override fun visitFunctionEnterNode(node: FunctionEnterNode, data: Nothing?) { @@ -317,10 +319,6 @@ abstract class ControlFlowGraphVisitorVoid : ControlFlowGraphVisitor {1}; @@ -22,7 +22,7 @@ digraph kt44814_kt { subgraph cluster_2 { color=red 5 [label="Enter function [2]" style="filled" fillcolor=red]; - 6 [label="Delegated constructor call: super() [2]"]; + 6 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 7 [label="Exit function [2]" style="filled" fillcolor=red]; } 5 -> {6}; @@ -38,7 +38,7 @@ digraph kt44814_kt { subgraph cluster_4 { color=red 10 [label="Enter function [2]" style="filled" fillcolor=red]; - 11 [label="Delegated constructor call: super() [2]"]; + 11 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 12 [label="Exit function [2]" style="filled" fillcolor=red]; } 10 -> {11}; @@ -96,7 +96,7 @@ digraph kt44814_kt { subgraph cluster_9 { color=red 27 [label="Enter function [2]" style="filled" fillcolor=red]; - 28 [label="Delegated constructor call: super() [2]"]; + 28 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 29 [label="Exit function [2]" style="filled" fillcolor=red]; } 27 -> {28}; @@ -140,7 +140,7 @@ digraph kt44814_kt { subgraph cluster_13 { color=red 40 [label="Enter function [2]" style="filled" fillcolor=red]; - 41 [label="Delegated constructor call: super() [2]"]; + 41 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 42 [label="Exit function [2]" style="filled" fillcolor=red]; } 40 -> {41}; @@ -156,7 +156,7 @@ digraph kt44814_kt { subgraph cluster_15 { color=red 45 [label="Enter function [2]" style="filled" fillcolor=red]; - 46 [label="Delegated constructor call: super() [2]"]; + 46 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 47 [label="Exit function [2]" style="filled" fillcolor=red]; } 45 -> {46}; @@ -175,10 +175,10 @@ digraph kt44814_kt { subgraph cluster_18 { color=blue 53 [label="Enter default value of _children [3]" style="filled" fillcolor=red]; - 54 [label="Function call: R|kotlin/collections/emptyList|() [3]"]; + 54 [label="Function call: R|kotlin/collections/emptyList|() [3]" style="filled" fillcolor=yellow]; 55 [label="Exit default value of _children [3]" style="filled" fillcolor=red]; } - 51 [label="Delegated constructor call: super() [2]"]; + 51 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 52 [label="Exit function [2]" style="filled" fillcolor=red]; } 50 -> {53 51}; @@ -248,7 +248,7 @@ digraph kt44814_kt { subgraph cluster_24 { color=red 74 [label="Enter function [2]" style="filled" fillcolor=red]; - 75 [label="Delegated constructor call: super() [2]"]; + 75 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 76 [label="Exit function [2]" style="filled" fillcolor=red]; } 74 -> {75}; @@ -257,7 +257,7 @@ digraph kt44814_kt { subgraph cluster_25 { color=red 77 [label="Enter function [3]" style="filled" fillcolor=red]; - 78 [label="Delegated constructor call: super() [3]"]; + 78 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; 79 [label="Exit function [3]" style="filled" fillcolor=red]; } 77 -> {78}; @@ -266,7 +266,7 @@ digraph kt44814_kt { subgraph cluster_26 { color=red 80 [label="Enter property [3]" style="filled" fillcolor=red]; - 81 [label="Function call: R|/TokenType.TokenType|() [3]"]; + 81 [label="Function call: R|/TokenType.TokenType|() [3]" style="filled" fillcolor=yellow]; 82 [label="Exit property [3]" style="filled" fillcolor=red]; } 80 -> {81}; @@ -294,7 +294,7 @@ digraph kt44814_kt { subgraph cluster_29 { color=red 88 [label="Enter function [2]" style="filled" fillcolor=red]; - 89 [label="Delegated constructor call: super() [2]"]; + 89 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 90 [label="Exit function [2]" style="filled" fillcolor=red]; } 88 -> {89}; @@ -310,7 +310,7 @@ digraph kt44814_kt { subgraph cluster_31 { color=red 93 [label="Enter function [2]" style="filled" fillcolor=red]; - 94 [label="Delegated constructor call: super() [2]"]; + 94 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 95 [label="Exit function [2]" style="filled" fillcolor=red]; } 93 -> {94}; @@ -326,7 +326,7 @@ digraph kt44814_kt { subgraph cluster_33 { color=red 98 [label="Enter function [2]" style="filled" fillcolor=red]; - 99 [label="Delegated constructor call: super() [2]"]; + 99 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 100 [label="Exit function [2]" style="filled" fillcolor=red]; } 98 -> {99}; @@ -335,7 +335,7 @@ digraph kt44814_kt { subgraph cluster_34 { color=red 101 [label="Enter property [2]" style="filled" fillcolor=red]; - 102 [label="Function call: R|/KtModifierList.KtModifierList|() [2]"]; + 102 [label="Function call: R|/KtModifierList.KtModifierList|() [2]" style="filled" fillcolor=yellow]; 103 [label="Exit property [2]" style="filled" fillcolor=red]; } 101 -> {102}; @@ -356,7 +356,7 @@ digraph kt44814_kt { subgraph cluster_36 { color=red 107 [label="Enter function [2]" style="filled" fillcolor=red]; - 108 [label="Delegated constructor call: super() [2]"]; + 108 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 109 [label="Exit function [2]" style="filled" fillcolor=red]; } 107 -> {108}; @@ -387,7 +387,7 @@ digraph kt44814_kt { 116 [label="Enter function [3]" style="filled" fillcolor=red]; 117 [label="Access variable R|/node| [4]"]; 118 [label="Access variable R|/token| [4]"]; - 119 [label="Delegated constructor call: super|>(...) [3]"]; + 119 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; 120 [label="Exit function [3]" style="filled" fillcolor=red]; } 116 -> {117}; @@ -407,7 +407,7 @@ digraph kt44814_kt { 123 [label="Enter function [3]" style="filled" fillcolor=red]; 124 [label="Access variable R|/node| [4]"]; 125 [label="Access variable R|/token| [4]"]; - 126 [label="Delegated constructor call: super|>(...) [3]"]; + 126 [label="Delegated constructor call: super|>(...) [3]" style="filled" fillcolor=yellow]; 127 [label="Exit function [3]" style="filled" fillcolor=red]; } 123 -> {124}; @@ -454,7 +454,7 @@ digraph kt44814_kt { subgraph cluster_45 { color=red 138 [label="Enter function [2]" style="filled" fillcolor=red]; - 139 [label="Delegated constructor call: super() [2]"]; + 139 [label="Delegated constructor call: super() [2]" style="filled" fillcolor=yellow]; 140 [label="Exit function [2]" style="filled" fillcolor=red]; } 138 -> {139}; @@ -463,17 +463,17 @@ digraph kt44814_kt { subgraph cluster_46 { color=red 141 [label="Enter property [2]" style="filled" fillcolor=red]; - 142 [label="Function call: R|kotlin/collections/emptyList||>() [2]"]; + 142 [label="Function call: R|kotlin/collections/emptyList||>() [2]" style="filled" fillcolor=yellow]; 143 [label="Exit property [2]" style="filled" fillcolor=red]; } 141 -> {142}; 142 -> {143}; - 143 -> {287} [color=green]; + 143 -> {286} [color=green]; subgraph cluster_47 { color=red 144 [label="Enter function [3]" style="filled" fillcolor=red]; - 145 [label="Delegated constructor call: super() [3]"]; + 145 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; 146 [label="Exit function [3]" style="filled" fillcolor=red]; } 144 -> {145}; @@ -503,7 +503,7 @@ digraph kt44814_kt { subgraph cluster_50 { color=red 153 [label="Enter function [3]" style="filled" fillcolor=red]; - 154 [label="Delegated constructor call: super() [3]"]; + 154 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; 155 [label="Exit function [3]" style="filled" fillcolor=red]; } 153 -> {154}; @@ -547,7 +547,7 @@ digraph kt44814_kt { subgraph cluster_54 { color=red 166 [label="Enter function [3]" style="filled" fillcolor=red]; - 167 [label="Delegated constructor call: super() [3]"]; + 167 [label="Delegated constructor call: super() [3]" style="filled" fillcolor=yellow]; 168 [label="Exit function [3]" style="filled" fillcolor=red]; } 166 -> {167}; @@ -591,27 +591,27 @@ digraph kt44814_kt { 187 [label="Enter block [7]"]; 188 [label="Access variable R|/FirLightSourceElement.lighterASTNode| [9]"]; 189 [label="Access variable R|/FirLightSourceElement.treeStructure| [9]"]; - 190 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...) [8]"]; + 190 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...) [8]" style="filled" fillcolor=yellow]; 191 [label="Postponed enter to lambda [8]"]; subgraph cluster_62 { color=blue - 239 [label="Enter function anonymousFunction [9]" style="filled" fillcolor=red]; + 238 [label="Enter function anonymousFunction [9]" style="filled" fillcolor=red]; subgraph cluster_63 { color=blue - 240 [label="Enter block [9]"]; - 241 [label="Access variable R|/it| [9]"]; - 242 [label="Enter safe call [9]"]; - 243 [label="Access variable R|/LighterASTNode.tokenType| [9]"]; - 244 [label="Exit safe call [9]"]; - 245 [label="Access qualifier /TokenType [9]"]; - 246 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [9]"]; - 247 [label="Equality operator == [9]"]; - 248 [label="Exit block [9]"]; + 239 [label="Enter block [9]"]; + 240 [label="Access variable R|/it| [9]"]; + 241 [label="Enter safe call [9]"]; + 242 [label="Access variable R|/LighterASTNode.tokenType| [9]"]; + 243 [label="Exit safe call [9]"]; + 244 [label="Access qualifier /TokenType [9]"]; + 245 [label="Access variable R|/TokenType.Companion.MODIFIER_LIST| [9]"]; + 246 [label="Equality operator == [9]"]; + 247 [label="Exit block [9]"]; } - 249 [label="Exit function anonymousFunction [9]" style="filled" fillcolor=red]; + 248 [label="Exit function anonymousFunction [9]" style="filled" fillcolor=red]; } 192 [label="Postponed exit from lambda [8]"]; - 193 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...).R|kotlin/collections/find|(...) [7]"]; + 193 [label="Function call: this@R|/FirModifierList.Companion.getModifierList|.R|/FirLightSourceElement.lighterASTNode|.R|/LighterASTNode.getChildren|(...).R|kotlin/collections/find|(...) [7]" style="filled" fillcolor=yellow]; 194 [label="Exit lhs of ?: [7]"]; 195 [label="Enter rhs of ?: [7]"]; 196 [label="Const: Null(null) [7]"]; @@ -622,7 +622,7 @@ digraph kt44814_kt { 201 [label="Variable declaration: lval modifierListNode: R|LighterASTNode| [7]"]; 202 [label="Access variable R|/modifierListNode| [8]"]; 203 [label="Access variable R|/FirLightSourceElement.treeStructure| [8]"]; - 204 [label="Function call: R|/FirModifierList.FirLightModifierList.FirLightModifierList|(...) [7]"]; + 204 [label="Function call: R|/FirModifierList.FirLightModifierList.FirLightModifierList|(...) [7]" style="filled" fillcolor=yellow]; 205 [label="Exit block [7]"]; } 206 [label="Exit when branch result [6]"]; @@ -638,18 +638,18 @@ digraph kt44814_kt { 214 [label="Postponed enter to lambda [7]"]; subgraph cluster_65 { color=blue - 233 [label="Enter function anonymousFunction [8]" style="filled" fillcolor=red]; + 232 [label="Enter function anonymousFunction [8]" style="filled" fillcolor=red]; subgraph cluster_66 { color=blue - 234 [label="Enter block [8]"]; - 235 [label="Access variable R|/it| [9]"]; - 236 [label="Function call: R|/FirModifierList.FirPsiModifierList.FirPsiModifierList|(...) [8]"]; - 237 [label="Exit block [8]"]; + 233 [label="Enter block [8]"]; + 234 [label="Access variable R|/it| [9]"]; + 235 [label="Function call: R|/FirModifierList.FirPsiModifierList.FirPsiModifierList|(...) [8]" style="filled" fillcolor=yellow]; + 236 [label="Exit block [8]"]; } - 238 [label="Exit function anonymousFunction [8]" style="filled" fillcolor=red]; + 237 [label="Exit function anonymousFunction [8]" style="filled" fillcolor=red]; } 215 [label="Postponed exit from lambda [7]"]; - 216 [label="Function call: $subj$.R|kotlin/let|(...) [6]"]; + 216 [label="Function call: $subj$.R|kotlin/let|(...) [6]" style="filled" fillcolor=yellow]; 217 [label="Exit safe call [6]"]; 218 [label="Exit safe call [6]"]; 219 [label="Exit block [6]"]; @@ -690,7 +690,6 @@ digraph kt44814_kt { } 231 [label="Exit function getModifierList [3]" style="filled" fillcolor=red]; } - 232 [label="Merge postponed lambda exits [3]"]; 169 -> {170}; 170 -> {171}; 171 -> {172}; @@ -713,9 +712,10 @@ digraph kt44814_kt { 188 -> {189}; 189 -> {190}; 190 -> {191}; - 191 -> {192 239}; - 191 -> {239} [style=dashed]; + 191 -> {192 238}; + 191 -> {238} [style=dashed]; 192 -> {193}; + 192 -> {191} [color=green style=dashed]; 193 -> {194}; 194 -> {199 195}; 195 -> {196}; @@ -738,95 +738,94 @@ digraph kt44814_kt { 211 -> {212}; 212 -> {217 213}; 213 -> {214}; - 214 -> {233}; + 214 -> {232}; 214 -> {215} [color=red]; - 214 -> {233} [style=dashed]; + 214 -> {232} [style=dashed]; 215 -> {216}; 216 -> {218}; 217 -> {218}; 218 -> {221 219}; 219 -> {220}; 220 -> {227}; - 221 -> {232} [color=red]; + 221 -> {227} [color=red]; 222 -> {223}; 223 -> {224}; 224 -> {225}; 225 -> {226}; 226 -> {227}; - 227 -> {232 228}; + 227 -> {228}; 228 -> {231}; 228 -> {229} [style=dotted]; 229 -> {230} [style=dotted]; 230 -> {231} [style=dotted]; + 232 -> {233}; 233 -> {234}; 234 -> {235}; 235 -> {236}; 236 -> {237}; - 237 -> {238}; - 238 -> {221} [color=red]; - 238 -> {215} [color=green]; - 239 -> {249 240}; - 240 -> {241}; - 241 -> {242 244}; + 237 -> {221} [color=red]; + 237 -> {215} [color=green]; + 238 -> {239}; + 239 -> {240}; + 240 -> {241 243}; + 241 -> {242}; 242 -> {243}; 243 -> {244}; 244 -> {245}; 245 -> {246}; 246 -> {247}; 247 -> {248}; - 248 -> {249}; - 249 -> {192}; - 249 -> {239} [color=green style=dashed]; + 248 -> {192}; subgraph cluster_68 { color=red - 250 [label="Enter function boxImpl [3]" style="filled" fillcolor=red]; + 249 [label="Enter function boxImpl [3]" style="filled" fillcolor=red]; subgraph cluster_69 { color=blue - 251 [label="Enter block [3]"]; - 252 [label="Function call: R|/LighterASTNode.LighterASTNode|() [6]"]; - 253 [label="Function call: R|kotlin/collections/listOf|(...) [5]"]; - 254 [label="Function call: R|/LighterASTNode.LighterASTNode|(...) [4]"]; - 255 [label="Function call: R|/FlyweightCapableTreeStructure.FlyweightCapableTreeStructure|() [4]"]; - 256 [label="Function call: R|/FirLightSourceElement.FirLightSourceElement|(...) [3]"]; - 257 [label="Variable declaration: lval sourceElement: R|FirSourceElement?| [3]"]; - 258 [label="Access variable R|/sourceElement| [4]"]; - 259 [label="Function call: (this@R|/FirModifierList.Companion|, R|/sourceElement|).R|/FirModifierList.Companion.getModifierList|() [3]"]; - 260 [label="Variable declaration: lval result: R|FirModifierList?| [3]"]; + 250 [label="Enter block [3]"]; + 251 [label="Function call: R|/LighterASTNode.LighterASTNode|() [6]" style="filled" fillcolor=yellow]; + 252 [label="Function call: R|kotlin/collections/listOf|(...) [5]" style="filled" fillcolor=yellow]; + 253 [label="Function call: R|/LighterASTNode.LighterASTNode|(...) [4]" style="filled" fillcolor=yellow]; + 254 [label="Function call: R|/FlyweightCapableTreeStructure.FlyweightCapableTreeStructure|() [4]" style="filled" fillcolor=yellow]; + 255 [label="Function call: R|/FirLightSourceElement.FirLightSourceElement|(...) [3]" style="filled" fillcolor=yellow]; + 256 [label="Variable declaration: lval sourceElement: R|FirSourceElement?| [3]"]; + 257 [label="Access variable R|/sourceElement| [4]"]; + 258 [label="Function call: (this@R|/FirModifierList.Companion|, R|/sourceElement|).R|/FirModifierList.Companion.getModifierList|() [3]" style="filled" fillcolor=yellow]; + 259 [label="Variable declaration: lval result: R|FirModifierList?| [3]"]; subgraph cluster_70 { color=blue - 261 [label="Enter when [3]"]; + 260 [label="Enter when [3]"]; subgraph cluster_71 { color=blue - 262 [label="Enter when branch condition [4]"]; - 263 [label="Access variable R|/result| [5]"]; - 264 [label="Type operator: (R|/result| is R|FirModifierList.FirLightModifierList|) [5]"]; - 265 [label="Exit when branch condition [4]"]; + 261 [label="Enter when branch condition [4]"]; + 262 [label="Access variable R|/result| [5]"]; + 263 [label="Type operator: (R|/result| is R|FirModifierList.FirLightModifierList|) [5]"]; + 264 [label="Exit when branch condition [4]"]; } subgraph cluster_72 { color=blue - 266 [label="Enter when branch condition else [5]"]; - 267 [label="Exit when branch condition [5]"]; + 265 [label="Enter when branch condition else [5]"]; + 266 [label="Exit when branch condition [5]"]; } - 268 [label="Enter when branch result [6]"]; + 267 [label="Enter when branch result [6]"]; subgraph cluster_73 { color=blue - 269 [label="Enter block [6]"]; - 270 [label="Const: String(Fail) [6]"]; - 271 [label="Exit block [6]"]; + 268 [label="Enter block [6]"]; + 269 [label="Const: String(Fail) [6]"]; + 270 [label="Exit block [6]"]; } - 272 [label="Exit when branch result [5]"]; - 273 [label="Enter when branch result [5]"]; + 271 [label="Exit when branch result [5]"]; + 272 [label="Enter when branch result [5]"]; subgraph cluster_74 { color=blue - 274 [label="Enter block [5]"]; - 275 [label="Const: String(OK) [5]"]; - 276 [label="Exit block [5]"]; + 273 [label="Enter block [5]"]; + 274 [label="Const: String(OK) [5]"]; + 275 [label="Exit block [5]"]; } - 277 [label="Exit when branch result [4]"]; - 278 [label="Exit when [3]"]; + 276 [label="Exit when branch result [4]"]; + 277 [label="Exit when [3]"]; } - 279 [label="Jump: ^boxImpl when () { + 278 [label="Jump: ^boxImpl when () { (R|/result| is R|FirModifierList.FirLightModifierList|) -> { String(OK) } @@ -835,11 +834,12 @@ digraph kt44814_kt { } } [3]"]; - 280 [label="Stub [3]" style="filled" fillcolor=gray]; - 281 [label="Exit block [3]" style="filled" fillcolor=gray]; + 279 [label="Stub [3]" style="filled" fillcolor=gray]; + 280 [label="Exit block [3]" style="filled" fillcolor=gray]; } - 282 [label="Exit function boxImpl [3]" style="filled" fillcolor=red]; + 281 [label="Exit function boxImpl [3]" style="filled" fillcolor=red]; } + 249 -> {250}; 250 -> {251}; 251 -> {252}; 252 -> {253}; @@ -854,65 +854,64 @@ digraph kt44814_kt { 261 -> {262}; 262 -> {263}; 263 -> {264}; - 264 -> {265}; - 265 -> {273 266}; + 264 -> {272 265}; + 265 -> {266}; 266 -> {267}; 267 -> {268}; 268 -> {269}; 269 -> {270}; 270 -> {271}; - 271 -> {272}; - 272 -> {278}; + 271 -> {277}; + 272 -> {273}; 273 -> {274}; 274 -> {275}; 275 -> {276}; 276 -> {277}; 277 -> {278}; - 278 -> {279}; - 279 -> {282}; + 278 -> {281}; + 278 -> {279} [style=dotted]; 279 -> {280} [style=dotted]; 280 -> {281} [style=dotted]; - 281 -> {282} [style=dotted]; subgraph cluster_75 { color=red - 283 [label="Enter class Companion [2]" style="filled" fillcolor=red]; - 284 [label="Exit class Companion [2]" style="filled" fillcolor=red]; + 282 [label="Enter class Companion [2]" style="filled" fillcolor=red]; + 283 [label="Exit class Companion [2]" style="filled" fillcolor=red]; } - 283 -> {284} [color=green]; + 282 -> {283} [color=green]; subgraph cluster_76 { color=red - 285 [label="Enter class FirModifierList [1]" style="filled" fillcolor=red]; - 286 [label="Part of class initialization [1]"]; - 287 [label="Exit class FirModifierList [1]" style="filled" fillcolor=red]; + 284 [label="Enter class FirModifierList [1]" style="filled" fillcolor=red]; + 285 [label="Part of class initialization [1]"]; + 286 [label="Exit class FirModifierList [1]" style="filled" fillcolor=red]; } - 285 -> {286} [color=green]; - 286 -> {287} [style=dotted]; - 286 -> {141} [color=green]; - 286 -> {141} [style=dashed]; + 284 -> {285} [color=green]; + 285 -> {286} [style=dotted]; + 285 -> {141} [color=green]; + 285 -> {141} [style=dashed]; subgraph cluster_77 { color=red - 288 [label="Enter function box [1]" style="filled" fillcolor=red]; + 287 [label="Enter function box [1]" style="filled" fillcolor=red]; subgraph cluster_78 { color=blue - 289 [label="Enter block [1]"]; - 290 [label="Access qualifier /FirModifierList [2]"]; - 291 [label="Function call: Q|FirModifierList|.R|/FirModifierList.Companion.boxImpl|() [1]"]; - 292 [label="Jump: ^box Q|FirModifierList|.R|/FirModifierList.Companion.boxImpl|() [1]"]; - 293 [label="Stub [1]" style="filled" fillcolor=gray]; - 294 [label="Exit block [1]" style="filled" fillcolor=gray]; + 288 [label="Enter block [1]"]; + 289 [label="Access qualifier /FirModifierList [2]"]; + 290 [label="Function call: Q|FirModifierList|.R|/FirModifierList.Companion.boxImpl|() [1]" style="filled" fillcolor=yellow]; + 291 [label="Jump: ^box Q|FirModifierList|.R|/FirModifierList.Companion.boxImpl|() [1]"]; + 292 [label="Stub [1]" style="filled" fillcolor=gray]; + 293 [label="Exit block [1]" style="filled" fillcolor=gray]; } - 295 [label="Exit function box [1]" style="filled" fillcolor=red]; + 294 [label="Exit function box [1]" style="filled" fillcolor=red]; } + 287 -> {288}; 288 -> {289}; 289 -> {290}; 290 -> {291}; - 291 -> {292}; - 292 -> {295}; + 291 -> {294}; + 291 -> {292} [style=dotted]; 292 -> {293} [style=dotted]; 293 -> {294} [style=dotted]; - 294 -> {295} [style=dotted]; } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/3.fir.kt index 53329e9af9d..20d2d374433 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/3.fir.kt @@ -155,7 +155,7 @@ fun case_10() { val x: Int funWithExactlyOnceCallsInPlace outer@ { funWithAtLeastOnceCallsInPlace { - x = 42 + x = 42 return@outer } } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/contracts/description/EventOccurrencesRange.kt b/core/compiler.common/src/org/jetbrains/kotlin/contracts/description/EventOccurrencesRange.kt index 26fc5fb64c2..6913b39ebae 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/contracts/description/EventOccurrencesRange.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/contracts/description/EventOccurrencesRange.kt @@ -46,6 +46,9 @@ enum class EventOccurrencesRange(private val left: Int, private val right: Int) fun EventOccurrencesRange.isDefinitelyVisited(): Boolean = this == EventOccurrencesRange.EXACTLY_ONCE || this == EventOccurrencesRange.AT_LEAST_ONCE || this == EventOccurrencesRange.MORE_THAN_ONCE +fun EventOccurrencesRange.canBeVisited(): Boolean = + this != EventOccurrencesRange.ZERO + fun EventOccurrencesRange.canBeRevisited(): Boolean = this == EventOccurrencesRange.UNKNOWN || this == EventOccurrencesRange.AT_LEAST_ONCE || this == EventOccurrencesRange.MORE_THAN_ONCE