diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt index d3939004994..a8293af538c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt @@ -42,12 +42,13 @@ class CandidateFactory( } } -fun PostponedArgumentsAnalyzer.Context.addSubsystemFromExpression(expression: FirExpression) { - when (expression) { +fun PostponedArgumentsAnalyzer.Context.addSubsystemFromExpression(statement: FirStatement) { + when (statement) { is FirFunctionCall, is FirQualifiedAccessExpression, is FirWhenExpression, is FirTryExpression, is FirCallableReferenceAccess -> - (expression as FirResolvable).candidate()?.let { addOtherSystem(it.system.asReadOnlyStorage()) } - is FirWrappedArgumentExpression -> addSubsystemFromExpression(expression.expression) - is FirBlock -> expression.returnExpressions().forEach { addSubsystemFromExpression(it) } + (statement as FirResolvable).candidate()?.let { addOtherSystem(it.system.asReadOnlyStorage()) } + is FirWrappedArgumentExpression -> addSubsystemFromExpression(statement.expression) + is FirBlock -> statement.returnExpressions().forEach { addSubsystemFromExpression(it) } + else -> {} } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt index ee342653e6b..23e8267172d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.fir.FirCallResolver import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.references.impl.FirErrorNamedReferenceImpl import org.jetbrains.kotlin.fir.resolve.constructType import org.jetbrains.kotlin.fir.resolve.diagnostics.FirUnresolvedReferenceError @@ -37,7 +38,7 @@ interface LambdaAnalyzer { expectedReturnType: ConeKotlinType?, // null means, that return type is not proper i.e. it depends on some type variables rawReturnType: ConeKotlinType, stubsForPostponedVariables: Map - ): Pair, InferenceSession> + ): Pair, InferenceSession> } @@ -142,6 +143,7 @@ class PostponedArgumentsAnalyzer( val checkerSink: CheckerSink = CheckerSinkImpl(components) val subResolvedKtPrimitives = returnArguments.map { + if (it !is FirExpression) return@map var atom: PostponedResolvedAtomMarker? = null candidate.resolveArgumentExpression( c.getBuilder(), 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 e13ad86652e..2d88cb065a2 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 @@ -22,7 +22,9 @@ import org.jetbrains.kotlin.fir.resolve.dfa.cfg.* import org.jetbrains.kotlin.fir.resolve.dfa.contracts.buildContractFir import org.jetbrains.kotlin.fir.resolve.dfa.contracts.createArgumentsMapping import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirAbstractBodyResolveTransformer +import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType import org.jetbrains.kotlin.fir.resolve.withNullability +import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol @@ -77,13 +79,16 @@ class FirDataFlowAnalyzer(private val components: FirAbstractBodyResolveTransfor fun exitFunction(function: FirFunction<*>): ControlFlowGraph? { val (node, graph) = graphBuilder.exitFunction(function) - node.mergeIncomingFlow() + if (function.body == null) { + node.mergeIncomingFlow() + } for (valueParameter in function.valueParameters) { variableStorage.removeRealVariable(valueParameter.symbol) } if (graphBuilder.isTopLevel()) { flowOnNodes.clear() variableStorage.reset() + graphBuilder.reset() } return graph } @@ -103,13 +108,33 @@ class FirDataFlowAnalyzer(private val components: FirAbstractBodyResolveTransfor // ----------------------------------- Block ----------------------------------- fun enterBlock(block: FirBlock) { - graphBuilder.enterBlock(block).mergeIncomingFlow() + graphBuilder.enterBlock(block)?.mergeIncomingFlow() } fun exitBlock(block: FirBlock) { graphBuilder.exitBlock(block).mergeIncomingFlow() } + private fun FirElement.extractReturnType(target: FirFunction<*>?): ConeKotlinType? { + return when (this) { + is FirReturnExpression -> { + if (this.target.labeledElement == target) { + result.extractReturnType(target) + } else { + result.resultType.coneTypeSafe() + } + } + is FirExpression -> { + typeRef.coneTypeSafe() + } + else -> session.builtinTypes.unitType.type + } + } + + fun returnExpressionsOfAnonymousFunction(function: FirAnonymousFunction): List { + return graphBuilder.returnExpressionsOfAnonymousFunction(function) + } + // ----------------------------------- Operator call ----------------------------------- fun exitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall) { 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 9c54a9faec6..4895c424f2e 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 @@ -45,6 +45,9 @@ class ControlFlowGraphBuilder { private val exitSafeCallNodes: Stack = stackOf() + private val blocksOfFunctions: MutableMap> = mutableMapOf() + private val exitsOfAnonymousFunctions: MutableMap = mutableMapOf() + var levelCounter: Int = 0 private set @@ -86,6 +89,9 @@ class ControlFlowGraphBuilder { } } val exitNode = createFunctionExitNode(function, isInplace) + if (function is FirAnonymousFunction) { + exitsOfAnonymousFunctions[function] = exitNode + } @Suppress("NON_EXHAUSTIVE_WHEN") when (invocationKind) { @@ -111,13 +117,14 @@ class ControlFlowGraphBuilder { exitNodes.pop() } if (isInplace) { - addNewSimpleNode(exitNode) val enterNode = functionEnterNodes.pop() when (invocationKind) { InvocationKind.AT_LEAST_ONCE, InvocationKind.UNKNOWN -> addEdge(exitNode, enterNode, propagateDeadness = false) } } else { - addEdge(lastNodes.pop(), exitNode) + if (function.body == null) { + addEdge(lastNodes.pop(), exitNode) + } lexicalScopes.pop() } exitNode.markAsDeadIfNecessary() @@ -129,15 +136,47 @@ class ControlFlowGraphBuilder { return exitNode to graph } - // ----------------------------------- Block ----------------------------------- + fun returnExpressionsOfAnonymousFunction(function: FirAnonymousFunction): List { + fun FirElement.extractArgument(): FirElement = when { + this is FirReturnExpression && target.labeledElement.symbol == function.symbol -> result.extractArgument() + else -> this + } - fun enterBlock(block: FirBlock): BlockEnterNode { - return createBlockEnterNode(block).also { addNewSimpleNode(it) }.also { levelCounter++ } + fun CFGNode<*>.extractArgument(): FirElement? = when(this) { + is FunctionEnterNode, is TryMainBlockEnterNode, is CatchClauseEnterNode -> null + is ExitSafeCallNode -> previousNodes.last().extractArgument() + is StubNode -> previousNodes.first().extractArgument() + else -> fir.extractArgument() + } + return exitsOfAnonymousFunctions.getValue(function).previousNodes.mapNotNull { + it.extractArgument() as FirStatement? + } } - fun exitBlock(block: FirBlock): BlockExitNode { - levelCounter-- - return createBlockExitNode(block).also { addNewSimpleNode(it) } + // ----------------------------------- Block ----------------------------------- + + fun enterBlock(block: FirBlock): BlockEnterNode? { + val lastNode = lastNode + return if (lastNode is FunctionEnterNode) { + blocksOfFunctions[block] = lastNode.fir + null + } else { + createBlockEnterNode(block).also { addNewSimpleNode(it) }.also { levelCounter++ } + } + } + + fun exitBlock(block: FirBlock): CFGNode<*> { + val function = blocksOfFunctions.remove(block) + return if (function != null) { + functionExitNodes.top().also { + addEdge(lastNodes.pop(), it) + lastNodes.push(it) + it.markAsDeadIfNecessary() + } + } else { + levelCounter-- + createBlockExitNode(block).also { addNewSimpleNode(it) } + } } // ----------------------------------- Property ----------------------------------- @@ -649,4 +688,8 @@ class ControlFlowGraphBuilder { private fun InvocationKind?.isInplace(): Boolean { return this != null } + + fun reset() { + exitsOfAnonymousFunctions.clear() + } } \ No newline at end of file diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt index 6662805f8a5..6ea3dba9673 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt @@ -107,7 +107,7 @@ class FirCallCompleter( expectedReturnType: ConeKotlinType?, rawReturnType: ConeKotlinType, stubsForPostponedVariables: Map - ): Pair, InferenceSession> { + ): Pair, InferenceSession> { val needItParam = lambdaArgument.valueParameters.isEmpty() && parameters.size == 1 @@ -144,7 +144,8 @@ class FirCallCompleter( replacements[lambdaArgument] = newLambdaExpression.transformSingle(transformer, ResolutionMode.LambdaResolution(expectedReturnTypeRef)) - return (newLambdaExpression.body?.returnExpressions() ?: emptyList()) to InferenceSession.default + val returnArguments = dataFlowAnalyzer.returnExpressionsOfAnonymousFunction(newLambdaExpression) + return returnArguments to InferenceSession.default } } } diff --git a/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.kt b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.kt new file mode 100644 index 00000000000..8b73579af58 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.kt @@ -0,0 +1,23 @@ +class StringBuilder { + fun append(s: String) {} +} + +fun buildString(init: StringBuilder.() -> Unit): String {} + +interface Template + +class KDocTemplate : Template { + fun definition(content: StringBuilder.() -> Unit) {} +} + +fun > U.insert(template: T, build: T.() -> Unit) {} + +fun test(ordinal: Int) { + buildString { + insert(KDocTemplate()) { + definition { + ordinal?.let {} + } + } + } +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.txt b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.txt new file mode 100644 index 00000000000..799cd52aef7 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.txt @@ -0,0 +1,40 @@ +FILE: lambdaInLambda.kt + public final class StringBuilder : R|kotlin/Any| { + public constructor(): R|StringBuilder| { + super() + } + + public final fun append(s: R|kotlin/String|): R|kotlin/Unit| { + } + + } + public final fun buildString(init: R|StringBuilder.() -> kotlin/Unit|): R|kotlin/String| { + } + public abstract interface Template : R|kotlin/Any| { + } + public final class KDocTemplate : R|Template| { + public constructor(): R|KDocTemplate| { + super() + } + + public final fun definition(content: R|StringBuilder.() -> kotlin/Unit|): R|kotlin/Unit| { + } + + } + public final fun |> R|U|.insert(template: R|T|, build: R|T.() -> kotlin/Unit|): R|kotlin/Unit| { + } + public final fun test(ordinal: R|kotlin/Int|): R|kotlin/Unit| { + R|/buildString|( = buildString@fun R|StringBuilder|.(): R|kotlin/Unit| { + this@R|special/anonymous|.R|/insert|(R|/KDocTemplate.KDocTemplate|(), = insert@fun R|KDocTemplate|.(): R|kotlin/Unit| { + this@R|/KDocTemplate|.R|/KDocTemplate.definition|( = definition@fun R|StringBuilder|.(): R|kotlin/Unit| { + R|/ordinal|?.R|kotlin/let|( = let@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + Unit + } + ) + } + ) + } + ) + } + ) + } diff --git a/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.kt b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.kt new file mode 100644 index 00000000000..d4663c93e87 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.kt @@ -0,0 +1,26 @@ +// FILE: Function.java + +public interface Function { + Result fun(Param param); +} + +// FILE: AdapterProcessor.java + +public class AdapterProcessor { + public AdapterProcessor(Function conversion) {} +} + + +// FILE: main.kt + +interface PsiMethod { + val containingClass: PsiClass? +} + +interface PsiClass + +fun test() { + val processor = AdapterProcessor( + Function { method: PsiMethod? -> method?.containingClass } + ) +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.txt b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.txt new file mode 100644 index 00000000000..cdbb4211467 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.txt @@ -0,0 +1,14 @@ +FILE: main.kt + public abstract interface PsiMethod : R|kotlin/Any| { + public abstract val containingClass: R|PsiClass?| + public get(): R|PsiClass?| + + } + public abstract interface PsiClass : R|kotlin/Any| { + } + public final fun test(): R|kotlin/Unit| { + lval processor: R|AdapterProcessor| = R|/AdapterProcessor.AdapterProcessor|(R|/Function|!|>( = Function@fun (method: R|PsiMethod?|): R|PsiClass?| { + R|/method|?.R|/PsiMethod.containingClass| + } + )) + } diff --git a/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.kt b/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.kt new file mode 100644 index 00000000000..0cb52a8116b --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.kt @@ -0,0 +1,13 @@ +fun myRun(block: () -> T): T = block() + +fun foo() {} + +fun test() { + myRun { + try { + val x = 1 + } catch(e: Exception) { + foo() + } + } +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.txt b/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.txt new file mode 100644 index 00000000000..706ab6d2439 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/arguments/tryInLambda.txt @@ -0,0 +1,18 @@ +FILE: tryInLambda.kt + public final fun myRun(block: R|() -> T|): R|T| { + ^myRun R|/block|.R|FakeOverride|() + } + public final fun foo(): R|kotlin/Unit| { + } + public final fun test(): R|kotlin/Unit| { + R|/myRun|( = myRun@fun (): R|kotlin/Unit| { + try { + lval x: R|kotlin/Int| = Int(1) + } + catch (e: R|kotlin/Exception|) { + R|/foo|() + } + + } + ) + } diff --git a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot index c481d1beff8..6cc77e1bd41 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot @@ -8,38 +8,33 @@ digraph binaryOperations_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; + 2 [label="Enter when branch condition "]; subgraph cluster_3 { color=blue - 3 [label="Enter when branch condition "]; - subgraph cluster_4 { - color=blue - 4 [label="Enter ||"]; - 5 [label="Access variable R|/b1|"]; - 6 [label="Exit left part of ||"]; - 7 [label="Enter right part of ||"]; - 8 [label="Access variable R|/b2|"]; - 9 [label="Exit ||"]; - } - 10 [label="Exit when branch condition"]; + 3 [label="Enter ||"]; + 4 [label="Access variable R|/b1|"]; + 5 [label="Exit left part of ||"]; + 6 [label="Enter right part of ||"]; + 7 [label="Access variable R|/b2|"]; + 8 [label="Exit ||"]; } - 11 [label="Synthetic else branch"]; - 12 [label="Enter when branch result"]; - subgraph cluster_5 { - color=blue - 13 [label="Enter block"]; - 14 [label="Const: Int(1)"]; - 15 [label="Exit block"]; - } - 16 [label="Exit when branch result"]; - 17 [label="Exit when"]; + 9 [label="Exit when branch condition"]; } - 18 [label="Exit block"]; + 10 [label="Synthetic else branch"]; + 11 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 12 [label="Enter block"]; + 13 [label="Const: Int(1)"]; + 14 [label="Exit block"]; + } + 15 [label="Exit when branch result"]; + 16 [label="Exit when"]; } - 19 [label="Exit function test_1" style="filled" fillcolor=red]; + 17 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -47,222 +42,199 @@ digraph binaryOperations_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {9 7}; + 5 -> {8 6}; + 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; - 10 -> {12 11}; - 11 -> {17}; + 9 -> {11 10}; + 10 -> {16}; + 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - subgraph cluster_6 { + subgraph cluster_5 { color=red - 20 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_7 { + 18 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 21 [label="Enter block"]; - subgraph cluster_8 { + 19 [label="Enter when"]; + subgraph cluster_7 { color=blue - 22 [label="Enter when"]; - subgraph cluster_9 { + 20 [label="Enter when branch condition "]; + subgraph cluster_8 { color=blue - 23 [label="Enter when branch condition "]; - subgraph cluster_10 { - color=blue - 24 [label="Enter &&"]; - 25 [label="Access variable R|/b1|"]; - 26 [label="Exit left part of &&"]; - 27 [label="Enter right part of &&"]; - 28 [label="Access variable R|/b2|"]; - 29 [label="Exit &&"]; - } - 30 [label="Exit when branch condition"]; + 21 [label="Enter &&"]; + 22 [label="Access variable R|/b1|"]; + 23 [label="Exit left part of &&"]; + 24 [label="Enter right part of &&"]; + 25 [label="Access variable R|/b2|"]; + 26 [label="Exit &&"]; } - 31 [label="Synthetic else branch"]; - 32 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 33 [label="Enter block"]; - 34 [label="Const: Int(1)"]; - 35 [label="Exit block"]; - } - 36 [label="Exit when branch result"]; - 37 [label="Exit when"]; + 27 [label="Exit when branch condition"]; } - 38 [label="Exit block"]; + 28 [label="Synthetic else branch"]; + 29 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 30 [label="Enter block"]; + 31 [label="Const: Int(1)"]; + 32 [label="Exit block"]; + } + 33 [label="Exit when branch result"]; + 34 [label="Exit when"]; } - 39 [label="Exit function test_2" style="filled" fillcolor=red]; + 35 [label="Exit function test_2" style="filled" fillcolor=red]; } + 18 -> {19}; + 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; - 23 -> {24}; + 23 -> {26 24}; 24 -> {25}; 25 -> {26}; - 26 -> {29 27}; - 27 -> {28}; - 28 -> {29}; + 26 -> {27}; + 27 -> {29 28}; + 28 -> {34}; 29 -> {30}; - 30 -> {32 31}; - 31 -> {37}; + 30 -> {31}; + 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; - 35 -> {36}; + + subgraph cluster_10 { + color=red + 36 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 37 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 38 [label="Enter when branch condition "]; + subgraph cluster_13 { + color=blue + 39 [label="Enter ||"]; + subgraph cluster_14 { + color=blue + 40 [label="Enter &&"]; + 41 [label="Access variable R|/b1|"]; + 42 [label="Exit left part of &&"]; + 43 [label="Enter right part of &&"]; + 44 [label="Access variable R|/b2|"]; + 45 [label="Exit &&"]; + } + 46 [label="Exit left part of ||"]; + 47 [label="Enter right part of ||"]; + 48 [label="Access variable R|/b3|"]; + 49 [label="Exit ||"]; + } + 50 [label="Exit when branch condition"]; + } + 51 [label="Synthetic else branch"]; + 52 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 53 [label="Enter block"]; + 54 [label="Const: Int(1)"]; + 55 [label="Exit block"]; + } + 56 [label="Exit when branch result"]; + 57 [label="Exit when"]; + } + 58 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 36 -> {37}; 37 -> {38}; 38 -> {39}; - - subgraph cluster_12 { - color=red - 40 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 41 [label="Enter block"]; - subgraph cluster_14 { - color=blue - 42 [label="Enter when"]; - subgraph cluster_15 { - color=blue - 43 [label="Enter when branch condition "]; - subgraph cluster_16 { - color=blue - 44 [label="Enter ||"]; - subgraph cluster_17 { - color=blue - 45 [label="Enter &&"]; - 46 [label="Access variable R|/b1|"]; - 47 [label="Exit left part of &&"]; - 48 [label="Enter right part of &&"]; - 49 [label="Access variable R|/b2|"]; - 50 [label="Exit &&"]; - } - 51 [label="Exit left part of ||"]; - 52 [label="Enter right part of ||"]; - 53 [label="Access variable R|/b3|"]; - 54 [label="Exit ||"]; - } - 55 [label="Exit when branch condition"]; - } - 56 [label="Synthetic else branch"]; - 57 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 58 [label="Enter block"]; - 59 [label="Const: Int(1)"]; - 60 [label="Exit block"]; - } - 61 [label="Exit when branch result"]; - 62 [label="Exit when"]; - } - 63 [label="Exit block"]; - } - 64 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; + 42 -> {45 43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {47}; - 47 -> {50 48}; + 46 -> {49 47}; + 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {51}; - 51 -> {54 52}; + 50 -> {52 51}; + 51 -> {57}; 52 -> {53}; 53 -> {54}; 54 -> {55}; - 55 -> {57 56}; - 56 -> {62}; + 55 -> {56}; + 56 -> {57}; 57 -> {58}; - 58 -> {59}; + + subgraph cluster_16 { + color=red + 59 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_17 { + color=blue + 60 [label="Enter when"]; + subgraph cluster_18 { + color=blue + 61 [label="Enter when branch condition "]; + subgraph cluster_19 { + color=blue + 62 [label="Enter ||"]; + 63 [label="Access variable R|/b1|"]; + 64 [label="Exit left part of ||"]; + 65 [label="Enter right part of ||"]; + subgraph cluster_20 { + color=blue + 66 [label="Enter &&"]; + 67 [label="Access variable R|/b2|"]; + 68 [label="Exit left part of &&"]; + 69 [label="Enter right part of &&"]; + 70 [label="Access variable R|/b3|"]; + 71 [label="Exit &&"]; + } + 72 [label="Exit ||"]; + } + 73 [label="Exit when branch condition"]; + } + 74 [label="Synthetic else branch"]; + 75 [label="Enter when branch result"]; + subgraph cluster_21 { + color=blue + 76 [label="Enter block"]; + 77 [label="Const: Int(1)"]; + 78 [label="Exit block"]; + } + 79 [label="Exit when branch result"]; + 80 [label="Exit when"]; + } + 81 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; - - subgraph cluster_19 { - color=red - 65 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_20 { - color=blue - 66 [label="Enter block"]; - subgraph cluster_21 { - color=blue - 67 [label="Enter when"]; - subgraph cluster_22 { - color=blue - 68 [label="Enter when branch condition "]; - subgraph cluster_23 { - color=blue - 69 [label="Enter ||"]; - 70 [label="Access variable R|/b1|"]; - 71 [label="Exit left part of ||"]; - 72 [label="Enter right part of ||"]; - subgraph cluster_24 { - color=blue - 73 [label="Enter &&"]; - 74 [label="Access variable R|/b2|"]; - 75 [label="Exit left part of &&"]; - 76 [label="Enter right part of &&"]; - 77 [label="Access variable R|/b3|"]; - 78 [label="Exit &&"]; - } - 79 [label="Exit ||"]; - } - 80 [label="Exit when branch condition"]; - } - 81 [label="Synthetic else branch"]; - 82 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 83 [label="Enter block"]; - 84 [label="Const: Int(1)"]; - 85 [label="Exit block"]; - } - 86 [label="Exit when branch result"]; - 87 [label="Exit when"]; - } - 88 [label="Exit block"]; - } - 89 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 64 -> {72 65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; - 68 -> {69}; + 68 -> {71 69}; 69 -> {70}; 70 -> {71}; - 71 -> {79 72}; + 71 -> {72}; 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {78 76}; + 73 -> {75 74}; + 74 -> {80}; + 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {82 81}; - 81 -> {87}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; + 80 -> {81}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot b/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot index 97a2617ffb2..ad07c5e717c 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot @@ -8,38 +8,33 @@ digraph booleanOperatorsWithConsts_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; + 2 [label="Enter when branch condition "]; subgraph cluster_3 { color=blue - 3 [label="Enter when branch condition "]; - subgraph cluster_4 { - color=blue - 4 [label="Enter ||"]; - 5 [label="Access variable R|/b|"]; - 6 [label="Exit left part of ||"]; - 7 [label="Enter right part of ||"]; - 8 [label="Const: Boolean(false)"]; - 9 [label="Exit ||"]; - } - 10 [label="Exit when branch condition"]; + 3 [label="Enter ||"]; + 4 [label="Access variable R|/b|"]; + 5 [label="Exit left part of ||"]; + 6 [label="Enter right part of ||"]; + 7 [label="Const: Boolean(false)"]; + 8 [label="Exit ||"]; } - 11 [label="Synthetic else branch"]; - 12 [label="Enter when branch result"]; - subgraph cluster_5 { - color=blue - 13 [label="Enter block"]; - 14 [label="Const: Int(1)"]; - 15 [label="Exit block"]; - } - 16 [label="Exit when branch result"]; - 17 [label="Exit when"]; + 9 [label="Exit when branch condition"]; } - 18 [label="Exit block"]; + 10 [label="Synthetic else branch"]; + 11 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 12 [label="Enter block"]; + 13 [label="Const: Int(1)"]; + 14 [label="Exit block"]; + } + 15 [label="Exit when branch result"]; + 16 [label="Exit when"]; } - 19 [label="Exit function test_1" style="filled" fillcolor=red]; + 17 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -47,444 +42,393 @@ digraph booleanOperatorsWithConsts_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {9 7}; + 5 -> {8 6}; + 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; - 10 -> {12 11}; - 11 -> {17}; + 9 -> {11 10}; + 10 -> {16}; + 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - subgraph cluster_6 { + subgraph cluster_5 { color=red - 20 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_7 { + 18 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 21 [label="Enter block"]; - subgraph cluster_8 { + 19 [label="Enter when"]; + subgraph cluster_7 { color=blue - 22 [label="Enter when"]; - subgraph cluster_9 { + 20 [label="Enter when branch condition "]; + subgraph cluster_8 { color=blue - 23 [label="Enter when branch condition "]; - subgraph cluster_10 { - color=blue - 24 [label="Enter ||"]; - 25 [label="Const: Boolean(false)"]; - 26 [label="Exit left part of ||"]; - 27 [label="Enter right part of ||"]; - 28 [label="Access variable R|/b|"]; - 29 [label="Stub" style="filled" fillcolor=gray]; - 30 [label="Exit ||"]; - } - 31 [label="Exit when branch condition"]; + 21 [label="Enter ||"]; + 22 [label="Const: Boolean(false)"]; + 23 [label="Exit left part of ||"]; + 24 [label="Enter right part of ||"]; + 25 [label="Access variable R|/b|"]; + 26 [label="Stub" style="filled" fillcolor=gray]; + 27 [label="Exit ||"]; } - 32 [label="Synthetic else branch"]; - 33 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 34 [label="Enter block"]; - 35 [label="Const: Int(1)"]; - 36 [label="Exit block"]; - } - 37 [label="Exit when branch result"]; - 38 [label="Exit when"]; + 28 [label="Exit when branch condition"]; } - 39 [label="Exit block"]; + 29 [label="Synthetic else branch"]; + 30 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 31 [label="Enter block"]; + 32 [label="Const: Int(1)"]; + 33 [label="Exit block"]; + } + 34 [label="Exit when branch result"]; + 35 [label="Exit when"]; } - 40 [label="Exit function test_2" style="filled" fillcolor=red]; + 36 [label="Exit function test_2" style="filled" fillcolor=red]; } + 18 -> {19}; + 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; + 23 -> {26} [style=dotted]; 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 26 -> {29} [style=dotted]; + 25 -> {27}; + 26 -> {27} [style=dotted]; 27 -> {28}; - 28 -> {30}; - 29 -> {30} [style=dotted]; + 28 -> {30 29}; + 29 -> {35}; 30 -> {31}; - 31 -> {33 32}; - 32 -> {38}; + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {36}; - 36 -> {37}; + + subgraph cluster_10 { + color=red + 37 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 38 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 39 [label="Enter when branch condition "]; + subgraph cluster_13 { + color=blue + 40 [label="Enter ||"]; + 41 [label="Access variable R|/b|"]; + 42 [label="Exit left part of ||"]; + 43 [label="Enter right part of ||"]; + 44 [label="Const: Boolean(true)"]; + 45 [label="Exit ||"]; + } + 46 [label="Exit when branch condition"]; + } + 47 [label="Synthetic else branch"]; + 48 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 49 [label="Enter block"]; + 50 [label="Const: Int(1)"]; + 51 [label="Exit block"]; + } + 52 [label="Exit when branch result"]; + 53 [label="Exit when"]; + } + 54 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 37 -> {38}; 38 -> {39}; 39 -> {40}; - - subgraph cluster_12 { - color=red - 41 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 42 [label="Enter block"]; - subgraph cluster_14 { - color=blue - 43 [label="Enter when"]; - subgraph cluster_15 { - color=blue - 44 [label="Enter when branch condition "]; - subgraph cluster_16 { - color=blue - 45 [label="Enter ||"]; - 46 [label="Access variable R|/b|"]; - 47 [label="Exit left part of ||"]; - 48 [label="Enter right part of ||"]; - 49 [label="Const: Boolean(true)"]; - 50 [label="Exit ||"]; - } - 51 [label="Exit when branch condition"]; - } - 52 [label="Synthetic else branch"]; - 53 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 54 [label="Enter block"]; - 55 [label="Const: Int(1)"]; - 56 [label="Exit block"]; - } - 57 [label="Exit when branch result"]; - 58 [label="Exit when"]; - } - 59 [label="Exit block"]; - } - 60 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 40 -> {41}; 41 -> {42}; - 42 -> {43}; + 42 -> {45 43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {47}; - 47 -> {50 48}; + 46 -> {48 47}; + 47 -> {53}; 48 -> {49}; 49 -> {50}; 50 -> {51}; - 51 -> {53 52}; - 52 -> {58}; + 51 -> {52}; + 52 -> {53}; 53 -> {54}; - 54 -> {55}; + + subgraph cluster_15 { + color=red + 55 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 56 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 57 [label="Enter when branch condition "]; + subgraph cluster_18 { + color=blue + 58 [label="Enter ||"]; + 59 [label="Const: Boolean(true)"]; + 60 [label="Exit left part of ||"]; + 61 [label="Stub" style="filled" fillcolor=gray]; + 62 [label="Enter right part of ||" style="filled" fillcolor=gray]; + 63 [label="Access variable R|/b|" style="filled" fillcolor=gray]; + 64 [label="Exit ||"]; + } + 65 [label="Exit when branch condition"]; + } + 66 [label="Synthetic else branch"]; + 67 [label="Enter when branch result"]; + subgraph cluster_19 { + color=blue + 68 [label="Enter block"]; + 69 [label="Const: Int(1)"]; + 70 [label="Exit block"]; + } + 71 [label="Exit when branch result"]; + 72 [label="Exit when"]; + } + 73 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; 59 -> {60}; + 60 -> {64}; + 60 -> {61} [style=dotted]; + 61 -> {62} [style=dotted]; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {65}; + 65 -> {67 66}; + 66 -> {72}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; - subgraph cluster_18 { + subgraph cluster_20 { color=red - 61 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_19 { + 74 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_21 { color=blue - 62 [label="Enter block"]; - subgraph cluster_20 { + 75 [label="Enter when"]; + subgraph cluster_22 { color=blue - 63 [label="Enter when"]; - subgraph cluster_21 { - color=blue - 64 [label="Enter when branch condition "]; - subgraph cluster_22 { - color=blue - 65 [label="Enter ||"]; - 66 [label="Const: Boolean(true)"]; - 67 [label="Exit left part of ||"]; - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Enter right part of ||" style="filled" fillcolor=gray]; - 70 [label="Access variable R|/b|" style="filled" fillcolor=gray]; - 71 [label="Exit ||"]; - } - 72 [label="Exit when branch condition"]; - } - 73 [label="Synthetic else branch"]; - 74 [label="Enter when branch result"]; + 76 [label="Enter when branch condition "]; subgraph cluster_23 { color=blue - 75 [label="Enter block"]; - 76 [label="Const: Int(1)"]; - 77 [label="Exit block"]; + 77 [label="Enter &&"]; + 78 [label="Access variable R|/b|"]; + 79 [label="Exit left part of &&"]; + 80 [label="Enter right part of &&"]; + 81 [label="Const: Boolean(false)"]; + 82 [label="Exit &&"]; } - 78 [label="Exit when branch result"]; - 79 [label="Exit when"]; + 83 [label="Exit when branch condition"]; } - 80 [label="Exit block"]; + 84 [label="Synthetic else branch"]; + 85 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 86 [label="Enter block"]; + 87 [label="Const: Int(1)"]; + 88 [label="Exit block"]; + } + 89 [label="Exit when branch result"]; + 90 [label="Exit when"]; } - 81 [label="Exit function test_4" style="filled" fillcolor=red]; + 91 [label="Exit function test_5" style="filled" fillcolor=red]; } - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {71}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; - 71 -> {72}; - 72 -> {74 73}; - 73 -> {79}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - 79 -> {80}; + 79 -> {82 80}; 80 -> {81}; - - subgraph cluster_24 { - color=red - 82 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_25 { - color=blue - 83 [label="Enter block"]; - subgraph cluster_26 { - color=blue - 84 [label="Enter when"]; - subgraph cluster_27 { - color=blue - 85 [label="Enter when branch condition "]; - subgraph cluster_28 { - color=blue - 86 [label="Enter &&"]; - 87 [label="Access variable R|/b|"]; - 88 [label="Exit left part of &&"]; - 89 [label="Enter right part of &&"]; - 90 [label="Const: Boolean(false)"]; - 91 [label="Exit &&"]; - } - 92 [label="Exit when branch condition"]; - } - 93 [label="Synthetic else branch"]; - 94 [label="Enter when branch result"]; - subgraph cluster_29 { - color=blue - 95 [label="Enter block"]; - 96 [label="Const: Int(1)"]; - 97 [label="Exit block"]; - } - 98 [label="Exit when branch result"]; - 99 [label="Exit when"]; - } - 100 [label="Exit block"]; - } - 101 [label="Exit function test_5" style="filled" fillcolor=red]; - } - + 81 -> {82}; 82 -> {83}; - 83 -> {84}; - 84 -> {85}; + 83 -> {85 84}; + 84 -> {90}; 85 -> {86}; 86 -> {87}; 87 -> {88}; - 88 -> {91 89}; + 88 -> {89}; 89 -> {90}; 90 -> {91}; - 91 -> {92}; - 92 -> {94 93}; - 93 -> {99}; + + subgraph cluster_25 { + color=red + 92 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_26 { + color=blue + 93 [label="Enter when"]; + subgraph cluster_27 { + color=blue + 94 [label="Enter when branch condition "]; + subgraph cluster_28 { + color=blue + 95 [label="Enter &&"]; + 96 [label="Const: Boolean(false)"]; + 97 [label="Exit left part of &&"]; + 98 [label="Stub" style="filled" fillcolor=gray]; + 99 [label="Enter right part of &&" style="filled" fillcolor=gray]; + 100 [label="Access variable R|/b|" style="filled" fillcolor=gray]; + 101 [label="Exit &&"]; + } + 102 [label="Exit when branch condition"]; + } + 103 [label="Synthetic else branch"]; + 104 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 105 [label="Enter block"]; + 106 [label="Const: Int(1)"]; + 107 [label="Exit block"]; + } + 108 [label="Exit when branch result"]; + 109 [label="Exit when"]; + } + 110 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 92 -> {93}; + 93 -> {94}; 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - - subgraph cluster_30 { - color=red - 102 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_31 { - color=blue - 103 [label="Enter block"]; - subgraph cluster_32 { - color=blue - 104 [label="Enter when"]; - subgraph cluster_33 { - color=blue - 105 [label="Enter when branch condition "]; - subgraph cluster_34 { - color=blue - 106 [label="Enter &&"]; - 107 [label="Const: Boolean(false)"]; - 108 [label="Exit left part of &&"]; - 109 [label="Stub" style="filled" fillcolor=gray]; - 110 [label="Enter right part of &&" style="filled" fillcolor=gray]; - 111 [label="Access variable R|/b|" style="filled" fillcolor=gray]; - 112 [label="Exit &&"]; - } - 113 [label="Exit when branch condition"]; - } - 114 [label="Synthetic else branch"]; - 115 [label="Enter when branch result"]; - subgraph cluster_35 { - color=blue - 116 [label="Enter block"]; - 117 [label="Const: Int(1)"]; - 118 [label="Exit block"]; - } - 119 [label="Exit when branch result"]; - 120 [label="Exit when"]; - } - 121 [label="Exit block"]; - } - 122 [label="Exit function test_6" style="filled" fillcolor=red]; - } - - 102 -> {103}; - 103 -> {104}; + 97 -> {101}; + 97 -> {98} [style=dotted]; + 98 -> {99} [style=dotted]; + 99 -> {100} [style=dotted]; + 100 -> {101} [style=dotted]; + 101 -> {102}; + 102 -> {104 103}; + 103 -> {109}; 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; - 108 -> {112}; - 108 -> {109} [style=dotted]; - 109 -> {110} [style=dotted]; - 110 -> {111} [style=dotted]; - 111 -> {112} [style=dotted]; + 108 -> {109}; + 109 -> {110}; + + subgraph cluster_30 { + color=red + 111 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_31 { + color=blue + 112 [label="Enter when"]; + subgraph cluster_32 { + color=blue + 113 [label="Enter when branch condition "]; + subgraph cluster_33 { + color=blue + 114 [label="Enter &&"]; + 115 [label="Access variable R|/b|"]; + 116 [label="Exit left part of &&"]; + 117 [label="Enter right part of &&"]; + 118 [label="Const: Boolean(true)"]; + 119 [label="Exit &&"]; + } + 120 [label="Exit when branch condition"]; + } + 121 [label="Synthetic else branch"]; + 122 [label="Enter when branch result"]; + subgraph cluster_34 { + color=blue + 123 [label="Enter block"]; + 124 [label="Const: Int(1)"]; + 125 [label="Exit block"]; + } + 126 [label="Exit when branch result"]; + 127 [label="Exit when"]; + } + 128 [label="Exit function test_7" style="filled" fillcolor=red]; + } + + 111 -> {112}; 112 -> {113}; - 113 -> {115 114}; - 114 -> {120}; + 113 -> {114}; + 114 -> {115}; 115 -> {116}; - 116 -> {117}; + 116 -> {119 117}; 117 -> {118}; 118 -> {119}; 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - - subgraph cluster_36 { - color=red - 123 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_37 { - color=blue - 124 [label="Enter block"]; - subgraph cluster_38 { - color=blue - 125 [label="Enter when"]; - subgraph cluster_39 { - color=blue - 126 [label="Enter when branch condition "]; - subgraph cluster_40 { - color=blue - 127 [label="Enter &&"]; - 128 [label="Access variable R|/b|"]; - 129 [label="Exit left part of &&"]; - 130 [label="Enter right part of &&"]; - 131 [label="Const: Boolean(true)"]; - 132 [label="Exit &&"]; - } - 133 [label="Exit when branch condition"]; - } - 134 [label="Synthetic else branch"]; - 135 [label="Enter when branch result"]; - subgraph cluster_41 { - color=blue - 136 [label="Enter block"]; - 137 [label="Const: Int(1)"]; - 138 [label="Exit block"]; - } - 139 [label="Exit when branch result"]; - 140 [label="Exit when"]; - } - 141 [label="Exit block"]; - } - 142 [label="Exit function test_7" style="filled" fillcolor=red]; - } - + 120 -> {122 121}; + 121 -> {127}; + 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; 126 -> {127}; 127 -> {128}; - 128 -> {129}; - 129 -> {132 130}; + + subgraph cluster_35 { + color=red + 129 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_36 { + color=blue + 130 [label="Enter when"]; + subgraph cluster_37 { + color=blue + 131 [label="Enter when branch condition "]; + subgraph cluster_38 { + color=blue + 132 [label="Enter &&"]; + 133 [label="Const: Boolean(true)"]; + 134 [label="Exit left part of &&"]; + 135 [label="Enter right part of &&"]; + 136 [label="Access variable R|/b|"]; + 137 [label="Stub" style="filled" fillcolor=gray]; + 138 [label="Exit &&"]; + } + 139 [label="Exit when branch condition"]; + } + 140 [label="Synthetic else branch"]; + 141 [label="Enter when branch result"]; + subgraph cluster_39 { + color=blue + 142 [label="Enter block"]; + 143 [label="Const: Int(1)"]; + 144 [label="Exit block"]; + } + 145 [label="Exit when branch result"]; + 146 [label="Exit when"]; + } + 147 [label="Exit function test_8" style="filled" fillcolor=red]; + } + + 129 -> {130}; 130 -> {131}; 131 -> {132}; 132 -> {133}; - 133 -> {135 134}; - 134 -> {140}; + 133 -> {134}; + 134 -> {135}; + 134 -> {137} [style=dotted]; 135 -> {136}; - 136 -> {137}; - 137 -> {138}; + 136 -> {138}; + 137 -> {138} [style=dotted]; 138 -> {139}; - 139 -> {140}; - 140 -> {141}; + 139 -> {141 140}; + 140 -> {146}; 141 -> {142}; - - subgraph cluster_42 { - color=red - 143 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_43 { - color=blue - 144 [label="Enter block"]; - subgraph cluster_44 { - color=blue - 145 [label="Enter when"]; - subgraph cluster_45 { - color=blue - 146 [label="Enter when branch condition "]; - subgraph cluster_46 { - color=blue - 147 [label="Enter &&"]; - 148 [label="Const: Boolean(true)"]; - 149 [label="Exit left part of &&"]; - 150 [label="Enter right part of &&"]; - 151 [label="Access variable R|/b|"]; - 152 [label="Stub" style="filled" fillcolor=gray]; - 153 [label="Exit &&"]; - } - 154 [label="Exit when branch condition"]; - } - 155 [label="Synthetic else branch"]; - 156 [label="Enter when branch result"]; - subgraph cluster_47 { - color=blue - 157 [label="Enter block"]; - 158 [label="Const: Int(1)"]; - 159 [label="Exit block"]; - } - 160 [label="Exit when branch result"]; - 161 [label="Exit when"]; - } - 162 [label="Exit block"]; - } - 163 [label="Exit function test_8" style="filled" fillcolor=red]; - } - + 142 -> {143}; 143 -> {144}; 144 -> {145}; 145 -> {146}; 146 -> {147}; - 147 -> {148}; - 148 -> {149}; - 149 -> {150}; - 149 -> {152} [style=dotted]; - 150 -> {151}; - 151 -> {153}; - 152 -> {153} [style=dotted]; - 153 -> {154}; - 154 -> {156 155}; - 155 -> {161}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162}; - 162 -> {163}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.dot b/compiler/fir/resolve/testData/resolve/cfg/complex.dot index 4f6dfabf1ad..2860165170c 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.dot @@ -6,81 +6,76 @@ digraph complex_kt { subgraph cluster_0 { color=red 0 [label="Enter function fetchPluginReleaseDate" style="filled" fillcolor=red]; + 1 [label="Const: String(https://plugins.jetbrains.com/api/plugins/)"]; + 2 [label="Access variable R|/pluginId|"]; + 3 [label="Access variable #"]; + 4 [label="Const: String(/updates?version=)"]; + 5 [label="Access variable R|/version|"]; + 6 [label="Variable declaration: lval url: R|kotlin/String|"]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; - 2 [label="Const: String(https://plugins.jetbrains.com/api/plugins/)"]; - 3 [label="Access variable R|/pluginId|"]; - 4 [label="Access variable #"]; - 5 [label="Const: String(/updates?version=)"]; - 6 [label="Access variable R|/version|"]; - 7 [label="Variable declaration: lval url: R|kotlin/String|"]; + 7 [label="Try expression enter"]; subgraph cluster_2 { color=blue - 8 [label="Try expression enter"]; + 8 [label="Try main block enter"]; subgraph cluster_3 { color=blue - 9 [label="Try main block enter"]; - subgraph cluster_4 { - color=blue - 10 [label="Enter block"]; - 11 [label="Access variable #"]; - 12 [label="Access variable R|/url|"]; - 13 [label="Access variable R|/url|"]; - 14 [label="Function call: #.#(R|/url|)"]; - 15 [label="Function call: #.#(R|/url|).#( = connect@fun .(): { + 9 [label="Enter block"]; + 10 [label="Access variable #"]; + 11 [label="Access variable R|/url|"]; + 12 [label="Access variable R|/url|"]; + 13 [label="Function call: #.#(R|/url|)"]; + 14 [label="Function call: #.#(R|/url|).#( = connect@fun .(): { #().#().#(#.#.#(), (#()).#) } )"]; - 16 [label="Exit block"]; - } - 17 [label="Try main block exit"]; + 15 [label="Exit block"]; } + 16 [label="Try main block exit"]; + } + subgraph cluster_4 { + color=blue + 17 [label="Catch enter"]; subgraph cluster_5 { color=blue - 18 [label="Catch enter"]; - subgraph cluster_6 { - color=blue - 19 [label="Enter block"]; - 20 [label="Const: String(Can't parse json response)"]; - 21 [label="Access variable R|/syntaxException|"]; - 22 [label="Const: String(Can't parse json response)"]; - 23 [label="Access variable R|/syntaxException|"]; - 24 [label="Function call: #(String(Can't parse json response), R|/syntaxException|)"]; - 25 [label="Throw: throw #(String(Can't parse json response), R|/syntaxException|)"]; - 26 [label="Stub" style="filled" fillcolor=gray]; - 27 [label="Exit block" style="filled" fillcolor=gray]; - } - 28 [label="Catch exit" style="filled" fillcolor=gray]; + 18 [label="Enter block"]; + 19 [label="Const: String(Can't parse json response)"]; + 20 [label="Access variable R|/syntaxException|"]; + 21 [label="Const: String(Can't parse json response)"]; + 22 [label="Access variable R|/syntaxException|"]; + 23 [label="Function call: #(String(Can't parse json response), R|/syntaxException|)"]; + 24 [label="Throw: throw #(String(Can't parse json response), R|/syntaxException|)"]; + 25 [label="Stub" style="filled" fillcolor=gray]; + 26 [label="Exit block" style="filled" fillcolor=gray]; } + 27 [label="Catch exit" style="filled" fillcolor=gray]; + } + subgraph cluster_6 { + color=blue + 28 [label="Catch enter"]; subgraph cluster_7 { color=blue - 29 [label="Catch enter"]; - subgraph cluster_8 { - color=blue - 30 [label="Enter block"]; - 31 [label="Access variable R|/ioException|"]; - 32 [label="Access variable R|/ioException|"]; - 33 [label="Function call: #(R|/ioException|)"]; - 34 [label="Throw: throw #(R|/ioException|)"]; - 35 [label="Stub" style="filled" fillcolor=gray]; - 36 [label="Exit block" style="filled" fillcolor=gray]; - } - 37 [label="Catch exit" style="filled" fillcolor=gray]; + 29 [label="Enter block"]; + 30 [label="Access variable R|/ioException|"]; + 31 [label="Access variable R|/ioException|"]; + 32 [label="Function call: #(R|/ioException|)"]; + 33 [label="Throw: throw #(R|/ioException|)"]; + 34 [label="Stub" style="filled" fillcolor=gray]; + 35 [label="Exit block" style="filled" fillcolor=gray]; } - 38 [label="Try expression exit"]; + 36 [label="Catch exit" style="filled" fillcolor=gray]; } - 39 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array|"]; - 40 [label="Exit block"]; + 37 [label="Try expression exit"]; } - subgraph cluster_9 { - color=blue - 41 [label="Enter annotation"]; - 42 [label="Access variable #"]; - 43 [label="Access variable #"]; - 44 [label="Exit annotation"]; - } - 45 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red]; + 38 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array|"]; + 39 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red]; + } + subgraph cluster_8 { + color=blue + 40 [label="Enter annotation"]; + 41 [label="Access variable #"]; + 42 [label="Access variable #"]; + 43 [label="Exit annotation"]; } 0 -> {1}; @@ -91,66 +86,61 @@ digraph complex_kt { 5 -> {6}; 6 -> {7}; 7 -> {8}; - 8 -> {9}; - 9 -> {45 29 18 10}; + 8 -> {39 28 17 9}; + 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {38}; - 18 -> {45 19}; + 16 -> {37}; + 17 -> {39 18}; + 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; - 24 -> {25}; - 25 -> {45}; + 24 -> {39}; + 24 -> {25} [style=dotted]; 25 -> {26} [style=dotted]; 26 -> {27} [style=dotted]; - 27 -> {28} [style=dotted]; - 28 -> {38} [style=dotted]; - 29 -> {45 30}; + 27 -> {37} [style=dotted]; + 28 -> {39 29}; + 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; - 33 -> {34}; - 34 -> {45}; + 33 -> {39}; + 33 -> {34} [style=dotted]; 34 -> {35} [style=dotted]; 35 -> {36} [style=dotted]; 36 -> {37} [style=dotted]; - 37 -> {38} [style=dotted]; + 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - subgraph cluster_10 { + subgraph cluster_9 { color=red - 46 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 47 [label="Enter block"]; - 48 [label="Function call: #()"]; - 49 [label="Function call: #().#()"]; - 50 [label="Access variable #"]; - 51 [label="Access variable #"]; - 52 [label="Function call: #.#.#()"]; - 53 [label="Function call: #()"]; - 54 [label="Access variable #"]; - 55 [label="Access variable #"]; - 56 [label="Function call: #().#().#(#.#.#(), (#()).#)"]; - 57 [label="Exit block"]; - } - 58 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 44 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 45 [label="Function call: #()"]; + 46 [label="Function call: #().#()"]; + 47 [label="Access variable #"]; + 48 [label="Access variable #"]; + 49 [label="Function call: #.#.#()"]; + 50 [label="Function call: #()"]; + 51 [label="Access variable #"]; + 52 [label="Access variable #"]; + 53 [label="Function call: #().#().#(#.#.#(), (#()).#)"]; + 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } + 44 -> {45}; + 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; @@ -159,103 +149,96 @@ digraph complex_kt { 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - subgraph cluster_12 { + subgraph cluster_10 { color=red - 59 [label="Enter function close" style="filled" fillcolor=red]; - 60 [label="Exit function close" style="filled" fillcolor=red]; + 55 [label="Enter function close" style="filled" fillcolor=red]; + 56 [label="Exit function close" style="filled" fillcolor=red]; } - 59 -> {60}; + 55 -> {56}; - subgraph cluster_13 { + subgraph cluster_11 { color=red - 61 [label="Enter function closeFinally" style="filled" fillcolor=red]; - subgraph cluster_14 { + 57 [label="Enter function closeFinally" style="filled" fillcolor=red]; + subgraph cluster_12 { color=blue - 62 [label="Enter block"]; + 58 [label="Enter when"]; + subgraph cluster_13 { + color=blue + 59 [label="Enter when branch condition "]; + 60 [label="Access variable this@R|/closeFinally|"]; + 61 [label="Const: Null(null)"]; + 62 [label="Operator =="]; + 63 [label="Exit when branch condition"]; + } + subgraph cluster_14 { + color=blue + 64 [label="Enter when branch condition "]; + 65 [label="Access variable R|/cause|"]; + 66 [label="Const: Null(null)"]; + 67 [label="Operator =="]; + 68 [label="Exit when branch condition"]; + } subgraph cluster_15 { color=blue - 63 [label="Enter when"]; - subgraph cluster_16 { - color=blue - 64 [label="Enter when branch condition "]; - 65 [label="Access variable this@R|/closeFinally|"]; - 66 [label="Const: Null(null)"]; - 67 [label="Operator =="]; - 68 [label="Exit when branch condition"]; - } + 69 [label="Enter when branch condition else"]; + 70 [label="Exit when branch condition"]; + } + 71 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 72 [label="Enter block"]; subgraph cluster_17 { color=blue - 69 [label="Enter when branch condition "]; - 70 [label="Access variable R|/cause|"]; - 71 [label="Const: Null(null)"]; - 72 [label="Operator =="]; - 73 [label="Exit when branch condition"]; - } - subgraph cluster_18 { - color=blue - 74 [label="Enter when branch condition else"]; - 75 [label="Exit when branch condition"]; - } - 76 [label="Enter when branch result"]; - subgraph cluster_19 { - color=blue - 77 [label="Enter block"]; + 73 [label="Try expression enter"]; + subgraph cluster_18 { + color=blue + 74 [label="Try main block enter"]; + subgraph cluster_19 { + color=blue + 75 [label="Enter block"]; + 76 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"]; + 77 [label="Exit block"]; + } + 78 [label="Try main block exit"]; + } subgraph cluster_20 { color=blue - 78 [label="Try expression enter"]; + 79 [label="Catch enter"]; subgraph cluster_21 { color=blue - 79 [label="Try main block enter"]; - subgraph cluster_22 { - color=blue - 80 [label="Enter block"]; - 81 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"]; - 82 [label="Exit block"]; - } - 83 [label="Try main block exit"]; + 80 [label="Enter block"]; + 81 [label="Access variable R|/cause|"]; + 82 [label="Access variable R|/closeException|"]; + 83 [label="Function call: R|/cause|.R|kotlin/addSuppressed|(R|/closeException|)"]; + 84 [label="Exit block"]; } - subgraph cluster_23 { - color=blue - 84 [label="Catch enter"]; - subgraph cluster_24 { - color=blue - 85 [label="Enter block"]; - 86 [label="Access variable R|/cause|"]; - 87 [label="Access variable R|/closeException|"]; - 88 [label="Function call: R|/cause|.R|kotlin/addSuppressed|(R|/closeException|)"]; - 89 [label="Exit block"]; - } - 90 [label="Catch exit"]; - } - 91 [label="Try expression exit"]; + 85 [label="Catch exit"]; } - 92 [label="Exit block"]; + 86 [label="Try expression exit"]; } - 93 [label="Exit when branch result"]; - 94 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 95 [label="Enter block"]; - 96 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"]; - 97 [label="Exit block"]; - } - 98 [label="Exit when branch result"]; - 99 [label="Enter when branch result"]; - subgraph cluster_26 { - color=blue - 100 [label="Enter block"]; - 101 [label="Exit block"]; - } - 102 [label="Exit when branch result"]; - 103 [label="Exit when"]; + 87 [label="Exit block"]; } - 104 [label="Jump: ^closeFinally when () { + 88 [label="Exit when branch result"]; + 89 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 90 [label="Enter block"]; + 91 [label="Function call: this@R|/AutoCloseable|.R|/AutoCloseable.close|()"]; + 92 [label="Exit block"]; + } + 93 [label="Exit when branch result"]; + 94 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 95 [label="Enter block"]; + 96 [label="Exit block"]; + } + 97 [label="Exit when branch result"]; + 98 [label="Exit when"]; + } + 99 [label="Jump: ^closeFinally when () { ==(this@R|/closeFinally|, Null(null)) -> { } ==(R|/cause|, Null(null)) -> { @@ -272,166 +255,155 @@ digraph complex_kt { } } "]; - 105 [label="Stub" style="filled" fillcolor=gray]; - 106 [label="Exit block" style="filled" fillcolor=gray]; - } - 107 [label="Exit function closeFinally" style="filled" fillcolor=red]; + 100 [label="Stub" style="filled" fillcolor=gray]; + 101 [label="Exit function closeFinally" style="filled" fillcolor=red]; } + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; 61 -> {62}; 62 -> {63}; - 63 -> {64}; + 63 -> {94 64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; - 68 -> {99 69}; + 68 -> {89 69}; 69 -> {70}; 70 -> {71}; 71 -> {72}; 72 -> {73}; - 73 -> {94 74}; - 74 -> {75}; + 73 -> {74}; + 74 -> {101 79 75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; - 78 -> {79}; - 79 -> {107 84 80}; + 78 -> {86}; + 79 -> {101 80}; 80 -> {81}; 81 -> {82}; 82 -> {83}; - 83 -> {91}; - 84 -> {107 85}; + 83 -> {84}; + 84 -> {85}; 85 -> {86}; 86 -> {87}; 87 -> {88}; - 88 -> {89}; + 88 -> {98}; 89 -> {90}; 90 -> {91}; 91 -> {92}; 92 -> {93}; - 93 -> {103}; + 93 -> {98}; 94 -> {95}; 95 -> {96}; 96 -> {97}; 97 -> {98}; - 98 -> {103}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {107}; - 104 -> {105} [style=dotted]; - 105 -> {106} [style=dotted]; - 106 -> {107} [style=dotted]; + 98 -> {99}; + 99 -> {101}; + 99 -> {100} [style=dotted]; + 100 -> {101} [style=dotted]; - subgraph cluster_27 { + subgraph cluster_24 { color=red - 108 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red]; - subgraph cluster_28 { + 102 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red]; + 103 [label="Access variable this@R|/firstIsInstanceOrNull|"]; + 104 [label="Variable declaration: lval : R|kotlin/sequences/Sequence<*>|"]; + 105 [label="Access variable R|/|"]; + 106 [label="Function call: R|/|.R|kotlin/sequences/Sequence.iterator|()"]; + 107 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; + subgraph cluster_25 { color=blue - 109 [label="Enter block"]; - 110 [label="Access variable this@R|/firstIsInstanceOrNull|"]; - 111 [label="Variable declaration: lval : R|kotlin/sequences/Sequence<*>|"]; - 112 [label="Access variable R|/|"]; - 113 [label="Function call: R|/|.R|kotlin/sequences/Sequence.iterator|()"]; - 114 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; - subgraph cluster_29 { + 108 [label="Enter while loop"]; + subgraph cluster_26 { color=blue - 115 [label="Enter while loop"]; - subgraph cluster_30 { - color=blue - 116 [label="Enter loop condition"]; - 117 [label="Access variable R|/|"]; - 118 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 119 [label="Exit loop condition"]; - } - subgraph cluster_31 { - color=blue - 120 [label="Enter loop block"]; - subgraph cluster_32 { - color=blue - 121 [label="Enter block"]; - 122 [label="Access variable R|/|"]; - 123 [label="Function call: R|/|.R|FakeOverride|()"]; - 124 [label="Variable declaration: lval element: R|T|"]; - subgraph cluster_33 { - color=blue - 125 [label="Enter when"]; - subgraph cluster_34 { - color=blue - 126 [label="Enter when branch condition "]; - 127 [label="Access variable R|/element|"]; - 128 [label="Type operator: element is T"]; - 129 [label="Exit when branch condition"]; - } - 130 [label="Synthetic else branch"]; - 131 [label="Enter when branch result"]; - subgraph cluster_35 { - color=blue - 132 [label="Enter block"]; - 133 [label="Access variable R|/element|"]; - 134 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; - 135 [label="Stub" style="filled" fillcolor=gray]; - 136 [label="Exit block" style="filled" fillcolor=gray]; - } - 137 [label="Exit when branch result" style="filled" fillcolor=gray]; - 138 [label="Exit when"]; - } - 139 [label="Exit block"]; - } - 140 [label="Exit loop block"]; - } - 141 [label="Exit whileloop"]; + 109 [label="Enter loop condition"]; + 110 [label="Access variable R|/|"]; + 111 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 112 [label="Exit loop condition"]; } - 142 [label="Const: Null(null)"]; - 143 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; - 144 [label="Stub" style="filled" fillcolor=gray]; - 145 [label="Exit block" style="filled" fillcolor=gray]; + subgraph cluster_27 { + color=blue + 113 [label="Enter loop block"]; + subgraph cluster_28 { + color=blue + 114 [label="Enter block"]; + 115 [label="Access variable R|/|"]; + 116 [label="Function call: R|/|.R|FakeOverride|()"]; + 117 [label="Variable declaration: lval element: R|T|"]; + subgraph cluster_29 { + color=blue + 118 [label="Enter when"]; + subgraph cluster_30 { + color=blue + 119 [label="Enter when branch condition "]; + 120 [label="Access variable R|/element|"]; + 121 [label="Type operator: element is T"]; + 122 [label="Exit when branch condition"]; + } + 123 [label="Synthetic else branch"]; + 124 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 125 [label="Enter block"]; + 126 [label="Access variable R|/element|"]; + 127 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; + 128 [label="Stub" style="filled" fillcolor=gray]; + 129 [label="Exit block" style="filled" fillcolor=gray]; + } + 130 [label="Exit when branch result" style="filled" fillcolor=gray]; + 131 [label="Exit when"]; + } + 132 [label="Exit block"]; + } + 133 [label="Exit loop block"]; + } + 134 [label="Exit whileloop"]; } - 146 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; + 135 [label="Const: Null(null)"]; + 136 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; + 137 [label="Stub" style="filled" fillcolor=gray]; + 138 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; } + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; 111 -> {112}; - 112 -> {113}; + 112 -> {134 113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; 116 -> {117}; 117 -> {118}; 118 -> {119}; - 119 -> {141 120}; + 119 -> {120}; 120 -> {121}; 121 -> {122}; - 122 -> {123}; - 123 -> {124}; + 122 -> {124 123}; + 123 -> {131}; 124 -> {125}; 125 -> {126}; 126 -> {127}; - 127 -> {128}; - 128 -> {129}; - 129 -> {131 130}; - 130 -> {138}; + 127 -> {138}; + 127 -> {128} [style=dotted]; + 128 -> {129} [style=dotted]; + 129 -> {130} [style=dotted]; + 130 -> {131} [style=dotted]; 131 -> {132}; 132 -> {133}; - 133 -> {134}; - 134 -> {146}; - 134 -> {135} [style=dotted]; - 135 -> {136} [style=dotted]; + 133 -> {109}; + 134 -> {135}; + 135 -> {136}; + 136 -> {138}; 136 -> {137} [style=dotted]; 137 -> {138} [style=dotted]; - 138 -> {139}; - 139 -> {140}; - 140 -> {116}; - 141 -> {142}; - 142 -> {143}; - 143 -> {146}; - 143 -> {144} [style=dotted]; - 144 -> {145} [style=dotted]; - 145 -> {146} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot b/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot index 652505f1657..b5b84bc976f 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot @@ -8,77 +8,56 @@ digraph emptyWhen_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; - subgraph cluster_2 { - color=blue - 2 [label="Enter when"]; - 3 [label="Synthetic else branch"]; - 4 [label="Exit when"]; - } - 5 [label="Exit block"]; + 1 [label="Enter when"]; + 2 [label="Synthetic else branch"]; + 3 [label="Exit when"]; } - 6 [label="Exit function test_1" style="filled" fillcolor=red]; + 4 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; 2 -> {3}; 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 7 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_4 { + 5 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_3 { color=blue - 8 [label="Enter block"]; - subgraph cluster_5 { - color=blue - 9 [label="Enter when"]; - 10 [label="Access variable R|/x|"]; - 11 [label="Synthetic else branch"]; - 12 [label="Exit when"]; - } - 13 [label="Exit block"]; + 6 [label="Enter when"]; + 7 [label="Access variable R|/x|"]; + 8 [label="Synthetic else branch"]; + 9 [label="Exit when"]; } - 14 [label="Exit function test_2" style="filled" fillcolor=red]; + 10 [label="Exit function test_2" style="filled" fillcolor=red]; } + 5 -> {6}; + 6 -> {7}; 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; + + subgraph cluster_4 { + color=red + 11 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 12 [label="Enter when"]; + 13 [label="Access variable R|/x|"]; + 14 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 15 [label="Synthetic else branch"]; + 16 [label="Exit when"]; + } + 17 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 11 -> {12}; 12 -> {13}; 13 -> {14}; - - subgraph cluster_6 { - color=red - 15 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 16 [label="Enter block"]; - subgraph cluster_8 { - color=blue - 17 [label="Enter when"]; - 18 [label="Access variable R|/x|"]; - 19 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 20 [label="Synthetic else branch"]; - 21 [label="Exit when"]; - } - 22 [label="Exit block"]; - } - 23 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/jumps.dot b/compiler/fir/resolve/testData/resolve/cfg/jumps.dot index c1c1d38c7a0..d4baacf4616 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/jumps.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/jumps.dot @@ -8,49 +8,44 @@ digraph jumps_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Access variable R|/x|"]; - 5 [label="Const: Null(null)"]; - 6 [label="Operator =="]; - 7 [label="Exit when branch condition"]; - } - subgraph cluster_4 { - color=blue - 8 [label="Enter when branch condition else"]; - 9 [label="Exit when branch condition"]; - } - 10 [label="Enter when branch result"]; - subgraph cluster_5 { - color=blue - 11 [label="Enter block"]; - 12 [label="Access variable R|/x|"]; - 13 [label="Exit block"]; - } - 14 [label="Exit when branch result"]; - 15 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 16 [label="Enter block"]; - 17 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 18 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 19 [label="Stub" style="filled" fillcolor=gray]; - 20 [label="Exit block" style="filled" fillcolor=gray]; - } - 21 [label="Exit when branch result" style="filled" fillcolor=gray]; - 22 [label="Exit when"]; + 2 [label="Enter when branch condition "]; + 3 [label="Access variable R|/x|"]; + 4 [label="Const: Null(null)"]; + 5 [label="Operator =="]; + 6 [label="Exit when branch condition"]; } - 23 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 24 [label="Access variable R|/y|"]; - 25 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 26 [label="Exit block"]; + subgraph cluster_3 { + color=blue + 7 [label="Enter when branch condition else"]; + 8 [label="Exit when branch condition"]; + } + 9 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 10 [label="Enter block"]; + 11 [label="Access variable R|/x|"]; + 12 [label="Exit block"]; + } + 13 [label="Exit when branch result"]; + 14 [label="Enter when branch result"]; + subgraph cluster_5 { + color=blue + 15 [label="Enter block"]; + 16 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 17 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 18 [label="Stub" style="filled" fillcolor=gray]; + 19 [label="Exit block" style="filled" fillcolor=gray]; + } + 20 [label="Exit when branch result" style="filled" fillcolor=gray]; + 21 [label="Exit when"]; } - 27 [label="Exit function test_1" style="filled" fillcolor=red]; + 22 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 23 [label="Access variable R|/y|"]; + 24 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; + 25 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -59,357 +54,306 @@ digraph jumps_kt { 3 -> {4}; 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {15 8}; + 6 -> {14 7}; + 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {14}; - 14 -> {22}; + 13 -> {21}; + 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; - 18 -> {27}; + 17 -> {25}; + 17 -> {18} [style=dotted]; 18 -> {19} [style=dotted]; 19 -> {20} [style=dotted]; 20 -> {21} [style=dotted]; - 21 -> {22} [style=dotted]; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - subgraph cluster_7 { + subgraph cluster_6 { color=red - 28 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_8 { + 26 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { color=blue - 29 [label="Enter block"]; + 27 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 28 [label="Enter when branch condition "]; + 29 [label="Access variable R|/x|"]; + 30 [label="Const: Null(null)"]; + 31 [label="Operator =="]; + 32 [label="Exit when branch condition"]; + } subgraph cluster_9 { color=blue - 30 [label="Enter when"]; - subgraph cluster_10 { - color=blue - 31 [label="Enter when branch condition "]; - 32 [label="Access variable R|/x|"]; - 33 [label="Const: Null(null)"]; - 34 [label="Operator =="]; - 35 [label="Exit when branch condition"]; - } - subgraph cluster_11 { - color=blue - 36 [label="Enter when branch condition else"]; - 37 [label="Exit when branch condition"]; - } - 38 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 39 [label="Enter block"]; - 40 [label="Access variable R|/x|"]; - 41 [label="Exit block"]; - } - 42 [label="Exit when branch result"]; - 43 [label="Enter when branch result"]; - subgraph cluster_13 { - color=blue - 44 [label="Enter block"]; - 45 [label="Access variable R|/x|"]; - 46 [label="Exit block"]; - } - 47 [label="Exit when branch result"]; - 48 [label="Exit when"]; + 33 [label="Enter when branch condition else"]; + 34 [label="Exit when branch condition"]; } - 49 [label="Variable declaration: lval y: R|kotlin/Int?|"]; - 50 [label="Access variable R|/y|"]; - 51 [label="Function call: R|/y|.#()"]; - 52 [label="Exit block"]; + 35 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 36 [label="Enter block"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Exit block"]; + } + 39 [label="Exit when branch result"]; + 40 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 41 [label="Enter block"]; + 42 [label="Access variable R|/x|"]; + 43 [label="Exit block"]; + } + 44 [label="Exit when branch result"]; + 45 [label="Exit when"]; } - 53 [label="Exit function test_2" style="filled" fillcolor=red]; + 46 [label="Variable declaration: lval y: R|kotlin/Int?|"]; + 47 [label="Access variable R|/y|"]; + 48 [label="Function call: R|/y|.#()"]; + 49 [label="Exit function test_2" style="filled" fillcolor=red]; } + 26 -> {27}; + 27 -> {28}; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; + 32 -> {40 33}; 33 -> {34}; 34 -> {35}; - 35 -> {43 36}; + 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; - 39 -> {40}; + 39 -> {45}; 40 -> {41}; 41 -> {42}; - 42 -> {48}; + 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; - 49 -> {50}; + + subgraph cluster_12 { + color=red + 50 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 51 [label="Enter while loop"]; + subgraph cluster_14 { + color=blue + 52 [label="Enter loop condition"]; + 53 [label="Const: Boolean(true)"]; + 54 [label="Exit loop condition"]; + } + subgraph cluster_15 { + color=blue + 55 [label="Enter loop block"]; + subgraph cluster_16 { + color=blue + 56 [label="Enter block"]; + 57 [label="Access variable R|/x|"]; + 58 [label="Type operator: x as Int"]; + 59 [label="Jump: break@@@[Boolean(true)] "]; + 60 [label="Stub" style="filled" fillcolor=gray]; + 61 [label="Exit block" style="filled" fillcolor=gray]; + } + 62 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 63 [label="Stub" style="filled" fillcolor=gray]; + 64 [label="Exit whileloop"]; + } + 65 [label="Access variable R|/x|"]; + 66 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 67 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 50 -> {51}; 51 -> {52}; 52 -> {53}; - - subgraph cluster_14 { - color=red - 54 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 55 [label="Enter block"]; - subgraph cluster_16 { - color=blue - 56 [label="Enter while loop"]; - subgraph cluster_17 { - color=blue - 57 [label="Enter loop condition"]; - 58 [label="Const: Boolean(true)"]; - 59 [label="Exit loop condition"]; - } - subgraph cluster_18 { - color=blue - 60 [label="Enter loop block"]; - subgraph cluster_19 { - color=blue - 61 [label="Enter block"]; - 62 [label="Access variable R|/x|"]; - 63 [label="Type operator: x as Int"]; - 64 [label="Jump: break@@@[Boolean(true)] "]; - 65 [label="Stub" style="filled" fillcolor=gray]; - 66 [label="Exit block" style="filled" fillcolor=gray]; - } - 67 [label="Exit loop block" style="filled" fillcolor=gray]; - } - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Exit whileloop"]; - } - 70 [label="Access variable R|/x|"]; - 71 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 72 [label="Exit block"]; - } - 73 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 53 -> {54}; 54 -> {55}; + 54 -> {63} [style=dotted]; 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; - 59 -> {60}; - 59 -> {68} [style=dotted]; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {69}; - 64 -> {65} [style=dotted]; - 65 -> {66} [style=dotted]; - 66 -> {67} [style=dotted]; - 67 -> {57} [style=dotted]; - 68 -> {69} [style=dotted]; + 59 -> {64}; + 59 -> {60} [style=dotted]; + 60 -> {61} [style=dotted]; + 61 -> {62} [style=dotted]; + 62 -> {52} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + + subgraph cluster_17 { + color=red + 68 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 69 [label="Enter do-while loop"]; + subgraph cluster_19 { + color=blue + 70 [label="Enter loop block"]; + subgraph cluster_20 { + color=blue + 71 [label="Enter block"]; + 72 [label="Access variable R|/x|"]; + 73 [label="Type operator: x as Int"]; + 74 [label="Jump: break@@@[Boolean(true)] "]; + 75 [label="Stub" style="filled" fillcolor=gray]; + 76 [label="Exit block" style="filled" fillcolor=gray]; + } + 77 [label="Exit loop block" style="filled" fillcolor=gray]; + } + subgraph cluster_21 { + color=blue + 78 [label="Enter loop condition" style="filled" fillcolor=gray]; + 79 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; + 80 [label="Exit loop condition" style="filled" fillcolor=gray]; + } + 81 [label="Stub" style="filled" fillcolor=gray]; + 82 [label="Exit do-whileloop"]; + } + 83 [label="Access variable R|/x|"]; + 84 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 85 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 68 -> {69}; 69 -> {70}; 70 -> {71}; 71 -> {72}; 72 -> {73}; + 73 -> {74}; + 74 -> {82}; + 74 -> {75} [style=dotted]; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {70 81} [style=dotted]; + 81 -> {82} [style=dotted]; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; - subgraph cluster_20 { + subgraph cluster_22 { color=red - 74 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_21 { + 86 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_23 { color=blue - 75 [label="Enter block"]; - subgraph cluster_22 { + 87 [label="Enter while loop"]; + subgraph cluster_24 { color=blue - 76 [label="Enter do-while loop"]; - subgraph cluster_23 { - color=blue - 77 [label="Enter loop block"]; - subgraph cluster_24 { - color=blue - 78 [label="Enter block"]; - 79 [label="Access variable R|/x|"]; - 80 [label="Type operator: x as Int"]; - 81 [label="Jump: break@@@[Boolean(true)] "]; - 82 [label="Stub" style="filled" fillcolor=gray]; - 83 [label="Exit block" style="filled" fillcolor=gray]; - } - 84 [label="Exit loop block" style="filled" fillcolor=gray]; - } - subgraph cluster_25 { - color=blue - 85 [label="Enter loop condition" style="filled" fillcolor=gray]; - 86 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; - 87 [label="Exit loop condition" style="filled" fillcolor=gray]; - } - 88 [label="Stub" style="filled" fillcolor=gray]; - 89 [label="Exit do-whileloop"]; + 88 [label="Enter loop condition"]; + 89 [label="Access variable R|/b|"]; + 90 [label="Exit loop condition"]; } - 90 [label="Access variable R|/x|"]; - 91 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 92 [label="Exit block"]; + subgraph cluster_25 { + color=blue + 91 [label="Enter loop block"]; + subgraph cluster_26 { + color=blue + 92 [label="Enter block"]; + subgraph cluster_27 { + color=blue + 93 [label="Enter when"]; + subgraph cluster_28 { + color=blue + 94 [label="Enter when branch condition "]; + 95 [label="Access variable R|/b|"]; + 96 [label="Exit when branch condition"]; + } + 97 [label="Synthetic else branch"]; + 98 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 99 [label="Enter block"]; + 100 [label="Jump: continue@@@[R|/b|] "]; + 101 [label="Stub" style="filled" fillcolor=gray]; + 102 [label="Exit block" style="filled" fillcolor=gray]; + } + 103 [label="Exit when branch result" style="filled" fillcolor=gray]; + 104 [label="Exit when"]; + } + 105 [label="Exit block"]; + } + 106 [label="Exit loop block"]; + } + 107 [label="Exit whileloop"]; } - 93 [label="Exit function test_4" style="filled" fillcolor=red]; + 108 [label="Exit function test_5" style="filled" fillcolor=red]; } - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {89}; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; - 83 -> {84} [style=dotted]; - 84 -> {85} [style=dotted]; - 85 -> {86} [style=dotted]; - 86 -> {87} [style=dotted]; - 87 -> {77 88} [style=dotted]; - 88 -> {89} [style=dotted]; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; 89 -> {90}; - 90 -> {91}; + 90 -> {107 91}; 91 -> {92}; 92 -> {93}; - - subgraph cluster_26 { - color=red - 94 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_27 { - color=blue - 95 [label="Enter block"]; - subgraph cluster_28 { - color=blue - 96 [label="Enter while loop"]; - subgraph cluster_29 { - color=blue - 97 [label="Enter loop condition"]; - 98 [label="Access variable R|/b|"]; - 99 [label="Exit loop condition"]; - } - subgraph cluster_30 { - color=blue - 100 [label="Enter loop block"]; - subgraph cluster_31 { - color=blue - 101 [label="Enter block"]; - subgraph cluster_32 { - color=blue - 102 [label="Enter when"]; - subgraph cluster_33 { - color=blue - 103 [label="Enter when branch condition "]; - 104 [label="Access variable R|/b|"]; - 105 [label="Exit when branch condition"]; - } - 106 [label="Synthetic else branch"]; - 107 [label="Enter when branch result"]; - subgraph cluster_34 { - color=blue - 108 [label="Enter block"]; - 109 [label="Jump: continue@@@[R|/b|] "]; - 110 [label="Stub" style="filled" fillcolor=gray]; - 111 [label="Exit block" style="filled" fillcolor=gray]; - } - 112 [label="Exit when branch result" style="filled" fillcolor=gray]; - 113 [label="Exit when"]; - } - 114 [label="Exit block"]; - } - 115 [label="Exit loop block"]; - } - 116 [label="Exit whileloop"]; - } - 117 [label="Exit block"]; - } - 118 [label="Exit function test_5" style="filled" fillcolor=red]; - } - + 93 -> {94}; 94 -> {95}; 95 -> {96}; - 96 -> {97}; - 97 -> {98}; + 96 -> {98 97}; + 97 -> {104}; 98 -> {99}; - 99 -> {116 100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; + 99 -> {100}; + 100 -> {87}; + 100 -> {101} [style=dotted]; + 101 -> {102} [style=dotted]; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; 104 -> {105}; - 105 -> {107 106}; - 106 -> {113}; + 105 -> {106}; + 106 -> {88}; 107 -> {108}; - 108 -> {109}; - 109 -> {96}; - 109 -> {110} [style=dotted]; - 110 -> {111} [style=dotted]; - 111 -> {112} [style=dotted]; - 112 -> {113} [style=dotted]; - 113 -> {114}; - 114 -> {115}; - 115 -> {97}; - 116 -> {117}; - 117 -> {118}; - subgraph cluster_35 { + subgraph cluster_30 { color=red - 119 [label="Enter function run" style="filled" fillcolor=red]; - subgraph cluster_36 { - color=blue - 120 [label="Enter block"]; - 121 [label="Function call: R|/block|.R|FakeOverride|()"]; - 122 [label="Exit block"]; - } - 123 [label="Exit function run" style="filled" fillcolor=red]; + 109 [label="Enter function run" style="filled" fillcolor=red]; + 110 [label="Function call: R|/block|.R|FakeOverride|()"]; + 111 [label="Exit function run" style="filled" fillcolor=red]; } - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; + 109 -> {110}; + 110 -> {111}; - subgraph cluster_37 { + subgraph cluster_31 { color=red - 124 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_38 { + 112 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_32 { color=blue - 125 [label="Enter block"]; - subgraph cluster_39 { - color=blue - 126 [label="Enter function anonymousFunction"]; - subgraph cluster_40 { - color=blue - 127 [label="Enter block"]; - 128 [label="Jump: ^@run Unit"]; - 129 [label="Stub" style="filled" fillcolor=gray]; - 130 [label="Exit block" style="filled" fillcolor=gray]; - } - 131 [label="Exit function anonymousFunction"]; - } - 132 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 113 [label="Enter function anonymousFunction"]; + 114 [label="Jump: ^@run Unit"]; + 115 [label="Stub" style="filled" fillcolor=gray]; + 116 [label="Exit function anonymousFunction"]; + } + 117 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { ^@run Unit } )"]; - 133 [label="Exit block"]; - } - 134 [label="Exit function test_6" style="filled" fillcolor=red]; + 118 [label="Exit function test_6" style="filled" fillcolor=red]; } - 124 -> {125}; - 125 -> {126}; - 126 -> {131 127}; - 127 -> {128}; - 128 -> {131}; - 128 -> {129} [style=dotted]; - 129 -> {130} [style=dotted]; - 130 -> {131} [style=dotted]; - 131 -> {126 132}; - 132 -> {133}; - 133 -> {134}; + 112 -> {113}; + 113 -> {116 114}; + 114 -> {116}; + 114 -> {115} [style=dotted]; + 115 -> {116} [style=dotted]; + 116 -> {113 117}; + 117 -> {118}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot b/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot index 87fb0fe314b..98b9fd47c41 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot @@ -6,276 +6,206 @@ digraph lambdas_kt { subgraph cluster_0 { color=red 0 [label="Enter function run" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|FakeOverride|()"]; - 3 [label="Exit block"]; - } - 4 [label="Exit function run" style="filled" fillcolor=red]; + 1 [label="Function call: R|/block|.R|FakeOverride|()"]; + 2 [label="Exit function run" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - subgraph cluster_2 { + subgraph cluster_1 { color=red - 5 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_3 { + 3 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_2 { color=blue - 6 [label="Enter block"]; + 4 [label="Enter when"]; + subgraph cluster_3 { + color=blue + 5 [label="Enter when branch condition "]; + 6 [label="Access variable R|/x|"]; + 7 [label="Type operator: x is Int"]; + 8 [label="Exit when branch condition"]; + } + 9 [label="Synthetic else branch"]; + 10 [label="Enter when branch result"]; subgraph cluster_4 { color=blue - 7 [label="Enter when"]; + 11 [label="Enter block"]; subgraph cluster_5 { color=blue - 8 [label="Enter when branch condition "]; - 9 [label="Access variable R|/x|"]; - 10 [label="Type operator: x is Int"]; - 11 [label="Exit when branch condition"]; + 12 [label="Enter function anonymousFunction"]; + 13 [label="Access variable R|/x|"]; + 14 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 15 [label="Exit function anonymousFunction"]; } - 12 [label="Synthetic else branch"]; - 13 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 14 [label="Enter block"]; - subgraph cluster_7 { - color=blue - 15 [label="Enter function anonymousFunction"]; - subgraph cluster_8 { - color=blue - 16 [label="Enter block"]; - 17 [label="Access variable R|/x|"]; - 18 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 19 [label="Exit block"]; - } - 20 [label="Exit function anonymousFunction"]; - } - 21 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 16 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|kotlin/Int.inc|() } )"]; - 22 [label="Exit block"]; - } - 23 [label="Exit when branch result"]; - 24 [label="Exit when"]; + 17 [label="Exit block"]; } - 25 [label="Exit block"]; + 18 [label="Exit when branch result"]; + 19 [label="Exit when"]; } - 26 [label="Exit function test_1" style="filled" fillcolor=red]; + 20 [label="Exit function test_1" style="filled" fillcolor=red]; } + 3 -> {4}; + 4 -> {5}; 5 -> {6}; 6 -> {7}; 7 -> {8}; - 8 -> {9}; - 9 -> {10}; + 8 -> {10 9}; + 9 -> {19}; 10 -> {11}; - 11 -> {13 12}; - 12 -> {24}; + 11 -> {12}; + 12 -> {15 13}; 13 -> {14}; 14 -> {15}; - 15 -> {20 16}; + 15 -> {12 16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {15 21}; + + subgraph cluster_6 { + color=red + 21 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 22 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 23 [label="Enter when branch condition "]; + 24 [label="Access variable R|/x|"]; + 25 [label="Type operator: x is Int"]; + 26 [label="Exit when branch condition"]; + } + 27 [label="Synthetic else branch"]; + 28 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 29 [label="Enter block"]; + 30 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"]; + 31 [label="Exit block"]; + } + 32 [label="Exit when branch result"]; + 33 [label="Exit when"]; + } + 34 [label="Exit function test_2" style="filled" fillcolor=red]; + } + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {26}; - - subgraph cluster_9 { - color=red - 27 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { - color=blue - 28 [label="Enter block"]; - subgraph cluster_11 { - color=blue - 29 [label="Enter when"]; - subgraph cluster_12 { - color=blue - 30 [label="Enter when branch condition "]; - 31 [label="Access variable R|/x|"]; - 32 [label="Type operator: x is Int"]; - 33 [label="Exit when branch condition"]; - } - 34 [label="Synthetic else branch"]; - 35 [label="Enter when branch result"]; - subgraph cluster_13 { - color=blue - 36 [label="Enter block"]; - 37 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"]; - 38 [label="Exit block"]; - } - 39 [label="Exit when branch result"]; - 40 [label="Exit when"]; - } - 41 [label="Exit block"]; - } - 42 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 27 -> {28}; + 26 -> {28 27}; + 27 -> {33}; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; - 33 -> {35 34}; - 34 -> {40}; + 33 -> {34}; + + subgraph cluster_10 { + color=red + 35 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 36 [label="Access variable R|/x|"]; + 37 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 38 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + 35 -> {36}; 36 -> {37}; 37 -> {38}; - 38 -> {39}; + + subgraph cluster_11 { + color=red + 39 [label="Enter function getInt" style="filled" fillcolor=red]; + 40 [label="Function call: R|/block|.R|FakeOverride|()"]; + 41 [label="Const: Int(1)"]; + 42 [label="Jump: ^getInt Int(1)"]; + 43 [label="Stub" style="filled" fillcolor=gray]; + 44 [label="Exit function getInt" style="filled" fillcolor=red]; + } + 39 -> {40}; 40 -> {41}; 41 -> {42}; + 42 -> {44}; + 42 -> {43} [style=dotted]; + 43 -> {44} [style=dotted]; + + subgraph cluster_12 { + color=red + 45 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 46 [label="Enter function anonymousFunction"]; + 47 [label="Const: Int(1)"]; + 48 [label="Jump: ^test_3 Int(1)"]; + 49 [label="Stub" style="filled" fillcolor=gray]; + 50 [label="Exit function anonymousFunction"]; + } + 51 [label="Function call: R|/getInt|( = getInt@fun (): R|kotlin/Unit| { + ^test_3 Int(1) +} +)"]; + 52 [label="Jump: ^test_3 R|/getInt|( = getInt@fun (): R|kotlin/Unit| { + ^test_3 Int(1) +} +)"]; + 53 [label="Stub" style="filled" fillcolor=gray]; + 54 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 45 -> {46}; + 46 -> {50 47}; + 47 -> {48}; + 48 -> {54}; + 48 -> {49} [style=dotted]; + 49 -> {50} [style=dotted]; + 50 -> {46 51}; + 51 -> {52}; + 52 -> {54}; + 52 -> {53} [style=dotted]; + 53 -> {54} [style=dotted]; subgraph cluster_14 { color=red - 43 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 55 [label="Enter function test_4" style="filled" fillcolor=red]; subgraph cluster_15 { color=blue - 44 [label="Enter block"]; - 45 [label="Access variable R|/x|"]; - 46 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 47 [label="Exit block"]; + 56 [label="Enter function anonymousFunction"]; + 57 [label="Const: Int(1)"]; + 58 [label="Jump: ^test_4 Int(1)"]; + 59 [label="Stub" style="filled" fillcolor=gray]; + 60 [label="Exit function anonymousFunction"]; } - 48 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - - subgraph cluster_16 { - color=red - 49 [label="Enter function getInt" style="filled" fillcolor=red]; - subgraph cluster_17 { - color=blue - 50 [label="Enter block"]; - 51 [label="Function call: R|/block|.R|FakeOverride|()"]; - 52 [label="Const: Int(1)"]; - 53 [label="Jump: ^getInt Int(1)"]; - 54 [label="Stub" style="filled" fillcolor=gray]; - 55 [label="Exit block" style="filled" fillcolor=gray]; - } - 56 [label="Exit function getInt" style="filled" fillcolor=red]; - } - - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {56}; - 53 -> {54} [style=dotted]; - 54 -> {55} [style=dotted]; - 55 -> {56} [style=dotted]; - - subgraph cluster_18 { - color=red - 57 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_19 { - color=blue - 58 [label="Enter block"]; - subgraph cluster_20 { - color=blue - 59 [label="Enter function anonymousFunction"]; - subgraph cluster_21 { - color=blue - 60 [label="Enter block"]; - 61 [label="Const: Int(1)"]; - 62 [label="Jump: ^test_3 Int(1)"]; - 63 [label="Stub" style="filled" fillcolor=gray]; - 64 [label="Exit block" style="filled" fillcolor=gray]; - } - 65 [label="Exit function anonymousFunction"]; - } - 66 [label="Function call: R|/getInt|( = getInt@fun (): R|kotlin/Unit| { - ^test_3 Int(1) + 61 [label="Function call: R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { + ^test_4 Int(1) } )"]; - 67 [label="Jump: ^test_3 R|/getInt|( = getInt@fun (): R|kotlin/Unit| { - ^test_3 Int(1) + 62 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { + ^test_4 Int(1) } )"]; - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Exit block" style="filled" fillcolor=gray]; - } - 70 [label="Exit function test_3" style="filled" fillcolor=red]; + 63 [label="Stub" style="filled" fillcolor=gray]; + 64 [label="Exit function test_4" style="filled" fillcolor=red]; } + 55 -> {56}; + 56 -> {60 57}; 57 -> {58}; - 58 -> {59}; - 59 -> {65 60}; - 60 -> {61}; + 58 -> {64}; + 58 -> {59} [style=dotted]; + 59 -> {60} [style=dotted]; + 60 -> {56 61}; 61 -> {62}; - 62 -> {70}; + 62 -> {64}; 62 -> {63} [style=dotted]; 63 -> {64} [style=dotted]; - 64 -> {65} [style=dotted]; - 65 -> {59 66}; - 66 -> {67}; - 67 -> {70}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; - - subgraph cluster_22 { - color=red - 71 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_23 { - color=blue - 72 [label="Enter block"]; - subgraph cluster_24 { - color=blue - 73 [label="Enter function anonymousFunction"]; - subgraph cluster_25 { - color=blue - 74 [label="Enter block"]; - 75 [label="Const: Int(1)"]; - 76 [label="Jump: ^test_4 Int(1)"]; - 77 [label="Stub" style="filled" fillcolor=gray]; - 78 [label="Exit block" style="filled" fillcolor=gray]; - } - 79 [label="Exit function anonymousFunction"]; - } - 80 [label="Function call: R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { - ^test_4 Int(1) -} -)"]; - 81 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { - ^test_4 Int(1) -} -)"]; - 82 [label="Stub" style="filled" fillcolor=gray]; - 83 [label="Exit block" style="filled" fillcolor=gray]; - } - 84 [label="Exit function test_4" style="filled" fillcolor=red]; - } - - 71 -> {72}; - 72 -> {73}; - 73 -> {79 74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {84}; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {73 80}; - 80 -> {81}; - 81 -> {84}; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; - 83 -> {84} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/loops.dot b/compiler/fir/resolve/testData/resolve/cfg/loops.dot index 0721d14aefe..57776ffa7cf 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/loops.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/loops.dot @@ -8,93 +8,83 @@ digraph loops_kt { 0 [label="Enter function testWhile" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter while loop"]; subgraph cluster_2 { color=blue - 2 [label="Enter while loop"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter loop condition"]; - 4 [label="Access variable R|/b|"]; - 5 [label="Exit loop condition"]; - } + 2 [label="Enter loop condition"]; + 3 [label="Access variable R|/b|"]; + 4 [label="Exit loop condition"]; + } + subgraph cluster_3 { + color=blue + 5 [label="Enter loop block"]; subgraph cluster_4 { color=blue - 6 [label="Enter loop block"]; - subgraph cluster_5 { - color=blue - 7 [label="Enter block"]; - 8 [label="Access variable R|/x|"]; - 9 [label="Type operator: x is String"]; - 10 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; - 11 [label="Exit block"]; - } - 12 [label="Exit loop block"]; + 6 [label="Enter block"]; + 7 [label="Access variable R|/x|"]; + 8 [label="Type operator: x is String"]; + 9 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; + 10 [label="Exit block"]; } - 13 [label="Exit whileloop"]; + 11 [label="Exit loop block"]; } - 14 [label="Access variable R|/x|"]; - 15 [label="Type operator: x is String"]; - 16 [label="Exit block"]; + 12 [label="Exit whileloop"]; } - 17 [label="Exit function testWhile" style="filled" fillcolor=red]; + 13 [label="Access variable R|/x|"]; + 14 [label="Type operator: x is String"]; + 15 [label="Exit function testWhile" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; 2 -> {3}; 3 -> {4}; - 4 -> {5}; - 5 -> {13 6}; + 4 -> {12 5}; + 5 -> {6}; 6 -> {7}; 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; - 12 -> {3}; + 11 -> {2}; + 12 -> {13}; 13 -> {14}; 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - subgraph cluster_6 { + subgraph cluster_5 { color=red - 18 [label="Enter function testDoWhile" style="filled" fillcolor=red]; - subgraph cluster_7 { + 16 [label="Enter function testDoWhile" style="filled" fillcolor=red]; + subgraph cluster_6 { color=blue - 19 [label="Enter block"]; - subgraph cluster_8 { + 17 [label="Enter do-while loop"]; + subgraph cluster_7 { color=blue - 20 [label="Enter do-while loop"]; - subgraph cluster_9 { + 18 [label="Enter loop block"]; + subgraph cluster_8 { color=blue - 21 [label="Enter loop block"]; - subgraph cluster_10 { - color=blue - 22 [label="Enter block"]; - 23 [label="Access variable R|/x|"]; - 24 [label="Type operator: x is String"]; - 25 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; - 26 [label="Exit block"]; - } - 27 [label="Exit loop block"]; + 19 [label="Enter block"]; + 20 [label="Access variable R|/x|"]; + 21 [label="Type operator: x is String"]; + 22 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; + 23 [label="Exit block"]; } - subgraph cluster_11 { - color=blue - 28 [label="Enter loop condition"]; - 29 [label="Access variable R|/b|"]; - 30 [label="Exit loop condition"]; - } - 31 [label="Exit do-whileloop"]; + 24 [label="Exit loop block"]; } - 32 [label="Access variable R|/x|"]; - 33 [label="Type operator: x is String"]; - 34 [label="Exit block"]; + subgraph cluster_9 { + color=blue + 25 [label="Enter loop condition"]; + 26 [label="Access variable R|/b|"]; + 27 [label="Exit loop condition"]; + } + 28 [label="Exit do-whileloop"]; } - 35 [label="Exit function testDoWhile" style="filled" fillcolor=red]; + 29 [label="Access variable R|/x|"]; + 30 [label="Type operator: x is String"]; + 31 [label="Exit function testDoWhile" style="filled" fillcolor=red]; } + 16 -> {17}; + 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; @@ -104,63 +94,58 @@ digraph loops_kt { 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28}; + 27 -> {18 28}; 28 -> {29}; 29 -> {30}; - 30 -> {21 31}; - 31 -> {32}; + 30 -> {31}; + + subgraph cluster_10 { + color=red + 32 [label="Enter function testFor" style="filled" fillcolor=red]; + 33 [label="Const: Int(0)"]; + 34 [label="Const: Int(5)"]; + 35 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5))"]; + 36 [label="Variable declaration: lval : R|kotlin/ranges/IntRange|"]; + 37 [label="Access variable R|/|"]; + 38 [label="Function call: R|/|.R|kotlin/ranges/IntProgression.iterator|()"]; + 39 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; + subgraph cluster_11 { + color=blue + 40 [label="Enter while loop"]; + subgraph cluster_12 { + color=blue + 41 [label="Enter loop condition"]; + 42 [label="Access variable R|/|"]; + 43 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 44 [label="Exit loop condition"]; + } + subgraph cluster_13 { + color=blue + 45 [label="Enter loop block"]; + subgraph cluster_14 { + color=blue + 46 [label="Enter block"]; + 47 [label="Access variable R|/|"]; + 48 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; + 49 [label="Variable declaration: lval i: R|kotlin/Int|"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Type operator: x is String"]; + 52 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; + 53 [label="Exit block"]; + } + 54 [label="Exit loop block"]; + } + 55 [label="Exit whileloop"]; + } + 56 [label="Access variable R|/x|"]; + 57 [label="Type operator: x is String"]; + 58 [label="Exit function testFor" style="filled" fillcolor=red]; + } + 32 -> {33}; 33 -> {34}; 34 -> {35}; - - subgraph cluster_12 { - color=red - 36 [label="Enter function testFor" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 37 [label="Enter block"]; - 38 [label="Const: Int(0)"]; - 39 [label="Const: Int(5)"]; - 40 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(Int(5))"]; - 41 [label="Variable declaration: lval : R|kotlin/ranges/IntRange|"]; - 42 [label="Access variable R|/|"]; - 43 [label="Function call: R|/|.R|kotlin/ranges/IntProgression.iterator|()"]; - 44 [label="Variable declaration: lval : R|kotlin/collections/IntIterator|"]; - subgraph cluster_14 { - color=blue - 45 [label="Enter while loop"]; - subgraph cluster_15 { - color=blue - 46 [label="Enter loop condition"]; - 47 [label="Access variable R|/|"]; - 48 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 49 [label="Exit loop condition"]; - } - subgraph cluster_16 { - color=blue - 50 [label="Enter loop block"]; - subgraph cluster_17 { - color=blue - 51 [label="Enter block"]; - 52 [label="Access variable R|/|"]; - 53 [label="Function call: R|/|.R|kotlin/collections/IntIterator.next|()"]; - 54 [label="Variable declaration: lval i: R|kotlin/Int|"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Type operator: x is String"]; - 57 [label="Variable declaration: lval y: R|kotlin/Boolean|"]; - 58 [label="Exit block"]; - } - 59 [label="Exit loop block"]; - } - 60 [label="Exit whileloop"]; - } - 61 [label="Access variable R|/x|"]; - 62 [label="Type operator: x is String"]; - 63 [label="Exit block"]; - } - 64 [label="Exit function testFor" style="filled" fillcolor=red]; - } - + 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; @@ -169,252 +154,283 @@ digraph loops_kt { 41 -> {42}; 42 -> {43}; 43 -> {44}; - 44 -> {45}; + 44 -> {55 45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; - 49 -> {60 50}; + 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; + 54 -> {41}; 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {46}; + + subgraph cluster_15 { + color=red + 59 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 60 [label="Enter while loop"]; + subgraph cluster_17 { + color=blue + 61 [label="Enter loop condition"]; + 62 [label="Const: Boolean(true)"]; + 63 [label="Exit loop condition"]; + } + subgraph cluster_18 { + color=blue + 64 [label="Enter loop block"]; + subgraph cluster_19 { + color=blue + 65 [label="Enter block"]; + 66 [label="Const: Int(1)"]; + 67 [label="Exit block"]; + } + 68 [label="Exit loop block"]; + } + 69 [label="Stub" style="filled" fillcolor=gray]; + 70 [label="Exit whileloop" style="filled" fillcolor=gray]; + } + 71 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 72 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; - - subgraph cluster_18 { - color=red - 65 [label="Enter function testWhileTrue" style="filled" fillcolor=red]; - subgraph cluster_19 { - color=blue - 66 [label="Enter block"]; - subgraph cluster_20 { - color=blue - 67 [label="Enter while loop"]; - subgraph cluster_21 { - color=blue - 68 [label="Enter loop condition"]; - 69 [label="Const: Boolean(true)"]; - 70 [label="Exit loop condition"]; - } - subgraph cluster_22 { - color=blue - 71 [label="Enter loop block"]; - subgraph cluster_23 { - color=blue - 72 [label="Enter block"]; - 73 [label="Const: Int(1)"]; - 74 [label="Exit block"]; - } - 75 [label="Exit loop block"]; - } - 76 [label="Stub" style="filled" fillcolor=gray]; - 77 [label="Exit whileloop" style="filled" fillcolor=gray]; - } - 78 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 79 [label="Exit block" style="filled" fillcolor=gray]; - } - 80 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; - } - + 63 -> {69} [style=dotted]; + 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 70 -> {76} [style=dotted]; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {68}; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {80} [style=dotted]; + 68 -> {61}; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + 71 -> {72} [style=dotted]; - subgraph cluster_24 { + subgraph cluster_20 { color=red - 81 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; - subgraph cluster_25 { + 73 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_21 { color=blue - 82 [label="Enter block"]; - subgraph cluster_26 { + 74 [label="Enter while loop"]; + subgraph cluster_22 { color=blue - 83 [label="Enter while loop"]; - subgraph cluster_27 { - color=blue - 84 [label="Enter loop condition"]; - 85 [label="Const: Boolean(true)"]; - 86 [label="Exit loop condition"]; - } - subgraph cluster_28 { - color=blue - 87 [label="Enter loop block"]; - subgraph cluster_29 { - color=blue - 88 [label="Enter block"]; - subgraph cluster_30 { - color=blue - 89 [label="Enter when"]; - subgraph cluster_31 { - color=blue - 90 [label="Enter when branch condition "]; - 91 [label="Access variable R|/b|"]; - 92 [label="Exit when branch condition"]; - } - 93 [label="Synthetic else branch"]; - 94 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 95 [label="Enter block"]; - 96 [label="Jump: break@@@[Boolean(true)] "]; - 97 [label="Stub" style="filled" fillcolor=gray]; - 98 [label="Exit block" style="filled" fillcolor=gray]; - } - 99 [label="Exit when branch result" style="filled" fillcolor=gray]; - 100 [label="Exit when"]; - } - 101 [label="Exit block"]; - } - 102 [label="Exit loop block"]; - } - 103 [label="Stub" style="filled" fillcolor=gray]; - 104 [label="Exit whileloop"]; + 75 [label="Enter loop condition"]; + 76 [label="Const: Boolean(true)"]; + 77 [label="Exit loop condition"]; } - 105 [label="Const: Int(1)"]; - 106 [label="Exit block"]; + subgraph cluster_23 { + color=blue + 78 [label="Enter loop block"]; + subgraph cluster_24 { + color=blue + 79 [label="Enter block"]; + subgraph cluster_25 { + color=blue + 80 [label="Enter when"]; + subgraph cluster_26 { + color=blue + 81 [label="Enter when branch condition "]; + 82 [label="Access variable R|/b|"]; + 83 [label="Exit when branch condition"]; + } + 84 [label="Synthetic else branch"]; + 85 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 86 [label="Enter block"]; + 87 [label="Jump: break@@@[Boolean(true)] "]; + 88 [label="Stub" style="filled" fillcolor=gray]; + 89 [label="Exit block" style="filled" fillcolor=gray]; + } + 90 [label="Exit when branch result" style="filled" fillcolor=gray]; + 91 [label="Exit when"]; + } + 92 [label="Exit block"]; + } + 93 [label="Exit loop block"]; + } + 94 [label="Stub" style="filled" fillcolor=gray]; + 95 [label="Exit whileloop"]; } - 107 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; + 96 [label="Const: Int(1)"]; + 97 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; } + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 77 -> {94} [style=dotted]; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; 81 -> {82}; 82 -> {83}; - 83 -> {84}; - 84 -> {85}; + 83 -> {85 84}; + 84 -> {91}; 85 -> {86}; 86 -> {87}; - 86 -> {103} [style=dotted]; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; + 87 -> {95}; + 87 -> {88} [style=dotted]; + 88 -> {89} [style=dotted]; + 89 -> {90} [style=dotted]; + 90 -> {91} [style=dotted]; 91 -> {92}; - 92 -> {94 93}; - 93 -> {100}; - 94 -> {95}; + 92 -> {93}; + 93 -> {75}; + 94 -> {95} [style=dotted]; 95 -> {96}; - 96 -> {104}; - 96 -> {97} [style=dotted]; - 97 -> {98} [style=dotted]; - 98 -> {99} [style=dotted]; - 99 -> {100} [style=dotted]; + 96 -> {97}; + + subgraph cluster_28 { + color=red + 98 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 99 [label="Enter while loop"]; + subgraph cluster_30 { + color=blue + 100 [label="Enter loop condition"]; + 101 [label="Const: Boolean(false)"]; + 102 [label="Exit loop condition"]; + } + 103 [label="Stub" style="filled" fillcolor=gray]; + subgraph cluster_31 { + color=blue + 104 [label="Enter loop block" style="filled" fillcolor=gray]; + subgraph cluster_32 { + color=blue + 105 [label="Enter block" style="filled" fillcolor=gray]; + 106 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 107 [label="Exit block" style="filled" fillcolor=gray]; + } + 108 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 109 [label="Exit whileloop"]; + } + 110 [label="Const: Int(1)"]; + 111 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; + } + + 98 -> {99}; + 99 -> {100}; 100 -> {101}; 101 -> {102}; - 102 -> {84}; + 102 -> {109}; + 102 -> {103} [style=dotted]; 103 -> {104} [style=dotted]; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; + 104 -> {105} [style=dotted]; + 105 -> {106} [style=dotted]; + 106 -> {107} [style=dotted]; + 107 -> {108} [style=dotted]; + 108 -> {100} [style=dotted]; + 109 -> {110}; + 110 -> {111}; subgraph cluster_33 { color=red - 108 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; + 112 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; subgraph cluster_34 { color=blue - 109 [label="Enter block"]; + 113 [label="Enter do-while loop"]; subgraph cluster_35 { color=blue - 110 [label="Enter while loop"]; + 114 [label="Enter loop block"]; subgraph cluster_36 { color=blue - 111 [label="Enter loop condition"]; - 112 [label="Const: Boolean(false)"]; - 113 [label="Exit loop condition"]; + 115 [label="Enter block"]; + 116 [label="Const: Int(1)"]; + 117 [label="Exit block"]; } - 114 [label="Stub" style="filled" fillcolor=gray]; - subgraph cluster_37 { - color=blue - 115 [label="Enter loop block" style="filled" fillcolor=gray]; - subgraph cluster_38 { - color=blue - 116 [label="Enter block" style="filled" fillcolor=gray]; - 117 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 118 [label="Exit block" style="filled" fillcolor=gray]; - } - 119 [label="Exit loop block" style="filled" fillcolor=gray]; - } - 120 [label="Exit whileloop"]; + 118 [label="Exit loop block"]; } - 121 [label="Const: Int(1)"]; - 122 [label="Exit block"]; - } - 123 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; - } - - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {120}; - 113 -> {114} [style=dotted]; - 114 -> {115} [style=dotted]; - 115 -> {116} [style=dotted]; - 116 -> {117} [style=dotted]; - 117 -> {118} [style=dotted]; - 118 -> {119} [style=dotted]; - 119 -> {111} [style=dotted]; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - - subgraph cluster_39 { - color=red - 124 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; - subgraph cluster_40 { - color=blue - 125 [label="Enter block"]; - subgraph cluster_41 { + subgraph cluster_37 { color=blue - 126 [label="Enter do-while loop"]; - subgraph cluster_42 { - color=blue - 127 [label="Enter loop block"]; - subgraph cluster_43 { - color=blue - 128 [label="Enter block"]; - 129 [label="Const: Int(1)"]; - 130 [label="Exit block"]; - } - 131 [label="Exit loop block"]; - } - subgraph cluster_44 { - color=blue - 132 [label="Enter loop condition"]; - 133 [label="Const: Boolean(true)"]; - 134 [label="Exit loop condition"]; - } - 135 [label="Stub" style="filled" fillcolor=gray]; - 136 [label="Exit do-whileloop" style="filled" fillcolor=gray]; + 119 [label="Enter loop condition"]; + 120 [label="Const: Boolean(true)"]; + 121 [label="Exit loop condition"]; } - 137 [label="Const: Int(1)" style="filled" fillcolor=gray]; - 138 [label="Exit block" style="filled" fillcolor=gray]; + 122 [label="Stub" style="filled" fillcolor=gray]; + 123 [label="Exit do-whileloop" style="filled" fillcolor=gray]; } - 139 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + 124 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 125 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {114}; + 121 -> {122} [style=dotted]; + 122 -> {123} [style=dotted]; + 123 -> {124} [style=dotted]; + 124 -> {125} [style=dotted]; + + subgraph cluster_38 { + color=red + 126 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_39 { + color=blue + 127 [label="Enter do-while loop"]; + subgraph cluster_40 { + color=blue + 128 [label="Enter loop block"]; + subgraph cluster_41 { + color=blue + 129 [label="Enter block"]; + subgraph cluster_42 { + color=blue + 130 [label="Enter when"]; + subgraph cluster_43 { + color=blue + 131 [label="Enter when branch condition "]; + 132 [label="Access variable R|/b|"]; + 133 [label="Exit when branch condition"]; + } + 134 [label="Synthetic else branch"]; + 135 [label="Enter when branch result"]; + subgraph cluster_44 { + color=blue + 136 [label="Enter block"]; + 137 [label="Jump: break@@@[Boolean(true)] "]; + 138 [label="Stub" style="filled" fillcolor=gray]; + 139 [label="Exit block" style="filled" fillcolor=gray]; + } + 140 [label="Exit when branch result" style="filled" fillcolor=gray]; + 141 [label="Exit when"]; + } + 142 [label="Exit block"]; + } + 143 [label="Exit loop block"]; + } + subgraph cluster_45 { + color=blue + 144 [label="Enter loop condition"]; + 145 [label="Const: Boolean(true)"]; + 146 [label="Exit loop condition"]; + } + 147 [label="Stub" style="filled" fillcolor=gray]; + 148 [label="Exit do-whileloop"]; + } + 149 [label="Const: Int(1)"]; + 150 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; } - 124 -> {125}; - 125 -> {126}; 126 -> {127}; 127 -> {128}; 128 -> {129}; @@ -422,148 +438,69 @@ digraph loops_kt { 130 -> {131}; 131 -> {132}; 132 -> {133}; - 133 -> {134}; - 134 -> {127}; - 134 -> {135} [style=dotted]; - 135 -> {136} [style=dotted]; - 136 -> {137} [style=dotted]; + 133 -> {135 134}; + 134 -> {141}; + 135 -> {136}; + 136 -> {137}; + 137 -> {148}; 137 -> {138} [style=dotted]; 138 -> {139} [style=dotted]; - - subgraph cluster_45 { - color=red - 140 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; - subgraph cluster_46 { - color=blue - 141 [label="Enter block"]; - subgraph cluster_47 { - color=blue - 142 [label="Enter do-while loop"]; - subgraph cluster_48 { - color=blue - 143 [label="Enter loop block"]; - subgraph cluster_49 { - color=blue - 144 [label="Enter block"]; - subgraph cluster_50 { - color=blue - 145 [label="Enter when"]; - subgraph cluster_51 { - color=blue - 146 [label="Enter when branch condition "]; - 147 [label="Access variable R|/b|"]; - 148 [label="Exit when branch condition"]; - } - 149 [label="Synthetic else branch"]; - 150 [label="Enter when branch result"]; - subgraph cluster_52 { - color=blue - 151 [label="Enter block"]; - 152 [label="Jump: break@@@[Boolean(true)] "]; - 153 [label="Stub" style="filled" fillcolor=gray]; - 154 [label="Exit block" style="filled" fillcolor=gray]; - } - 155 [label="Exit when branch result" style="filled" fillcolor=gray]; - 156 [label="Exit when"]; - } - 157 [label="Exit block"]; - } - 158 [label="Exit loop block"]; - } - subgraph cluster_53 { - color=blue - 159 [label="Enter loop condition"]; - 160 [label="Const: Boolean(true)"]; - 161 [label="Exit loop condition"]; - } - 162 [label="Stub" style="filled" fillcolor=gray]; - 163 [label="Exit do-whileloop"]; - } - 164 [label="Const: Int(1)"]; - 165 [label="Exit block"]; - } - 166 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; - } - - 140 -> {141}; + 139 -> {140} [style=dotted]; + 140 -> {141} [style=dotted]; 141 -> {142}; 142 -> {143}; 143 -> {144}; 144 -> {145}; 145 -> {146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {150 149}; - 149 -> {156}; - 150 -> {151}; + 146 -> {128}; + 146 -> {147} [style=dotted]; + 147 -> {148} [style=dotted]; + 148 -> {149}; + 149 -> {150}; + + subgraph cluster_46 { + color=red + 151 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_47 { + color=blue + 152 [label="Enter do-while loop"]; + subgraph cluster_48 { + color=blue + 153 [label="Enter loop block"]; + subgraph cluster_49 { + color=blue + 154 [label="Enter block"]; + 155 [label="Const: Int(1)"]; + 156 [label="Exit block"]; + } + 157 [label="Exit loop block"]; + } + subgraph cluster_50 { + color=blue + 158 [label="Enter loop condition"]; + 159 [label="Const: Boolean(false)"]; + 160 [label="Exit loop condition"]; + } + 161 [label="Exit do-whileloop"]; + } + 162 [label="Const: Int(1)"]; + 163 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; + } + 164 [label="Stub" style="filled" fillcolor=gray]; + 151 -> {152}; - 152 -> {163}; - 152 -> {153} [style=dotted]; - 153 -> {154} [style=dotted]; - 154 -> {155} [style=dotted]; - 155 -> {156} [style=dotted]; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + 155 -> {156}; 156 -> {157}; 157 -> {158}; 158 -> {159}; 159 -> {160}; 160 -> {161}; - 161 -> {143}; - 161 -> {162} [style=dotted]; - 162 -> {163} [style=dotted]; - 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - - subgraph cluster_54 { - color=red - 167 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; - subgraph cluster_55 { - color=blue - 168 [label="Enter block"]; - subgraph cluster_56 { - color=blue - 169 [label="Enter do-while loop"]; - subgraph cluster_57 { - color=blue - 170 [label="Enter loop block"]; - subgraph cluster_58 { - color=blue - 171 [label="Enter block"]; - 172 [label="Const: Int(1)"]; - 173 [label="Exit block"]; - } - 174 [label="Exit loop block"]; - } - subgraph cluster_59 { - color=blue - 175 [label="Enter loop condition"]; - 176 [label="Const: Boolean(false)"]; - 177 [label="Exit loop condition"]; - } - 178 [label="Exit do-whileloop"]; - } - 179 [label="Const: Int(1)"]; - 180 [label="Exit block"]; - } - 181 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; - } - 182 [label="Stub" style="filled" fillcolor=gray]; - - 167 -> {168}; - 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {173}; - 173 -> {174}; - 174 -> {175}; - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; - 177 -> {182} [style=dotted]; - 178 -> {179}; - 179 -> {180}; - 180 -> {181}; - 182 -> {170} [style=dotted]; + 160 -> {164} [style=dotted]; + 161 -> {162}; + 162 -> {163}; + 164 -> {153} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot b/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot index b07e1a860d8..bc4ace1851d 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot @@ -6,167 +6,127 @@ digraph propertiesAndInitBlocks_kt { subgraph cluster_0 { color=red 0 [label="Enter function run" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Function call: R|/block|.R|FakeOverride|()"]; - 3 [label="Exit block"]; - } - 4 [label="Exit function run" style="filled" fillcolor=red]; + 1 [label="Function call: R|/block|.R|FakeOverride|()"]; + 2 [label="Exit function run" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; - 2 -> {3}; + + subgraph cluster_1 { + color=red + 3 [label="Enter function getter" style="filled" fillcolor=red]; + 4 [label="Exit function getter" style="filled" fillcolor=red]; + } + 3 -> {4}; subgraph cluster_2 { color=red - 5 [label="Enter function getter" style="filled" fillcolor=red]; - 6 [label="Exit function getter" style="filled" fillcolor=red]; + 5 [label="Enter property" style="filled" fillcolor=red]; + 6 [label="Const: Int(1)"]; + 7 [label="Exit property" style="filled" fillcolor=red]; } 5 -> {6}; + 6 -> {7}; subgraph cluster_3 { color=red - 7 [label="Enter property" style="filled" fillcolor=red]; - 8 [label="Const: Int(1)"]; - 9 [label="Exit property" style="filled" fillcolor=red]; + 8 [label="Enter function getter" style="filled" fillcolor=red]; + 9 [label="Const: Int(1)"]; + 10 [label="Jump: ^ Int(1)"]; + 11 [label="Stub" style="filled" fillcolor=gray]; + 12 [label="Exit function getter" style="filled" fillcolor=red]; } - 7 -> {8}; 8 -> {9}; + 9 -> {10}; + 10 -> {12}; + 10 -> {11} [style=dotted]; + 11 -> {12} [style=dotted]; subgraph cluster_4 { color=red - 10 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_5 { - color=blue - 11 [label="Enter block"]; - 12 [label="Const: Int(1)"]; - 13 [label="Jump: ^ Int(1)"]; - 14 [label="Stub" style="filled" fillcolor=gray]; - 15 [label="Exit block" style="filled" fillcolor=gray]; - } - 16 [label="Exit function getter" style="filled" fillcolor=red]; + 13 [label="Enter function setter" style="filled" fillcolor=red]; + 14 [label="Const: Int(1)"]; + 15 [label="Assignmenet: F|/x2|"]; + 16 [label="Exit function setter" style="filled" fillcolor=red]; } - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {16}; - 13 -> {14} [style=dotted]; - 14 -> {15} [style=dotted]; - 15 -> {16} [style=dotted]; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; - subgraph cluster_6 { + subgraph cluster_5 { color=red - 17 [label="Enter function setter" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 18 [label="Enter block"]; - 19 [label="Const: Int(1)"]; - 20 [label="Assignmenet: F|/x2|"]; - 21 [label="Exit block"]; - } - 22 [label="Exit function setter" style="filled" fillcolor=red]; + 17 [label="Enter property" style="filled" fillcolor=red]; + 18 [label="Const: Int(1)"]; + 19 [label="Exit property" style="filled" fillcolor=red]; } 17 -> {18}; 18 -> {19}; - 19 -> {20}; + + subgraph cluster_6 { + color=red + 20 [label="Enter function foo" style="filled" fillcolor=red]; + 21 [label="Const: Int(1)"]; + 22 [label="Const: Int(1)"]; + 23 [label="Function call: Int(1).R|kotlin/Int.plus|(Int(1))"]; + 24 [label="Variable declaration: lval c: R|kotlin/Int|"]; + 25 [label="Function call: R|java/lang/Exception.Exception|()"]; + 26 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 27 [label="Stub" style="filled" fillcolor=gray]; + 28 [label="Exit function foo" style="filled" fillcolor=red]; + } + 20 -> {21}; 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {28}; + 26 -> {27} [style=dotted]; + 27 -> {28} [style=dotted]; + + subgraph cluster_7 { + color=red + 29 [label="Enter function " style="filled" fillcolor=red]; + 30 [label="Exit function " style="filled" fillcolor=red]; + } + + 29 -> {30}; subgraph cluster_8 { color=red - 23 [label="Enter property" style="filled" fillcolor=red]; - 24 [label="Const: Int(1)"]; - 25 [label="Exit property" style="filled" fillcolor=red]; + 31 [label="Enter function getter" style="filled" fillcolor=red]; + 32 [label="Exit function getter" style="filled" fillcolor=red]; } - 23 -> {24}; - 24 -> {25}; + 31 -> {32}; subgraph cluster_9 { color=red - 26 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_10 { + 33 [label="Enter function " style="filled" fillcolor=red]; + 34 [label="Exit function " style="filled" fillcolor=red]; + } + + 33 -> {34}; + + subgraph cluster_10 { + color=red + 35 [label="Enter property" style="filled" fillcolor=red]; + subgraph cluster_11 { color=blue - 27 [label="Enter block"]; - 28 [label="Const: Int(1)"]; - 29 [label="Const: Int(1)"]; - 30 [label="Function call: Int(1).R|kotlin/Int.plus|(Int(1))"]; - 31 [label="Variable declaration: lval c: R|kotlin/Int|"]; - 32 [label="Function call: R|java/lang/Exception.Exception|()"]; - 33 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 34 [label="Stub" style="filled" fillcolor=gray]; - 35 [label="Exit block" style="filled" fillcolor=gray]; + 36 [label="Enter function anonymousFunction"]; + 37 [label="Function call: R|java/lang/Exception.Exception|()"]; + 38 [label="Throw: throw R|java/lang/Exception.Exception|()"]; + 39 [label="Stub" style="filled" fillcolor=gray]; + 40 [label="Exit function anonymousFunction"]; } - 36 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {36}; - 33 -> {34} [style=dotted]; - 34 -> {35} [style=dotted]; - 35 -> {36} [style=dotted]; - - subgraph cluster_11 { - color=red - 37 [label="Enter function " style="filled" fillcolor=red]; - 38 [label="Exit function " style="filled" fillcolor=red]; - } - - 37 -> {38}; - - subgraph cluster_12 { - color=red - 39 [label="Enter function getter" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 40 [label="Enter block"]; - 41 [label="Exit block"]; - } - 42 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - - subgraph cluster_14 { - color=red - 43 [label="Enter function " style="filled" fillcolor=red]; - 44 [label="Exit function " style="filled" fillcolor=red]; - } - - 43 -> {44}; - - subgraph cluster_15 { - color=red - 45 [label="Enter property" style="filled" fillcolor=red]; - subgraph cluster_16 { - color=blue - 46 [label="Enter function anonymousFunction"]; - subgraph cluster_17 { - color=blue - 47 [label="Enter block"]; - 48 [label="Function call: R|java/lang/Exception.Exception|()"]; - 49 [label="Throw: throw R|java/lang/Exception.Exception|()"]; - 50 [label="Stub" style="filled" fillcolor=gray]; - 51 [label="Exit block" style="filled" fillcolor=gray]; - } - 52 [label="Exit function anonymousFunction"]; - } - 53 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 41 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { local final fun foo(): R|kotlin/Unit| { lval c: R|kotlin/Int| = Int(1).R|kotlin/Int.plus|(Int(1)) throw R|java/lang/Exception.Exception|() @@ -187,89 +147,87 @@ digraph propertiesAndInitBlocks_kt { throw R|java/lang/Exception.Exception|() } )"]; - 54 [label="Exit property" style="filled" fillcolor=red]; + 42 [label="Exit property" style="filled" fillcolor=red]; + } + + 35 -> {36}; + 36 -> {40 37}; + 37 -> {38}; + 38 -> {42}; + 38 -> {39} [style=dotted]; + 39 -> {40} [style=dotted]; + 40 -> {36 41}; + 41 -> {42}; + + subgraph cluster_12 { + color=red + 43 [label="Enter function getter" style="filled" fillcolor=red]; + 44 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 43 -> {44}; + + subgraph cluster_13 { + color=red + 45 [label="Enter property" style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 46 [label="Try expression enter"]; + subgraph cluster_15 { + color=blue + 47 [label="Try main block enter"]; + subgraph cluster_16 { + color=blue + 48 [label="Enter block"]; + 49 [label="Const: Int(1)"]; + 50 [label="Exit block"]; + } + 51 [label="Try main block exit"]; + } + subgraph cluster_17 { + color=blue + 52 [label="Enter finally"]; + subgraph cluster_18 { + color=blue + 53 [label="Enter block"]; + 54 [label="Const: Int(0)"]; + 55 [label="Exit block"]; + } + 56 [label="Exit finally"]; + } + subgraph cluster_19 { + color=blue + 57 [label="Catch enter"]; + subgraph cluster_20 { + color=blue + 58 [label="Enter block"]; + 59 [label="Const: Int(2)"]; + 60 [label="Exit block"]; + } + 61 [label="Catch exit"]; + } + 62 [label="Try expression exit"]; + } + 63 [label="Exit property" style="filled" fillcolor=red]; } 45 -> {46}; - 46 -> {52 47}; - 47 -> {48}; + 46 -> {47}; + 47 -> {63 57 52 48}; 48 -> {49}; - 49 -> {54}; - 49 -> {50} [style=dotted]; - 50 -> {51} [style=dotted]; - 51 -> {52} [style=dotted]; - 52 -> {46 53}; + 49 -> {50}; + 50 -> {51}; + 51 -> {62}; + 52 -> {53}; 53 -> {54}; - - subgraph cluster_18 { - color=red - 55 [label="Enter function getter" style="filled" fillcolor=red]; - 56 [label="Exit function getter" style="filled" fillcolor=red]; - } - + 54 -> {55}; 55 -> {56}; - - subgraph cluster_19 { - color=red - 57 [label="Enter property" style="filled" fillcolor=red]; - subgraph cluster_20 { - color=blue - 58 [label="Try expression enter"]; - subgraph cluster_21 { - color=blue - 59 [label="Try main block enter"]; - subgraph cluster_22 { - color=blue - 60 [label="Enter block"]; - 61 [label="Const: Int(1)"]; - 62 [label="Exit block"]; - } - 63 [label="Try main block exit"]; - } - subgraph cluster_23 { - color=blue - 64 [label="Enter finally"]; - subgraph cluster_24 { - color=blue - 65 [label="Enter block"]; - 66 [label="Const: Int(0)"]; - 67 [label="Exit block"]; - } - 68 [label="Exit finally"]; - } - subgraph cluster_25 { - color=blue - 69 [label="Catch enter"]; - subgraph cluster_26 { - color=blue - 70 [label="Enter block"]; - 71 [label="Const: Int(2)"]; - 72 [label="Exit block"]; - } - 73 [label="Catch exit"]; - } - 74 [label="Try expression exit"]; - } - 75 [label="Exit property" style="filled" fillcolor=red]; - } - - 57 -> {58}; + 56 -> {62}; + 57 -> {63 58}; 58 -> {59}; - 59 -> {75 69 64 60}; + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; - 63 -> {74}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {74}; - 69 -> {75 70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot new file mode 100644 index 00000000000..488da1e02d7 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot @@ -0,0 +1,144 @@ +digraph returnValuesFromLambda_kt { + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " style="filled" fillcolor=red]; + } + + 0 -> {1}; + + subgraph cluster_1 { + color=red + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } + + 2 -> {3}; + + subgraph cluster_2 { + color=red + 4 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 5 [label="Enter function anonymousFunction"]; + subgraph cluster_4 { + color=blue + 6 [label="Enter when"]; + subgraph cluster_5 { + color=blue + 7 [label="Enter when branch condition "]; + 8 [label="Access variable R|/b|"]; + 9 [label="Exit when branch condition"]; + } + 10 [label="Synthetic else branch"]; + 11 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 12 [label="Enter block"]; + 13 [label="Function call: R|/B.B|()"]; + 14 [label="Jump: ^@run R|/B.B|()"]; + 15 [label="Stub" style="filled" fillcolor=gray]; + 16 [label="Exit block" style="filled" fillcolor=gray]; + } + 17 [label="Exit when branch result" style="filled" fillcolor=gray]; + 18 [label="Exit when"]; + } + 19 [label="Function call: R|/C.C|()"]; + 20 [label="Exit function anonymousFunction"]; + } + 21 [label="Function call: R|kotlin/run|( = run@fun (): R|C| { + when () { + R|/b| -> { + ^@run R|/B.B|() + } + } + + R|/C.C|() +} +)"]; + 22 [label="Variable declaration: lval x: R|A|"]; + 23 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {11 10}; + 10 -> {18}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {20}; + 14 -> {15} [style=dotted]; + 15 -> {16} [style=dotted]; + 16 -> {17} [style=dotted]; + 17 -> {18} [style=dotted]; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + + subgraph cluster_7 { + color=red + 24 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_8 { + color=blue + 25 [label="Enter function anonymousFunction"]; + 26 [label="Function call: R|/C.C|()"]; + 27 [label="Jump: ^@run R|/C.C|()"]; + 28 [label="Stub" style="filled" fillcolor=gray]; + 29 [label="Exit function anonymousFunction"]; + } + 30 [label="Function call: R|kotlin/run|( = run@fun (): R|C| { + ^@run R|/C.C|() +} +)"]; + 31 [label="Variable declaration: lval x: R|C|"]; + 32 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {29}; + 27 -> {28} [style=dotted]; + 28 -> {29} [style=dotted]; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + + subgraph cluster_9 { + color=red + 33 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 34 [label="Enter function anonymousFunction"]; + 35 [label="Jump: ^ Unit"]; + 36 [label="Stub" style="filled" fillcolor=gray]; + 37 [label="Exit function anonymousFunction"]; + } + 38 [label="Function call: R|kotlin/run|( = run@fun (): R|kotlin/Unit| { + ^ Unit +} +)"]; + 39 [label="Variable declaration: lval x: R|kotlin/Unit|"]; + 40 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 33 -> {34}; + 34 -> {35}; + 35 -> {37}; + 35 -> {36} [style=dotted]; + 36 -> {37} [style=dotted]; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + +} diff --git a/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.kt b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.kt new file mode 100644 index 00000000000..ec80640b8da --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.kt @@ -0,0 +1,21 @@ +interface A + +class B : A +class C : A + +fun test_1(b: Boolean) { + val x = run { + if (b) return@run B() + C() + } +} + +fun test_2() { + val x = run { + return@run C() + } +} + +fun test_3() { + val x = run { return } +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.txt b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.txt new file mode 100644 index 00000000000..683db32877b --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.txt @@ -0,0 +1,39 @@ +FILE: returnValuesFromLambda.kt + public abstract interface A : R|kotlin/Any| { + } + public final class B : R|A| { + public constructor(): R|B| { + super() + } + + } + public final class C : R|A| { + public constructor(): R|C| { + super() + } + + } + public final fun test_1(b: R|kotlin/Boolean|): R|kotlin/Unit| { + lval x: R|A| = R|kotlin/run|( = run@fun (): R|C| { + when () { + R|/b| -> { + ^@run R|/B.B|() + } + } + + R|/C.C|() + } + ) + } + public final fun test_2(): R|kotlin/Unit| { + lval x: R|C| = R|kotlin/run|( = run@fun (): R|C| { + ^@run R|/C.C|() + } + ) + } + public final fun test_3(): R|kotlin/Unit| { + lval x: R|kotlin/Unit| = R|kotlin/run|( = run@fun (): R|kotlin/Unit| { + ^ Unit + } + ) + } diff --git a/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot b/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot index c16a73e091e..1691270772e 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot @@ -54,59 +54,45 @@ digraph safeCalls_kt { subgraph cluster_6 { color=red 12 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 13 [label="Enter block"]; - 14 [label="Access variable R|/x|"]; - 15 [label="Enter safe call"]; - 16 [label="Function call: R|/x|?.R|/A.foo|()"]; - 17 [label="Exit safe call"]; - 18 [label="Enter safe call"]; - 19 [label="Function call: R|/x|?.R|/A.foo|()?.R|/A.bar|()"]; - 20 [label="Exit safe call"]; - 21 [label="Exit block"]; - } - 22 [label="Exit function test_1" style="filled" fillcolor=red]; + 13 [label="Access variable R|/x|"]; + 14 [label="Enter safe call"]; + 15 [label="Function call: R|/x|?.R|/A.foo|()"]; + 16 [label="Exit safe call"]; + 17 [label="Enter safe call"]; + 18 [label="Function call: R|/x|?.R|/A.foo|()?.R|/A.bar|()"]; + 19 [label="Exit safe call"]; + 20 [label="Exit function test_1" style="filled" fillcolor=red]; } 12 -> {13}; - 13 -> {14}; - 14 -> {15 17}; + 13 -> {14 16}; + 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {18 20}; + 16 -> {17 19}; + 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - subgraph cluster_8 { + subgraph cluster_7 { color=red - 23 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 24 [label="Enter block"]; - 25 [label="Access variable R|/x|"]; - 26 [label="Enter safe call"]; - 27 [label="Access variable R|/B.foo|"]; - 28 [label="Exit safe call"]; - 29 [label="Enter safe call"]; - 30 [label="Access variable R|/B.bar|"]; - 31 [label="Exit safe call"]; - 32 [label="Exit block"]; - } - 33 [label="Exit function test_2" style="filled" fillcolor=red]; + 21 [label="Enter function test_2" style="filled" fillcolor=red]; + 22 [label="Access variable R|/x|"]; + 23 [label="Enter safe call"]; + 24 [label="Access variable R|/B.foo|"]; + 25 [label="Exit safe call"]; + 26 [label="Enter safe call"]; + 27 [label="Access variable R|/B.bar|"]; + 28 [label="Exit safe call"]; + 29 [label="Exit function test_2" style="filled" fillcolor=red]; } + 21 -> {22}; + 22 -> {23 25}; 23 -> {24}; 24 -> {25}; 25 -> {26 28}; 26 -> {27}; 27 -> {28}; - 28 -> {29 31}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; + 28 -> {29}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/simple.dot b/compiler/fir/resolve/testData/resolve/cfg/simple.dot index fd10b1fbbff..f7fb7b5b0ae 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/simple.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/simple.dot @@ -6,45 +6,31 @@ digraph simple_kt { subgraph cluster_0 { color=red 0 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Exit block"]; - } - 3 [label="Exit function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - subgraph cluster_2 { + subgraph cluster_1 { color=red - 4 [label="Enter function test" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 5 [label="Enter block"]; - 6 [label="Const: Int(1)"]; - 7 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 8 [label="Access variable R|/x|"]; - 9 [label="Const: Int(1)"]; - 10 [label="Function call: R|/x|.R|kotlin/Int.plus|(Int(1))"]; - 11 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 12 [label="Function call: R|/foo|()"]; - 13 [label="Exit block"]; - } - 14 [label="Exit function test" style="filled" fillcolor=red]; + 2 [label="Enter function test" style="filled" fillcolor=red]; + 3 [label="Const: Int(1)"]; + 4 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 5 [label="Access variable R|/x|"]; + 6 [label="Const: Int(1)"]; + 7 [label="Function call: R|/x|.R|kotlin/Int.plus|(Int(1))"]; + 8 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 9 [label="Function call: R|/foo|()"]; + 10 [label="Exit function test" style="filled" fillcolor=red]; } + 2 -> {3}; + 3 -> {4}; 4 -> {5}; 5 -> {6}; 6 -> {7}; 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot b/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot index f2d3df72244..435ca36b5bc 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot @@ -8,320 +8,299 @@ digraph tryCatch_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Try expression enter"]; subgraph cluster_2 { color=blue - 2 [label="Try expression enter"]; + 2 [label="Try main block enter"]; subgraph cluster_3 { color=blue - 3 [label="Try main block enter"]; - subgraph cluster_4 { - color=blue - 4 [label="Enter block"]; - 5 [label="Const: Int(1)"]; - 6 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 7 [label="Exit block"]; - } - 8 [label="Try main block exit"]; + 3 [label="Enter block"]; + 4 [label="Const: Int(1)"]; + 5 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 6 [label="Exit block"]; } + 7 [label="Try main block exit"]; + } + subgraph cluster_4 { + color=blue + 8 [label="Catch enter"]; subgraph cluster_5 { color=blue - 9 [label="Catch enter"]; - subgraph cluster_6 { - color=blue - 10 [label="Enter block"]; - 11 [label="Const: Int(3)"]; - 12 [label="Variable declaration: lval z: R|kotlin/Int|"]; - 13 [label="Exit block"]; - } - 14 [label="Catch exit"]; + 9 [label="Enter block"]; + 10 [label="Const: Int(3)"]; + 11 [label="Variable declaration: lval z: R|kotlin/Int|"]; + 12 [label="Exit block"]; } + 13 [label="Catch exit"]; + } + subgraph cluster_6 { + color=blue + 14 [label="Catch enter"]; subgraph cluster_7 { color=blue - 15 [label="Catch enter"]; - subgraph cluster_8 { - color=blue - 16 [label="Enter block"]; - 17 [label="Const: Int(2)"]; - 18 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 19 [label="Exit block"]; - } - 20 [label="Catch exit"]; + 15 [label="Enter block"]; + 16 [label="Const: Int(2)"]; + 17 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 18 [label="Exit block"]; } - 21 [label="Try expression exit"]; + 19 [label="Catch exit"]; } - 22 [label="Exit block"]; + 20 [label="Try expression exit"]; } - 23 [label="Exit function test_1" style="filled" fillcolor=red]; + 21 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; - 2 -> {3}; - 3 -> {23 15 9 4}; + 2 -> {21 14 8 3}; + 3 -> {4}; 4 -> {5}; 5 -> {6}; 6 -> {7}; - 7 -> {8}; - 8 -> {21}; - 9 -> {23 10}; + 7 -> {20}; + 8 -> {21 9}; + 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {14}; - 14 -> {21}; - 15 -> {23 16}; + 13 -> {20}; + 14 -> {21 15}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - subgraph cluster_9 { + subgraph cluster_8 { color=red - 24 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { + 22 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 25 [label="Enter block"]; - subgraph cluster_11 { + 23 [label="Try expression enter"]; + subgraph cluster_10 { color=blue - 26 [label="Try expression enter"]; - subgraph cluster_12 { + 24 [label="Try main block enter"]; + subgraph cluster_11 { color=blue - 27 [label="Try main block enter"]; - subgraph cluster_13 { - color=blue - 28 [label="Enter block"]; - 29 [label="Const: Int(1)"]; - 30 [label="Exit block"]; - } - 31 [label="Try main block exit"]; + 25 [label="Enter block"]; + 26 [label="Const: Int(1)"]; + 27 [label="Exit block"]; } - subgraph cluster_14 { - color=blue - 32 [label="Catch enter"]; - subgraph cluster_15 { - color=blue - 33 [label="Enter block"]; - 34 [label="Const: Int(2)"]; - 35 [label="Exit block"]; - } - 36 [label="Catch exit"]; - } - 37 [label="Try expression exit"]; + 28 [label="Try main block exit"]; } - 38 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 39 [label="Exit block"]; + subgraph cluster_12 { + color=blue + 29 [label="Catch enter"]; + subgraph cluster_13 { + color=blue + 30 [label="Enter block"]; + 31 [label="Const: Int(2)"]; + 32 [label="Exit block"]; + } + 33 [label="Catch exit"]; + } + 34 [label="Try expression exit"]; } - 40 [label="Exit function test_2" style="filled" fillcolor=red]; + 35 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 36 [label="Exit function test_2" style="filled" fillcolor=red]; } - 24 -> {25}; + 22 -> {23}; + 23 -> {24}; + 24 -> {36 29 25}; 25 -> {26}; 26 -> {27}; - 27 -> {40 32 28}; - 28 -> {29}; - 29 -> {30}; + 27 -> {28}; + 28 -> {34}; + 29 -> {36 30}; 30 -> {31}; - 31 -> {37}; - 32 -> {40 33}; + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {36}; - 36 -> {37}; + + subgraph cluster_14 { + color=red + 37 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_15 { + color=blue + 38 [label="Enter while loop"]; + subgraph cluster_16 { + color=blue + 39 [label="Enter loop condition"]; + 40 [label="Const: Boolean(true)"]; + 41 [label="Exit loop condition"]; + } + subgraph cluster_17 { + color=blue + 42 [label="Enter loop block"]; + subgraph cluster_18 { + color=blue + 43 [label="Enter block"]; + subgraph cluster_19 { + color=blue + 44 [label="Try expression enter"]; + subgraph cluster_20 { + color=blue + 45 [label="Try main block enter"]; + subgraph cluster_21 { + color=blue + 46 [label="Enter block"]; + subgraph cluster_22 { + color=blue + 47 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 48 [label="Enter when branch condition "]; + 49 [label="Access variable R|/b|"]; + 50 [label="Exit when branch condition"]; + } + 51 [label="Synthetic else branch"]; + 52 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 53 [label="Enter block"]; + 54 [label="Jump: ^test_3 Unit"]; + 55 [label="Stub" style="filled" fillcolor=gray]; + 56 [label="Exit block" style="filled" fillcolor=gray]; + } + 57 [label="Exit when branch result" style="filled" fillcolor=gray]; + 58 [label="Exit when"]; + } + 59 [label="Const: Int(1)"]; + 60 [label="Variable declaration: lval x: R|kotlin/Int|"]; + subgraph cluster_25 { + color=blue + 61 [label="Enter when"]; + subgraph cluster_26 { + color=blue + 62 [label="Enter when branch condition "]; + 63 [label="Access variable R|/b|"]; + 64 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 65 [label="Exit when branch condition"]; + } + 66 [label="Synthetic else branch"]; + 67 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 68 [label="Enter block"]; + 69 [label="Jump: break@@@[Boolean(true)] "]; + 70 [label="Stub" style="filled" fillcolor=gray]; + 71 [label="Exit block" style="filled" fillcolor=gray]; + } + 72 [label="Exit when branch result" style="filled" fillcolor=gray]; + 73 [label="Exit when"]; + } + 74 [label="Exit block"]; + } + 75 [label="Try main block exit"]; + } + subgraph cluster_28 { + color=blue + 76 [label="Catch enter"]; + subgraph cluster_29 { + color=blue + 77 [label="Enter block"]; + 78 [label="Jump: break@@@[Boolean(true)] "]; + 79 [label="Stub" style="filled" fillcolor=gray]; + 80 [label="Exit block" style="filled" fillcolor=gray]; + } + 81 [label="Catch exit" style="filled" fillcolor=gray]; + } + subgraph cluster_30 { + color=blue + 82 [label="Catch enter"]; + subgraph cluster_31 { + color=blue + 83 [label="Enter block"]; + 84 [label="Jump: continue@@@[Boolean(true)] "]; + 85 [label="Stub" style="filled" fillcolor=gray]; + 86 [label="Exit block" style="filled" fillcolor=gray]; + } + 87 [label="Catch exit" style="filled" fillcolor=gray]; + } + 88 [label="Try expression exit"]; + } + 89 [label="Const: Int(2)"]; + 90 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 91 [label="Exit block"]; + } + 92 [label="Exit loop block"]; + } + 93 [label="Stub" style="filled" fillcolor=gray]; + 94 [label="Exit whileloop"]; + } + 95 [label="Const: Int(3)"]; + 96 [label="Variable declaration: lval z: R|kotlin/Int|"]; + 97 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 37 -> {38}; 38 -> {39}; 39 -> {40}; - - subgraph cluster_16 { - color=red - 41 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_17 { - color=blue - 42 [label="Enter block"]; - subgraph cluster_18 { - color=blue - 43 [label="Enter while loop"]; - subgraph cluster_19 { - color=blue - 44 [label="Enter loop condition"]; - 45 [label="Const: Boolean(true)"]; - 46 [label="Exit loop condition"]; - } - subgraph cluster_20 { - color=blue - 47 [label="Enter loop block"]; - subgraph cluster_21 { - color=blue - 48 [label="Enter block"]; - subgraph cluster_22 { - color=blue - 49 [label="Try expression enter"]; - subgraph cluster_23 { - color=blue - 50 [label="Try main block enter"]; - subgraph cluster_24 { - color=blue - 51 [label="Enter block"]; - subgraph cluster_25 { - color=blue - 52 [label="Enter when"]; - subgraph cluster_26 { - color=blue - 53 [label="Enter when branch condition "]; - 54 [label="Access variable R|/b|"]; - 55 [label="Exit when branch condition"]; - } - 56 [label="Synthetic else branch"]; - 57 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 58 [label="Enter block"]; - 59 [label="Jump: ^test_3 Unit"]; - 60 [label="Stub" style="filled" fillcolor=gray]; - 61 [label="Exit block" style="filled" fillcolor=gray]; - } - 62 [label="Exit when branch result" style="filled" fillcolor=gray]; - 63 [label="Exit when"]; - } - 64 [label="Const: Int(1)"]; - 65 [label="Variable declaration: lval x: R|kotlin/Int|"]; - subgraph cluster_28 { - color=blue - 66 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 67 [label="Enter when branch condition "]; - 68 [label="Access variable R|/b|"]; - 69 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 70 [label="Exit when branch condition"]; - } - 71 [label="Synthetic else branch"]; - 72 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 73 [label="Enter block"]; - 74 [label="Jump: break@@@[Boolean(true)] "]; - 75 [label="Stub" style="filled" fillcolor=gray]; - 76 [label="Exit block" style="filled" fillcolor=gray]; - } - 77 [label="Exit when branch result" style="filled" fillcolor=gray]; - 78 [label="Exit when"]; - } - 79 [label="Exit block"]; - } - 80 [label="Try main block exit"]; - } - subgraph cluster_31 { - color=blue - 81 [label="Catch enter"]; - subgraph cluster_32 { - color=blue - 82 [label="Enter block"]; - 83 [label="Jump: break@@@[Boolean(true)] "]; - 84 [label="Stub" style="filled" fillcolor=gray]; - 85 [label="Exit block" style="filled" fillcolor=gray]; - } - 86 [label="Catch exit" style="filled" fillcolor=gray]; - } - subgraph cluster_33 { - color=blue - 87 [label="Catch enter"]; - subgraph cluster_34 { - color=blue - 88 [label="Enter block"]; - 89 [label="Jump: continue@@@[Boolean(true)] "]; - 90 [label="Stub" style="filled" fillcolor=gray]; - 91 [label="Exit block" style="filled" fillcolor=gray]; - } - 92 [label="Catch exit" style="filled" fillcolor=gray]; - } - 93 [label="Try expression exit"]; - } - 94 [label="Const: Int(2)"]; - 95 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 96 [label="Exit block"]; - } - 97 [label="Exit loop block"]; - } - 98 [label="Stub" style="filled" fillcolor=gray]; - 99 [label="Exit whileloop"]; - } - 100 [label="Const: Int(3)"]; - 101 [label="Variable declaration: lval z: R|kotlin/Int|"]; - 102 [label="Exit block"]; - } - 103 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 40 -> {41}; 41 -> {42}; + 41 -> {93} [style=dotted]; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; + 45 -> {97 82 76 46}; 46 -> {47}; - 46 -> {98} [style=dotted]; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {103 87 81 51}; - 51 -> {52}; + 50 -> {52 51}; + 51 -> {58}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; - 55 -> {57 56}; - 56 -> {63}; - 57 -> {58}; + 54 -> {97}; + 54 -> {55} [style=dotted]; + 55 -> {56} [style=dotted]; + 56 -> {57} [style=dotted]; + 57 -> {58} [style=dotted]; 58 -> {59}; - 59 -> {103}; - 59 -> {60} [style=dotted]; - 60 -> {61} [style=dotted]; - 61 -> {62} [style=dotted]; - 62 -> {63} [style=dotted]; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; 63 -> {64}; 64 -> {65}; - 65 -> {66}; - 66 -> {67}; + 65 -> {67 66}; + 66 -> {73}; 67 -> {68}; 68 -> {69}; - 69 -> {70}; - 70 -> {72 71}; - 71 -> {78}; - 72 -> {73}; + 69 -> {94}; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + 71 -> {72} [style=dotted]; + 72 -> {73} [style=dotted]; 73 -> {74}; - 74 -> {99}; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79}; - 79 -> {80}; - 80 -> {93}; - 81 -> {103 82}; - 82 -> {83}; - 83 -> {99}; - 83 -> {84} [style=dotted]; + 74 -> {75}; + 75 -> {88}; + 76 -> {97 77}; + 77 -> {78}; + 78 -> {94}; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {88} [style=dotted]; + 82 -> {97 83}; + 83 -> {84}; + 84 -> {38}; 84 -> {85} [style=dotted]; 85 -> {86} [style=dotted]; - 86 -> {93} [style=dotted]; - 87 -> {103 88}; + 86 -> {87} [style=dotted]; + 87 -> {88} [style=dotted]; 88 -> {89}; - 89 -> {43}; - 89 -> {90} [style=dotted]; - 90 -> {91} [style=dotted]; - 91 -> {92} [style=dotted]; - 92 -> {93} [style=dotted]; - 93 -> {94}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {39}; + 93 -> {94} [style=dotted]; 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {44}; - 98 -> {99} [style=dotted]; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/when.dot b/compiler/fir/resolve/testData/resolve/cfg/when.dot index 45bf18ab9e3..f789778ad5d 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/when.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/when.dot @@ -8,82 +8,77 @@ digraph when_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Access variable R|/x|"]; - 5 [label="Const: Int(1)"]; - 6 [label="Operator =="]; - 7 [label="Exit when branch condition"]; - } - subgraph cluster_4 { - color=blue - 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|(Int(2))"]; - 12 [label="Const: Int(0)"]; - 13 [label="Operator =="]; - 14 [label="Exit when branch condition"]; - } - subgraph cluster_5 { - color=blue - 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|(Int(1))"]; - 19 [label="Const: Int(0)"]; - 20 [label="Operator =="]; - 21 [label="Exit when branch condition"]; - } - subgraph cluster_6 { - color=blue - 22 [label="Enter when branch condition else"]; - 23 [label="Exit when branch condition"]; - } - 24 [label="Enter when branch result"]; - subgraph cluster_7 { - color=blue - 25 [label="Enter block"]; - 26 [label="Const: Int(5)"]; - 27 [label="Exit block"]; - } - 28 [label="Exit when branch result"]; - 29 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 30 [label="Enter block"]; - 31 [label="Jump: ^test_1 Unit"]; - 32 [label="Stub" style="filled" fillcolor=gray]; - 33 [label="Exit block" style="filled" fillcolor=gray]; - } - 34 [label="Exit when branch result" style="filled" fillcolor=gray]; - 35 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 36 [label="Enter block"]; - 37 [label="Const: Int(20)"]; - 38 [label="Exit block"]; - } - 39 [label="Exit when branch result"]; - 40 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 41 [label="Enter block"]; - 42 [label="Const: Int(10)"]; - 43 [label="Exit block"]; - } - 44 [label="Exit when branch result"]; - 45 [label="Exit when"]; + 2 [label="Enter when branch condition "]; + 3 [label="Access variable R|/x|"]; + 4 [label="Const: Int(1)"]; + 5 [label="Operator =="]; + 6 [label="Exit when branch condition"]; } - 46 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 47 [label="Exit block"]; + subgraph cluster_3 { + color=blue + 7 [label="Enter when branch condition "]; + 8 [label="Access variable R|/x|"]; + 9 [label="Const: Int(2)"]; + 10 [label="Function call: R|/x|.R|kotlin/Int.rem|(Int(2))"]; + 11 [label="Const: Int(0)"]; + 12 [label="Operator =="]; + 13 [label="Exit when branch condition"]; + } + subgraph cluster_4 { + color=blue + 14 [label="Enter when branch condition "]; + 15 [label="Const: Int(1)"]; + 16 [label="Const: Int(1)"]; + 17 [label="Function call: Int(1).R|kotlin/Int.minus|(Int(1))"]; + 18 [label="Const: Int(0)"]; + 19 [label="Operator =="]; + 20 [label="Exit when branch condition"]; + } + subgraph cluster_5 { + color=blue + 21 [label="Enter when branch condition else"]; + 22 [label="Exit when branch condition"]; + } + 23 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 24 [label="Enter block"]; + 25 [label="Const: Int(5)"]; + 26 [label="Exit block"]; + } + 27 [label="Exit when branch result"]; + 28 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 29 [label="Enter block"]; + 30 [label="Jump: ^test_1 Unit"]; + 31 [label="Stub" style="filled" fillcolor=gray]; + 32 [label="Exit block" style="filled" fillcolor=gray]; + } + 33 [label="Exit when branch result" style="filled" fillcolor=gray]; + 34 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 35 [label="Enter block"]; + 36 [label="Const: Int(20)"]; + 37 [label="Exit block"]; + } + 38 [label="Exit when branch result"]; + 39 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 40 [label="Enter block"]; + 41 [label="Const: Int(10)"]; + 42 [label="Exit block"]; + } + 43 [label="Exit when branch result"]; + 44 [label="Exit when"]; } - 48 [label="Exit function test_1" style="filled" fillcolor=red]; + 45 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 46 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -92,113 +87,104 @@ digraph when_kt { 3 -> {4}; 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {40 8}; + 6 -> {39 7}; + 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {14}; - 14 -> {35 15}; + 13 -> {34 14}; + 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {29 22}; + 20 -> {28 21}; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28}; - 28 -> {45}; + 27 -> {44}; + 28 -> {29}; 29 -> {30}; - 30 -> {31}; - 31 -> {48}; + 30 -> {46}; + 30 -> {31} [style=dotted]; 31 -> {32} [style=dotted]; 32 -> {33} [style=dotted]; - 33 -> {34} [style=dotted]; - 34 -> {45} [style=dotted]; + 33 -> {44} [style=dotted]; + 34 -> {35}; 35 -> {36}; 36 -> {37}; 37 -> {38}; - 38 -> {39}; - 39 -> {45}; + 38 -> {44}; + 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - subgraph cluster_11 { + subgraph cluster_10 { color=red - 49 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_12 { + 47 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_11 { color=blue - 50 [label="Enter block"]; - subgraph cluster_13 { + 48 [label="Enter when"]; + subgraph cluster_12 { color=blue - 51 [label="Enter when"]; - subgraph cluster_14 { + 49 [label="Enter when branch condition "]; + subgraph cluster_13 { color=blue - 52 [label="Enter when branch condition "]; - subgraph cluster_15 { - color=blue - 53 [label="Enter &&"]; - 54 [label="Access variable R|/x|"]; - 55 [label="Type operator: x is A"]; - 56 [label="Exit left part of &&"]; - 57 [label="Enter right part of &&"]; - 58 [label="Access variable R|/x|"]; - 59 [label="Type operator: x is B"]; - 60 [label="Exit &&"]; - } - 61 [label="Exit when branch condition"]; + 50 [label="Enter &&"]; + 51 [label="Access variable R|/x|"]; + 52 [label="Type operator: x is A"]; + 53 [label="Exit left part of &&"]; + 54 [label="Enter right part of &&"]; + 55 [label="Access variable R|/x|"]; + 56 [label="Type operator: x is B"]; + 57 [label="Exit &&"]; } - 62 [label="Synthetic else branch"]; - 63 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 64 [label="Enter block"]; - 65 [label="Access variable R|/x|"]; - 66 [label="Type operator: x is A"]; - 67 [label="Exit block"]; - } - 68 [label="Exit when branch result"]; - 69 [label="Exit when"]; + 58 [label="Exit when branch condition"]; } - 70 [label="Exit block"]; + 59 [label="Synthetic else branch"]; + 60 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 61 [label="Enter block"]; + 62 [label="Access variable R|/x|"]; + 63 [label="Type operator: x is A"]; + 64 [label="Exit block"]; + } + 65 [label="Exit when branch result"]; + 66 [label="Exit when"]; } - 71 [label="Exit function test_2" style="filled" fillcolor=red]; + 67 [label="Exit function test_2" style="filled" fillcolor=red]; } + 47 -> {48}; + 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; - 53 -> {54}; + 53 -> {57 54}; 54 -> {55}; 55 -> {56}; - 56 -> {60 57}; + 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {60}; + 58 -> {60 59}; + 59 -> {66}; 60 -> {61}; - 61 -> {63 62}; - 62 -> {69}; + 61 -> {62}; + 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot b/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot index d99465f4979..196c40b167d 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot @@ -16,45 +16,42 @@ digraph bangbang_kt { 2 [label="Enter function test_0" style="filled" fillcolor=red]; subgraph cluster_2 { color=blue - 3 [label="Enter block"]; + 3 [label="Enter when"]; + 4 [label="Access variable R|/a|"]; + 5 [label="Variable declaration: lval : R|A?|"]; subgraph cluster_3 { color=blue - 4 [label="Enter when"]; - 5 [label="Access variable R|/a|"]; - 6 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_4 { - color=blue - 7 [label="Enter when branch condition "]; - 8 [label="Const: Null(null)"]; - 9 [label="Operator =="]; - 10 [label="Exit when branch condition"]; - } - subgraph cluster_5 { - color=blue - 11 [label="Enter when branch condition else"]; - 12 [label="Exit when branch condition"]; - } - 13 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 14 [label="Enter block"]; - 15 [label="Access variable R|/|"]; - 16 [label="Exit block"]; - } - 17 [label="Exit when branch result"]; - 18 [label="Enter when branch result"]; - subgraph cluster_7 { - color=blue - 19 [label="Enter block"]; - 20 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 21 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 22 [label="Stub" style="filled" fillcolor=gray]; - 23 [label="Exit block" style="filled" fillcolor=gray]; - } - 24 [label="Exit when branch result" style="filled" fillcolor=gray]; - 25 [label="Exit when"]; + 6 [label="Enter when branch condition "]; + 7 [label="Const: Null(null)"]; + 8 [label="Operator =="]; + 9 [label="Exit when branch condition"]; } - 26 [label="Function call: when (lval : R|A?| = R|/a|) { + subgraph cluster_4 { + color=blue + 10 [label="Enter when branch condition else"]; + 11 [label="Exit when branch condition"]; + } + 12 [label="Enter when branch result"]; + subgraph cluster_5 { + color=blue + 13 [label="Enter block"]; + 14 [label="Access variable R|/|"]; + 15 [label="Exit block"]; + } + 16 [label="Exit when branch result"]; + 17 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 18 [label="Enter block"]; + 19 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 20 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 21 [label="Stub" style="filled" fillcolor=gray]; + 22 [label="Exit block" style="filled" fillcolor=gray]; + } + 23 [label="Exit when branch result" style="filled" fillcolor=gray]; + 24 [label="Exit when"]; + } + 25 [label="Function call: when (lval : R|A?| = R|/a|) { ==($subj$, Null(null)) -> { throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() } @@ -63,11 +60,9 @@ digraph bangbang_kt { } } .R|/A.foo|()"]; - 27 [label="Access variable R|/a|"]; - 28 [label="Function call: R|/a|.R|/A.foo|()"]; - 29 [label="Exit block"]; - } - 30 [label="Exit function test_0" style="filled" fillcolor=red]; + 26 [label="Access variable R|/a|"]; + 27 [label="Function call: R|/a|.R|/A.foo|()"]; + 28 [label="Exit function test_0" style="filled" fillcolor=red]; } 2 -> {3}; @@ -77,79 +72,74 @@ digraph bangbang_kt { 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; - 10 -> {18 11}; + 9 -> {17 10}; + 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {25}; + 16 -> {24}; + 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {30}; + 20 -> {28}; + 20 -> {21} [style=dotted]; 21 -> {22} [style=dotted]; 22 -> {23} [style=dotted]; 23 -> {24} [style=dotted]; - 24 -> {25} [style=dotted]; + 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - subgraph cluster_8 { + subgraph cluster_7 { color=red - 31 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_9 { + 29 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_8 { color=blue - 32 [label="Enter block"]; - subgraph cluster_10 { + 30 [label="Enter when"]; + subgraph cluster_9 { color=blue - 33 [label="Enter when"]; - subgraph cluster_11 { + 31 [label="Enter when branch condition "]; + subgraph cluster_10 { color=blue - 34 [label="Enter when branch condition "]; + 32 [label="Enter when"]; + 33 [label="Access variable R|/a|"]; + 34 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_11 { + color=blue + 35 [label="Enter when branch condition "]; + 36 [label="Const: Null(null)"]; + 37 [label="Operator =="]; + 38 [label="Exit when branch condition"]; + } subgraph cluster_12 { color=blue - 35 [label="Enter when"]; - 36 [label="Access variable R|/a|"]; - 37 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_13 { - color=blue - 38 [label="Enter when branch condition "]; - 39 [label="Const: Null(null)"]; - 40 [label="Operator =="]; - 41 [label="Exit when branch condition"]; - } - subgraph cluster_14 { - color=blue - 42 [label="Enter when branch condition else"]; - 43 [label="Exit when branch condition"]; - } - 44 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 45 [label="Enter block"]; - 46 [label="Access variable R|/|"]; - 47 [label="Exit block"]; - } - 48 [label="Exit when branch result"]; - 49 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 50 [label="Enter block"]; - 51 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 52 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 53 [label="Stub" style="filled" fillcolor=gray]; - 54 [label="Exit block" style="filled" fillcolor=gray]; - } - 55 [label="Exit when branch result" style="filled" fillcolor=gray]; - 56 [label="Exit when"]; + 39 [label="Enter when branch condition else"]; + 40 [label="Exit when branch condition"]; } - 57 [label="Function call: when (lval : R|A?| = R|/a|) { + 41 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 42 [label="Enter block"]; + 43 [label="Access variable R|/|"]; + 44 [label="Exit block"]; + } + 45 [label="Exit when branch result"]; + 46 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 47 [label="Enter block"]; + 48 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 49 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 50 [label="Stub" style="filled" fillcolor=gray]; + 51 [label="Exit block" style="filled" fillcolor=gray]; + } + 52 [label="Exit when branch result" style="filled" fillcolor=gray]; + 53 [label="Exit when"]; + } + 54 [label="Function call: when (lval : R|A?| = R|/a|) { ==($subj$, Null(null)) -> { throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() } @@ -158,27 +148,27 @@ digraph bangbang_kt { } } .R|/A.foo|()"]; - 58 [label="Exit when branch condition"]; - } - 59 [label="Synthetic else branch"]; - 60 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 61 [label="Enter block"]; - 62 [label="Access variable R|/a|"]; - 63 [label="Function call: R|/a|.R|/A.foo|()"]; - 64 [label="Exit block"]; - } - 65 [label="Exit when branch result"]; - 66 [label="Exit when"]; + 55 [label="Exit when branch condition"]; } - 67 [label="Access variable R|/a|"]; - 68 [label="Function call: R|/a|.R|/A.foo|()"]; - 69 [label="Exit block"]; + 56 [label="Synthetic else branch"]; + 57 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 58 [label="Enter block"]; + 59 [label="Access variable R|/a|"]; + 60 [label="Function call: R|/a|.R|/A.foo|()"]; + 61 [label="Exit block"]; + } + 62 [label="Exit when branch result"]; + 63 [label="Exit when"]; } - 70 [label="Exit function test_1" style="filled" fillcolor=red]; + 64 [label="Access variable R|/a|"]; + 65 [label="Function call: R|/a|.R|/A.foo|()"]; + 66 [label="Exit function test_1" style="filled" fillcolor=red]; } + 29 -> {30}; + 30 -> {31}; 31 -> {32}; 32 -> {33}; 33 -> {34}; @@ -186,93 +176,86 @@ digraph bangbang_kt { 35 -> {36}; 36 -> {37}; 37 -> {38}; - 38 -> {39}; + 38 -> {46 39}; 39 -> {40}; 40 -> {41}; - 41 -> {49 42}; + 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; + 45 -> {53}; 46 -> {47}; 47 -> {48}; - 48 -> {56}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {70}; + 48 -> {49}; + 49 -> {66}; + 49 -> {50} [style=dotted]; + 50 -> {51} [style=dotted]; + 51 -> {52} [style=dotted]; 52 -> {53} [style=dotted]; - 53 -> {54} [style=dotted]; - 54 -> {55} [style=dotted]; - 55 -> {56} [style=dotted]; - 56 -> {57}; + 53 -> {54}; + 54 -> {55}; + 55 -> {57 56}; + 56 -> {63}; 57 -> {58}; - 58 -> {60 59}; - 59 -> {66}; + 58 -> {59}; + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - subgraph cluster_18 { + subgraph cluster_16 { color=red - 71 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_19 { + 67 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_17 { color=blue - 72 [label="Enter block"]; - subgraph cluster_20 { + 68 [label="Enter when"]; + subgraph cluster_18 { color=blue - 73 [label="Enter when"]; - subgraph cluster_21 { + 69 [label="Enter when branch condition "]; + subgraph cluster_19 { color=blue - 74 [label="Enter when branch condition "]; - subgraph cluster_22 { + 70 [label="Enter &&"]; + subgraph cluster_20 { color=blue - 75 [label="Enter &&"]; + 71 [label="Enter when"]; + 72 [label="Access variable R|/a|"]; + 73 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_21 { + color=blue + 74 [label="Enter when branch condition "]; + 75 [label="Const: Null(null)"]; + 76 [label="Operator =="]; + 77 [label="Exit when branch condition"]; + } + subgraph cluster_22 { + color=blue + 78 [label="Enter when branch condition else"]; + 79 [label="Exit when branch condition"]; + } + 80 [label="Enter when branch result"]; subgraph cluster_23 { color=blue - 76 [label="Enter when"]; - 77 [label="Access variable R|/a|"]; - 78 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_24 { - color=blue - 79 [label="Enter when branch condition "]; - 80 [label="Const: Null(null)"]; - 81 [label="Operator =="]; - 82 [label="Exit when branch condition"]; - } - subgraph cluster_25 { - color=blue - 83 [label="Enter when branch condition else"]; - 84 [label="Exit when branch condition"]; - } - 85 [label="Enter when branch result"]; - subgraph cluster_26 { - color=blue - 86 [label="Enter block"]; - 87 [label="Access variable R|/|"]; - 88 [label="Exit block"]; - } - 89 [label="Exit when branch result"]; - 90 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 91 [label="Enter block"]; - 92 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 93 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 94 [label="Stub" style="filled" fillcolor=gray]; - 95 [label="Exit block" style="filled" fillcolor=gray]; - } - 96 [label="Exit when branch result" style="filled" fillcolor=gray]; - 97 [label="Exit when"]; + 81 [label="Enter block"]; + 82 [label="Access variable R|/|"]; + 83 [label="Exit block"]; } - 98 [label="Function call: when (lval : R|A?| = R|/a|) { + 84 [label="Exit when branch result"]; + 85 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 86 [label="Enter block"]; + 87 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 88 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 89 [label="Stub" style="filled" fillcolor=gray]; + 90 [label="Exit block" style="filled" fillcolor=gray]; + } + 91 [label="Exit when branch result" style="filled" fillcolor=gray]; + 92 [label="Exit when"]; + } + 93 [label="Function call: when (lval : R|A?| = R|/a|) { ==($subj$, Null(null)) -> { throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() } @@ -281,134 +264,127 @@ digraph bangbang_kt { } } .R|/A.foo|()"]; - 99 [label="Exit left part of &&"]; - 100 [label="Enter right part of &&"]; - 101 [label="Access variable R|/b|"]; - 102 [label="Exit &&"]; - } - 103 [label="Exit when branch condition"]; + 94 [label="Exit left part of &&"]; + 95 [label="Enter right part of &&"]; + 96 [label="Access variable R|/b|"]; + 97 [label="Exit &&"]; } - 104 [label="Synthetic else branch"]; - 105 [label="Enter when branch result"]; - subgraph cluster_28 { - color=blue - 106 [label="Enter block"]; - 107 [label="Access variable R|/a|"]; - 108 [label="Function call: R|/a|.R|/A.foo|()"]; - 109 [label="Exit block"]; - } - 110 [label="Exit when branch result"]; - 111 [label="Exit when"]; + 98 [label="Exit when branch condition"]; } - 112 [label="Access variable R|/a|"]; - 113 [label="Function call: R|/a|.R|/A.foo|()"]; - 114 [label="Exit block"]; + 99 [label="Synthetic else branch"]; + 100 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 101 [label="Enter block"]; + 102 [label="Access variable R|/a|"]; + 103 [label="Function call: R|/a|.R|/A.foo|()"]; + 104 [label="Exit block"]; + } + 105 [label="Exit when branch result"]; + 106 [label="Exit when"]; } - 115 [label="Exit function test_2" style="filled" fillcolor=red]; + 107 [label="Access variable R|/a|"]; + 108 [label="Function call: R|/a|.R|/A.foo|()"]; + 109 [label="Exit function test_2" style="filled" fillcolor=red]; } + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; - 77 -> {78}; + 77 -> {85 78}; 78 -> {79}; 79 -> {80}; 80 -> {81}; 81 -> {82}; - 82 -> {90 83}; + 82 -> {83}; 83 -> {84}; - 84 -> {85}; + 84 -> {92}; 85 -> {86}; 86 -> {87}; 87 -> {88}; - 88 -> {89}; - 89 -> {97}; - 90 -> {91}; - 91 -> {92}; + 88 -> {109}; + 88 -> {89} [style=dotted]; + 89 -> {90} [style=dotted]; + 90 -> {91} [style=dotted]; + 91 -> {92} [style=dotted]; 92 -> {93}; - 93 -> {115}; - 93 -> {94} [style=dotted]; - 94 -> {95} [style=dotted]; - 95 -> {96} [style=dotted]; - 96 -> {97} [style=dotted]; + 93 -> {94}; + 94 -> {97 95}; + 95 -> {96}; + 96 -> {97}; 97 -> {98}; - 98 -> {99}; - 99 -> {102 100}; + 98 -> {100 99}; + 99 -> {106}; 100 -> {101}; 101 -> {102}; 102 -> {103}; - 103 -> {105 104}; - 104 -> {111}; + 103 -> {104}; + 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - subgraph cluster_29 { + subgraph cluster_26 { color=red - 116 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_30 { + 110 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_27 { color=blue - 117 [label="Enter block"]; - subgraph cluster_31 { + 111 [label="Enter when"]; + subgraph cluster_28 { color=blue - 118 [label="Enter when"]; - subgraph cluster_32 { + 112 [label="Enter when branch condition "]; + subgraph cluster_29 { color=blue - 119 [label="Enter when branch condition "]; - subgraph cluster_33 { + 113 [label="Enter &&"]; + 114 [label="Access variable R|/b|"]; + 115 [label="Exit left part of &&"]; + 116 [label="Enter right part of &&"]; + subgraph cluster_30 { color=blue - 120 [label="Enter &&"]; - 121 [label="Access variable R|/b|"]; - 122 [label="Exit left part of &&"]; - 123 [label="Enter right part of &&"]; + 117 [label="Enter when"]; + 118 [label="Access variable R|/a|"]; + 119 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_31 { + color=blue + 120 [label="Enter when branch condition "]; + 121 [label="Const: Null(null)"]; + 122 [label="Operator =="]; + 123 [label="Exit when branch condition"]; + } + subgraph cluster_32 { + color=blue + 124 [label="Enter when branch condition else"]; + 125 [label="Exit when branch condition"]; + } + 126 [label="Enter when branch result"]; + subgraph cluster_33 { + color=blue + 127 [label="Enter block"]; + 128 [label="Access variable R|/|"]; + 129 [label="Exit block"]; + } + 130 [label="Exit when branch result"]; + 131 [label="Enter when branch result"]; subgraph cluster_34 { color=blue - 124 [label="Enter when"]; - 125 [label="Access variable R|/a|"]; - 126 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_35 { - color=blue - 127 [label="Enter when branch condition "]; - 128 [label="Const: Null(null)"]; - 129 [label="Operator =="]; - 130 [label="Exit when branch condition"]; - } - subgraph cluster_36 { - color=blue - 131 [label="Enter when branch condition else"]; - 132 [label="Exit when branch condition"]; - } - 133 [label="Enter when branch result"]; - subgraph cluster_37 { - color=blue - 134 [label="Enter block"]; - 135 [label="Access variable R|/|"]; - 136 [label="Exit block"]; - } - 137 [label="Exit when branch result"]; - 138 [label="Enter when branch result"]; - subgraph cluster_38 { - color=blue - 139 [label="Enter block"]; - 140 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 141 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 142 [label="Stub" style="filled" fillcolor=gray]; - 143 [label="Exit block" style="filled" fillcolor=gray]; - } - 144 [label="Exit when branch result" style="filled" fillcolor=gray]; - 145 [label="Exit when"]; + 132 [label="Enter block"]; + 133 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 134 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 135 [label="Stub" style="filled" fillcolor=gray]; + 136 [label="Exit block" style="filled" fillcolor=gray]; } - 146 [label="Function call: when (lval : R|A?| = R|/a|) { + 137 [label="Exit when branch result" style="filled" fillcolor=gray]; + 138 [label="Exit when"]; + } + 139 [label="Function call: when (lval : R|A?| = R|/a|) { ==($subj$, Null(null)) -> { throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() } @@ -417,67 +393,153 @@ digraph bangbang_kt { } } .R|/A.foo|()"]; - 147 [label="Exit &&"]; - } - 148 [label="Exit when branch condition"]; + 140 [label="Exit &&"]; } - 149 [label="Synthetic else branch"]; - 150 [label="Enter when branch result"]; - subgraph cluster_39 { - color=blue - 151 [label="Enter block"]; - 152 [label="Access variable R|/a|"]; - 153 [label="Function call: R|/a|.R|/A.foo|()"]; - 154 [label="Exit block"]; - } - 155 [label="Exit when branch result"]; - 156 [label="Exit when"]; + 141 [label="Exit when branch condition"]; } - 157 [label="Access variable R|/a|"]; - 158 [label="Function call: R|/a|.#()"]; - 159 [label="Exit block"]; + 142 [label="Synthetic else branch"]; + 143 [label="Enter when branch result"]; + subgraph cluster_35 { + color=blue + 144 [label="Enter block"]; + 145 [label="Access variable R|/a|"]; + 146 [label="Function call: R|/a|.R|/A.foo|()"]; + 147 [label="Exit block"]; + } + 148 [label="Exit when branch result"]; + 149 [label="Exit when"]; } - 160 [label="Exit function test_3" style="filled" fillcolor=red]; + 150 [label="Access variable R|/a|"]; + 151 [label="Function call: R|/a|.#()"]; + 152 [label="Exit function test_3" style="filled" fillcolor=red]; } + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {140 116}; 116 -> {117}; 117 -> {118}; 118 -> {119}; 119 -> {120}; 120 -> {121}; 121 -> {122}; - 122 -> {147 123}; - 123 -> {124}; + 122 -> {123}; + 123 -> {131 124}; 124 -> {125}; 125 -> {126}; 126 -> {127}; 127 -> {128}; 128 -> {129}; 129 -> {130}; - 130 -> {138 131}; + 130 -> {138}; 131 -> {132}; 132 -> {133}; 133 -> {134}; - 134 -> {135}; - 135 -> {136}; - 136 -> {137}; - 137 -> {145}; + 134 -> {152}; + 134 -> {135} [style=dotted]; + 135 -> {136} [style=dotted]; + 136 -> {137} [style=dotted]; + 137 -> {138} [style=dotted]; 138 -> {139}; 139 -> {140}; 140 -> {141}; - 141 -> {160}; - 141 -> {142} [style=dotted]; - 142 -> {143} [style=dotted]; - 143 -> {144} [style=dotted]; - 144 -> {145} [style=dotted]; + 141 -> {143 142}; + 142 -> {149}; + 143 -> {144}; + 144 -> {145}; 145 -> {146}; 146 -> {147}; 147 -> {148}; - 148 -> {150 149}; - 149 -> {156}; + 148 -> {149}; + 149 -> {150}; 150 -> {151}; 151 -> {152}; - 152 -> {153}; + + subgraph cluster_36 { + color=red + 153 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_37 { + color=blue + 154 [label="Enter when"]; + subgraph cluster_38 { + color=blue + 155 [label="Enter when branch condition "]; + subgraph cluster_39 { + color=blue + 156 [label="Enter ||"]; + subgraph cluster_40 { + color=blue + 157 [label="Enter when"]; + 158 [label="Access variable R|/a|"]; + 159 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_41 { + color=blue + 160 [label="Enter when branch condition "]; + 161 [label="Const: Null(null)"]; + 162 [label="Operator =="]; + 163 [label="Exit when branch condition"]; + } + subgraph cluster_42 { + color=blue + 164 [label="Enter when branch condition else"]; + 165 [label="Exit when branch condition"]; + } + 166 [label="Enter when branch result"]; + subgraph cluster_43 { + color=blue + 167 [label="Enter block"]; + 168 [label="Access variable R|/|"]; + 169 [label="Exit block"]; + } + 170 [label="Exit when branch result"]; + 171 [label="Enter when branch result"]; + subgraph cluster_44 { + color=blue + 172 [label="Enter block"]; + 173 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 174 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 175 [label="Stub" style="filled" fillcolor=gray]; + 176 [label="Exit block" style="filled" fillcolor=gray]; + } + 177 [label="Exit when branch result" style="filled" fillcolor=gray]; + 178 [label="Exit when"]; + } + 179 [label="Function call: when (lval : R|A?| = R|/a|) { + ==($subj$, Null(null)) -> { + throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() + } + else -> { + R|/| + } +} +.R|/A.foo|()"]; + 180 [label="Exit left part of ||"]; + 181 [label="Enter right part of ||"]; + 182 [label="Access variable R|/b|"]; + 183 [label="Exit ||"]; + } + 184 [label="Exit when branch condition"]; + } + 185 [label="Synthetic else branch"]; + 186 [label="Enter when branch result"]; + subgraph cluster_45 { + color=blue + 187 [label="Enter block"]; + 188 [label="Access variable R|/a|"]; + 189 [label="Function call: R|/a|.R|/A.foo|()"]; + 190 [label="Exit block"]; + } + 191 [label="Exit when branch result"]; + 192 [label="Exit when"]; + } + 193 [label="Access variable R|/a|"]; + 194 [label="Function call: R|/a|.R|/A.foo|()"]; + 195 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 153 -> {154}; 154 -> {155}; 155 -> {156}; @@ -485,196 +547,96 @@ digraph bangbang_kt { 157 -> {158}; 158 -> {159}; 159 -> {160}; - - subgraph cluster_40 { - color=red - 161 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_41 { - color=blue - 162 [label="Enter block"]; - subgraph cluster_42 { - color=blue - 163 [label="Enter when"]; - subgraph cluster_43 { - color=blue - 164 [label="Enter when branch condition "]; - subgraph cluster_44 { - color=blue - 165 [label="Enter ||"]; - subgraph cluster_45 { - color=blue - 166 [label="Enter when"]; - 167 [label="Access variable R|/a|"]; - 168 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_46 { - color=blue - 169 [label="Enter when branch condition "]; - 170 [label="Const: Null(null)"]; - 171 [label="Operator =="]; - 172 [label="Exit when branch condition"]; - } - subgraph cluster_47 { - color=blue - 173 [label="Enter when branch condition else"]; - 174 [label="Exit when branch condition"]; - } - 175 [label="Enter when branch result"]; - subgraph cluster_48 { - color=blue - 176 [label="Enter block"]; - 177 [label="Access variable R|/|"]; - 178 [label="Exit block"]; - } - 179 [label="Exit when branch result"]; - 180 [label="Enter when branch result"]; - subgraph cluster_49 { - color=blue - 181 [label="Enter block"]; - 182 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 183 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 184 [label="Stub" style="filled" fillcolor=gray]; - 185 [label="Exit block" style="filled" fillcolor=gray]; - } - 186 [label="Exit when branch result" style="filled" fillcolor=gray]; - 187 [label="Exit when"]; - } - 188 [label="Function call: when (lval : R|A?| = R|/a|) { - ==($subj$, Null(null)) -> { - throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() - } - else -> { - R|/| - } -} -.R|/A.foo|()"]; - 189 [label="Exit left part of ||"]; - 190 [label="Enter right part of ||"]; - 191 [label="Access variable R|/b|"]; - 192 [label="Exit ||"]; - } - 193 [label="Exit when branch condition"]; - } - 194 [label="Synthetic else branch"]; - 195 [label="Enter when branch result"]; - subgraph cluster_50 { - color=blue - 196 [label="Enter block"]; - 197 [label="Access variable R|/a|"]; - 198 [label="Function call: R|/a|.R|/A.foo|()"]; - 199 [label="Exit block"]; - } - 200 [label="Exit when branch result"]; - 201 [label="Exit when"]; - } - 202 [label="Access variable R|/a|"]; - 203 [label="Function call: R|/a|.R|/A.foo|()"]; - 204 [label="Exit block"]; - } - 205 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 160 -> {161}; 161 -> {162}; 162 -> {163}; - 163 -> {164}; + 163 -> {171 164}; 164 -> {165}; 165 -> {166}; 166 -> {167}; 167 -> {168}; 168 -> {169}; 169 -> {170}; - 170 -> {171}; + 170 -> {178}; 171 -> {172}; - 172 -> {180 173}; + 172 -> {173}; 173 -> {174}; - 174 -> {175}; - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; + 174 -> {195}; + 174 -> {175} [style=dotted]; + 175 -> {176} [style=dotted]; + 176 -> {177} [style=dotted]; + 177 -> {178} [style=dotted]; 178 -> {179}; - 179 -> {187}; - 180 -> {181}; + 179 -> {180}; + 180 -> {183 181}; 181 -> {182}; 182 -> {183}; - 183 -> {205}; - 183 -> {184} [style=dotted]; - 184 -> {185} [style=dotted]; - 185 -> {186} [style=dotted]; - 186 -> {187} [style=dotted]; + 183 -> {184}; + 184 -> {186 185}; + 185 -> {192}; + 186 -> {187}; 187 -> {188}; 188 -> {189}; - 189 -> {192 190}; + 189 -> {190}; 190 -> {191}; 191 -> {192}; 192 -> {193}; - 193 -> {195 194}; - 194 -> {201}; - 195 -> {196}; - 196 -> {197}; - 197 -> {198}; - 198 -> {199}; - 199 -> {200}; - 200 -> {201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {204}; - 204 -> {205}; + 193 -> {194}; + 194 -> {195}; - subgraph cluster_51 { + subgraph cluster_46 { color=red - 206 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_52 { + 196 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_47 { color=blue - 207 [label="Enter block"]; - subgraph cluster_53 { + 197 [label="Enter when"]; + subgraph cluster_48 { color=blue - 208 [label="Enter when"]; - subgraph cluster_54 { + 198 [label="Enter when branch condition "]; + subgraph cluster_49 { color=blue - 209 [label="Enter when branch condition "]; - subgraph cluster_55 { + 199 [label="Enter ||"]; + 200 [label="Access variable R|/b|"]; + 201 [label="Exit left part of ||"]; + 202 [label="Enter right part of ||"]; + subgraph cluster_50 { color=blue - 210 [label="Enter ||"]; - 211 [label="Access variable R|/b|"]; - 212 [label="Exit left part of ||"]; - 213 [label="Enter right part of ||"]; - subgraph cluster_56 { + 203 [label="Enter when"]; + 204 [label="Access variable R|/a|"]; + 205 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_51 { color=blue - 214 [label="Enter when"]; - 215 [label="Access variable R|/a|"]; - 216 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_57 { - color=blue - 217 [label="Enter when branch condition "]; - 218 [label="Const: Null(null)"]; - 219 [label="Operator =="]; - 220 [label="Exit when branch condition"]; - } - subgraph cluster_58 { - color=blue - 221 [label="Enter when branch condition else"]; - 222 [label="Exit when branch condition"]; - } - 223 [label="Enter when branch result"]; - subgraph cluster_59 { - color=blue - 224 [label="Enter block"]; - 225 [label="Access variable R|/|"]; - 226 [label="Exit block"]; - } - 227 [label="Exit when branch result"]; - 228 [label="Enter when branch result"]; - subgraph cluster_60 { - color=blue - 229 [label="Enter block"]; - 230 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 231 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; - 232 [label="Stub" style="filled" fillcolor=gray]; - 233 [label="Exit block" style="filled" fillcolor=gray]; - } - 234 [label="Exit when branch result" style="filled" fillcolor=gray]; - 235 [label="Exit when"]; + 206 [label="Enter when branch condition "]; + 207 [label="Const: Null(null)"]; + 208 [label="Operator =="]; + 209 [label="Exit when branch condition"]; } - 236 [label="Function call: when (lval : R|A?| = R|/a|) { + subgraph cluster_52 { + color=blue + 210 [label="Enter when branch condition else"]; + 211 [label="Exit when branch condition"]; + } + 212 [label="Enter when branch result"]; + subgraph cluster_53 { + color=blue + 213 [label="Enter block"]; + 214 [label="Access variable R|/|"]; + 215 [label="Exit block"]; + } + 216 [label="Exit when branch result"]; + 217 [label="Enter when branch result"]; + subgraph cluster_54 { + color=blue + 218 [label="Enter block"]; + 219 [label="Function call: R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 220 [label="Throw: throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()"]; + 221 [label="Stub" style="filled" fillcolor=gray]; + 222 [label="Exit block" style="filled" fillcolor=gray]; + } + 223 [label="Exit when branch result" style="filled" fillcolor=gray]; + 224 [label="Exit when"]; + } + 225 [label="Function call: when (lval : R|A?| = R|/a|) { ==($subj$, Null(null)) -> { throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|() } @@ -683,73 +645,69 @@ digraph bangbang_kt { } } .R|/A.foo|()"]; - 237 [label="Exit ||"]; - } - 238 [label="Exit when branch condition"]; + 226 [label="Exit ||"]; } - 239 [label="Synthetic else branch"]; - 240 [label="Enter when branch result"]; - subgraph cluster_61 { - color=blue - 241 [label="Enter block"]; - 242 [label="Access variable R|/a|"]; - 243 [label="Function call: R|/a|.#()"]; - 244 [label="Exit block"]; - } - 245 [label="Exit when branch result"]; - 246 [label="Exit when"]; + 227 [label="Exit when branch condition"]; } - 247 [label="Access variable R|/a|"]; - 248 [label="Function call: R|/a|.#()"]; - 249 [label="Exit block"]; + 228 [label="Synthetic else branch"]; + 229 [label="Enter when branch result"]; + subgraph cluster_55 { + color=blue + 230 [label="Enter block"]; + 231 [label="Access variable R|/a|"]; + 232 [label="Function call: R|/a|.#()"]; + 233 [label="Exit block"]; + } + 234 [label="Exit when branch result"]; + 235 [label="Exit when"]; } - 250 [label="Exit function test_5" style="filled" fillcolor=red]; + 236 [label="Access variable R|/a|"]; + 237 [label="Function call: R|/a|.#()"]; + 238 [label="Exit function test_5" style="filled" fillcolor=red]; } + 196 -> {197}; + 197 -> {198}; + 198 -> {199}; + 199 -> {200}; + 200 -> {201}; + 201 -> {226 202}; + 202 -> {203}; + 203 -> {204}; + 204 -> {205}; + 205 -> {206}; 206 -> {207}; 207 -> {208}; 208 -> {209}; - 209 -> {210}; + 209 -> {217 210}; 210 -> {211}; 211 -> {212}; - 212 -> {237 213}; + 212 -> {213}; 213 -> {214}; 214 -> {215}; 215 -> {216}; - 216 -> {217}; + 216 -> {224}; 217 -> {218}; 218 -> {219}; 219 -> {220}; - 220 -> {228 221}; - 221 -> {222}; - 222 -> {223}; - 223 -> {224}; + 220 -> {238}; + 220 -> {221} [style=dotted]; + 221 -> {222} [style=dotted]; + 222 -> {223} [style=dotted]; + 223 -> {224} [style=dotted]; 224 -> {225}; 225 -> {226}; 226 -> {227}; - 227 -> {235}; - 228 -> {229}; + 227 -> {229 228}; + 228 -> {235}; 229 -> {230}; 230 -> {231}; - 231 -> {250}; - 231 -> {232} [style=dotted]; - 232 -> {233} [style=dotted]; - 233 -> {234} [style=dotted]; - 234 -> {235} [style=dotted]; + 231 -> {232}; + 232 -> {233}; + 233 -> {234}; + 234 -> {235}; 235 -> {236}; 236 -> {237}; 237 -> {238}; - 238 -> {240 239}; - 239 -> {246}; - 240 -> {241}; - 241 -> {242}; - 242 -> {243}; - 243 -> {244}; - 244 -> {245}; - 245 -> {246}; - 246 -> {247}; - 247 -> {248}; - 248 -> {249}; - 249 -> {250}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot index 5bf8cf37680..2fd49e2cc48 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot @@ -40,45 +40,40 @@ digraph booleanOperators_kt { 8 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_5 { color=blue - 9 [label="Enter block"]; + 9 [label="Enter when"]; subgraph cluster_6 { color=blue - 10 [label="Enter when"]; + 10 [label="Enter when branch condition "]; subgraph cluster_7 { color=blue - 11 [label="Enter when branch condition "]; - subgraph cluster_8 { - color=blue - 12 [label="Enter &&"]; - 13 [label="Access variable R|/x|"]; - 14 [label="Type operator: x is B"]; - 15 [label="Exit left part of &&"]; - 16 [label="Enter right part of &&"]; - 17 [label="Access variable R|/x|"]; - 18 [label="Type operator: x is C"]; - 19 [label="Exit &&"]; - } - 20 [label="Exit when branch condition"]; + 11 [label="Enter &&"]; + 12 [label="Access variable R|/x|"]; + 13 [label="Type operator: x is B"]; + 14 [label="Exit left part of &&"]; + 15 [label="Enter right part of &&"]; + 16 [label="Access variable R|/x|"]; + 17 [label="Type operator: x is C"]; + 18 [label="Exit &&"]; } - 21 [label="Synthetic else branch"]; - 22 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 23 [label="Enter block"]; - 24 [label="Access variable R|/x|"]; - 25 [label="Function call: R|/x|.R|/A.foo|()"]; - 26 [label="Access variable R|/x|"]; - 27 [label="Function call: R|/x|.R|/B.bar|()"]; - 28 [label="Access variable R|/x|"]; - 29 [label="Function call: R|/x|.R|/C.baz|()"]; - 30 [label="Exit block"]; - } - 31 [label="Exit when branch result"]; - 32 [label="Exit when"]; + 19 [label="Exit when branch condition"]; } - 33 [label="Exit block"]; + 20 [label="Synthetic else branch"]; + 21 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 22 [label="Enter block"]; + 23 [label="Access variable R|/x|"]; + 24 [label="Function call: R|/x|.R|/A.foo|()"]; + 25 [label="Access variable R|/x|"]; + 26 [label="Function call: R|/x|.R|/B.bar|()"]; + 27 [label="Access variable R|/x|"]; + 28 [label="Function call: R|/x|.R|/C.baz|()"]; + 29 [label="Exit block"]; + } + 30 [label="Exit when branch result"]; + 31 [label="Exit when"]; } - 34 [label="Exit function test_1" style="filled" fillcolor=red]; + 32 [label="Exit function test_1" style="filled" fillcolor=red]; } 8 -> {9}; @@ -87,14 +82,14 @@ digraph booleanOperators_kt { 11 -> {12}; 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {19 16}; + 14 -> {18 15}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; - 19 -> {20}; - 20 -> {22 21}; - 21 -> {32}; + 19 -> {21 20}; + 20 -> {31}; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; @@ -105,69 +100,64 @@ digraph booleanOperators_kt { 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - subgraph cluster_10 { + subgraph cluster_9 { color=red - 35 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_11 { + 33 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { color=blue - 36 [label="Enter block"]; - subgraph cluster_12 { + 34 [label="Enter when"]; + subgraph cluster_11 { color=blue - 37 [label="Enter when"]; - subgraph cluster_13 { + 35 [label="Enter when branch condition "]; + subgraph cluster_12 { color=blue - 38 [label="Enter when branch condition "]; - subgraph cluster_14 { - color=blue - 39 [label="Enter ||"]; - 40 [label="Access variable R|/x|"]; - 41 [label="Type operator: x is B"]; - 42 [label="Exit left part of ||"]; - 43 [label="Enter right part of ||"]; - 44 [label="Access variable R|/x|"]; - 45 [label="Type operator: x is C"]; - 46 [label="Exit ||"]; - } - 47 [label="Exit when branch condition"]; + 36 [label="Enter ||"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Type operator: x is B"]; + 39 [label="Exit left part of ||"]; + 40 [label="Enter right part of ||"]; + 41 [label="Access variable R|/x|"]; + 42 [label="Type operator: x is C"]; + 43 [label="Exit ||"]; } - 48 [label="Synthetic else branch"]; - 49 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 50 [label="Enter block"]; - 51 [label="Access variable R|/x|"]; - 52 [label="Function call: R|/x|.R|/A.foo|()"]; - 53 [label="Access variable R|/x|"]; - 54 [label="Function call: R|/x|.#()"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Function call: R|/x|.#()"]; - 57 [label="Exit block"]; - } - 58 [label="Exit when branch result"]; - 59 [label="Exit when"]; + 44 [label="Exit when branch condition"]; } - 60 [label="Exit block"]; + 45 [label="Synthetic else branch"]; + 46 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 47 [label="Enter block"]; + 48 [label="Access variable R|/x|"]; + 49 [label="Function call: R|/x|.R|/A.foo|()"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Function call: R|/x|.#()"]; + 52 [label="Access variable R|/x|"]; + 53 [label="Function call: R|/x|.#()"]; + 54 [label="Exit block"]; + } + 55 [label="Exit when branch result"]; + 56 [label="Exit when"]; } - 61 [label="Exit function test_2" style="filled" fillcolor=red]; + 57 [label="Exit function test_2" style="filled" fillcolor=red]; } + 33 -> {34}; + 34 -> {35}; 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; - 39 -> {40}; + 39 -> {43 40}; 40 -> {41}; 41 -> {42}; - 42 -> {46 43}; + 42 -> {43}; 43 -> {44}; - 44 -> {45}; - 45 -> {46}; + 44 -> {46 45}; + 45 -> {56}; 46 -> {47}; - 47 -> {49 48}; - 48 -> {59}; + 47 -> {48}; + 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; @@ -176,128 +166,155 @@ digraph booleanOperators_kt { 54 -> {55}; 55 -> {56}; 56 -> {57}; - 57 -> {58}; + + subgraph cluster_14 { + color=red + 58 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_15 { + color=blue + 59 [label="Enter when"]; + subgraph cluster_16 { + color=blue + 60 [label="Enter when branch condition "]; + 61 [label="Access variable R|/x|"]; + 62 [label="Type operator: x !is A"]; + 63 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; + 64 [label="Exit when branch condition"]; + } + 65 [label="Synthetic else branch"]; + 66 [label="Enter when branch result"]; + subgraph cluster_17 { + color=blue + 67 [label="Enter block"]; + 68 [label="Access variable R|/x|"]; + 69 [label="Function call: R|/x|.R|/A.foo|()"]; + 70 [label="Exit block"]; + } + 71 [label="Exit when branch result"]; + 72 [label="Exit when"]; + } + 73 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 58 -> {59}; 59 -> {60}; 60 -> {61}; - - subgraph cluster_16 { - color=red - 62 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_17 { - color=blue - 63 [label="Enter block"]; - subgraph cluster_18 { - color=blue - 64 [label="Enter when"]; - subgraph cluster_19 { - color=blue - 65 [label="Enter when branch condition "]; - 66 [label="Access variable R|/x|"]; - 67 [label="Type operator: x !is A"]; - 68 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; - 69 [label="Exit when branch condition"]; - } - 70 [label="Synthetic else branch"]; - 71 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 72 [label="Enter block"]; - 73 [label="Access variable R|/x|"]; - 74 [label="Function call: R|/x|.R|/A.foo|()"]; - 75 [label="Exit block"]; - } - 76 [label="Exit when branch result"]; - 77 [label="Exit when"]; - } - 78 [label="Exit block"]; - } - 79 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 61 -> {62}; 62 -> {63}; 63 -> {64}; - 64 -> {65}; - 65 -> {66}; + 64 -> {66 65}; + 65 -> {72}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {71 70}; - 70 -> {77}; + 69 -> {70}; + 70 -> {71}; 71 -> {72}; 72 -> {73}; - 73 -> {74}; + + subgraph cluster_18 { + color=red + 74 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_19 { + color=blue + 75 [label="Enter when"]; + subgraph cluster_20 { + color=blue + 76 [label="Enter when branch condition "]; + subgraph cluster_21 { + color=blue + 77 [label="Enter ||"]; + 78 [label="Access variable R|/x|"]; + 79 [label="Type operator: x !is String"]; + 80 [label="Exit left part of ||"]; + 81 [label="Enter right part of ||"]; + 82 [label="Access variable R|/x|"]; + 83 [label="Access variable R|kotlin/String.length|"]; + 84 [label="Const: Int(0)"]; + 85 [label="Operator =="]; + 86 [label="Exit ||"]; + } + 87 [label="Exit when branch condition"]; + } + 88 [label="Synthetic else branch"]; + 89 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 90 [label="Enter block"]; + 91 [label="Access variable R|/x|"]; + 92 [label="Access variable #"]; + 93 [label="Exit block"]; + } + 94 [label="Exit when branch result"]; + 95 [label="Exit when"]; + } + 96 [label="Access variable R|/x|"]; + 97 [label="Access variable #"]; + 98 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - - subgraph cluster_21 { - color=red - 80 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 81 [label="Enter block"]; - subgraph cluster_23 { - color=blue - 82 [label="Enter when"]; - subgraph cluster_24 { - color=blue - 83 [label="Enter when branch condition "]; - subgraph cluster_25 { - color=blue - 84 [label="Enter ||"]; - 85 [label="Access variable R|/x|"]; - 86 [label="Type operator: x !is String"]; - 87 [label="Exit left part of ||"]; - 88 [label="Enter right part of ||"]; - 89 [label="Access variable R|/x|"]; - 90 [label="Access variable R|kotlin/String.length|"]; - 91 [label="Const: Int(0)"]; - 92 [label="Operator =="]; - 93 [label="Exit ||"]; - } - 94 [label="Exit when branch condition"]; - } - 95 [label="Synthetic else branch"]; - 96 [label="Enter when branch result"]; - subgraph cluster_26 { - color=blue - 97 [label="Enter block"]; - 98 [label="Access variable R|/x|"]; - 99 [label="Access variable #"]; - 100 [label="Exit block"]; - } - 101 [label="Exit when branch result"]; - 102 [label="Exit when"]; - } - 103 [label="Access variable R|/x|"]; - 104 [label="Access variable #"]; - 105 [label="Exit block"]; - } - 106 [label="Exit function test_4" style="filled" fillcolor=red]; - } - - 80 -> {81}; + 79 -> {80}; + 80 -> {86 81}; 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; 86 -> {87}; - 87 -> {93 88}; - 88 -> {89}; + 87 -> {89 88}; + 88 -> {95}; 89 -> {90}; 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; - 94 -> {96 95}; - 95 -> {102}; + 94 -> {95}; + 95 -> {96}; 96 -> {97}; 97 -> {98}; - 98 -> {99}; + + subgraph cluster_23 { + color=red + 99 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_24 { + color=blue + 100 [label="Enter when"]; + subgraph cluster_25 { + color=blue + 101 [label="Enter when branch condition "]; + subgraph cluster_26 { + color=blue + 102 [label="Enter ||"]; + 103 [label="Access variable R|/x|"]; + 104 [label="Const: Null(null)"]; + 105 [label="Operator !="]; + 106 [label="Exit left part of ||"]; + 107 [label="Enter right part of ||"]; + 108 [label="Const: Boolean(false)"]; + 109 [label="Exit ||"]; + } + 110 [label="Exit when branch condition"]; + } + 111 [label="Synthetic else branch"]; + 112 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 113 [label="Enter block"]; + 114 [label="Access variable R|/x|"]; + 115 [label="Function call: R|/x|.#()"]; + 116 [label="Exit block"]; + } + 117 [label="Exit when branch result"]; + 118 [label="Exit when"]; + } + 119 [label="Exit function test_5" style="filled" fillcolor=red]; + } + 99 -> {100}; 100 -> {101}; 101 -> {102}; @@ -305,203 +322,137 @@ digraph booleanOperators_kt { 103 -> {104}; 104 -> {105}; 105 -> {106}; - - subgraph cluster_27 { - color=red - 107 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_28 { - color=blue - 108 [label="Enter block"]; - subgraph cluster_29 { - color=blue - 109 [label="Enter when"]; - subgraph cluster_30 { - color=blue - 110 [label="Enter when branch condition "]; - subgraph cluster_31 { - color=blue - 111 [label="Enter ||"]; - 112 [label="Access variable R|/x|"]; - 113 [label="Const: Null(null)"]; - 114 [label="Operator !="]; - 115 [label="Exit left part of ||"]; - 116 [label="Enter right part of ||"]; - 117 [label="Const: Boolean(false)"]; - 118 [label="Exit ||"]; - } - 119 [label="Exit when branch condition"]; - } - 120 [label="Synthetic else branch"]; - 121 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 122 [label="Enter block"]; - 123 [label="Access variable R|/x|"]; - 124 [label="Function call: R|/x|.#()"]; - 125 [label="Exit block"]; - } - 126 [label="Exit when branch result"]; - 127 [label="Exit when"]; - } - 128 [label="Exit block"]; - } - 129 [label="Exit function test_5" style="filled" fillcolor=red]; - } - + 106 -> {109 107}; 107 -> {108}; 108 -> {109}; 109 -> {110}; - 110 -> {111}; - 111 -> {112}; + 110 -> {112 111}; + 111 -> {118}; 112 -> {113}; 113 -> {114}; 114 -> {115}; - 115 -> {118 116}; + 115 -> {116}; 116 -> {117}; 117 -> {118}; 118 -> {119}; - 119 -> {121 120}; - 120 -> {127}; + + subgraph cluster_28 { + color=red + 120 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 121 [label="Enter when"]; + subgraph cluster_30 { + color=blue + 122 [label="Enter when branch condition "]; + subgraph cluster_31 { + color=blue + 123 [label="Enter ||"]; + 124 [label="Const: Boolean(false)"]; + 125 [label="Exit left part of ||"]; + 126 [label="Enter right part of ||"]; + 127 [label="Access variable R|/x|"]; + 128 [label="Const: Null(null)"]; + 129 [label="Operator !="]; + 130 [label="Stub" style="filled" fillcolor=gray]; + 131 [label="Exit ||"]; + } + 132 [label="Exit when branch condition"]; + } + 133 [label="Synthetic else branch"]; + 134 [label="Enter when branch result"]; + subgraph cluster_32 { + color=blue + 135 [label="Enter block"]; + 136 [label="Access variable R|/x|"]; + 137 [label="Function call: R|/x|.#()"]; + 138 [label="Exit block"]; + } + 139 [label="Exit when branch result"]; + 140 [label="Exit when"]; + } + 141 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 120 -> {121}; 121 -> {122}; 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; + 125 -> {130} [style=dotted]; 126 -> {127}; 127 -> {128}; 128 -> {129}; - - subgraph cluster_33 { - color=red - 130 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_34 { - color=blue - 131 [label="Enter block"]; - subgraph cluster_35 { - color=blue - 132 [label="Enter when"]; - subgraph cluster_36 { - color=blue - 133 [label="Enter when branch condition "]; - subgraph cluster_37 { - color=blue - 134 [label="Enter ||"]; - 135 [label="Const: Boolean(false)"]; - 136 [label="Exit left part of ||"]; - 137 [label="Enter right part of ||"]; - 138 [label="Access variable R|/x|"]; - 139 [label="Const: Null(null)"]; - 140 [label="Operator !="]; - 141 [label="Stub" style="filled" fillcolor=gray]; - 142 [label="Exit ||"]; - } - 143 [label="Exit when branch condition"]; - } - 144 [label="Synthetic else branch"]; - 145 [label="Enter when branch result"]; - subgraph cluster_38 { - color=blue - 146 [label="Enter block"]; - 147 [label="Access variable R|/x|"]; - 148 [label="Function call: R|/x|.#()"]; - 149 [label="Exit block"]; - } - 150 [label="Exit when branch result"]; - 151 [label="Exit when"]; - } - 152 [label="Exit block"]; - } - 153 [label="Exit function test_6" style="filled" fillcolor=red]; - } - - 130 -> {131}; + 129 -> {131}; + 130 -> {131} [style=dotted]; 131 -> {132}; - 132 -> {133}; - 133 -> {134}; + 132 -> {134 133}; + 133 -> {140}; 134 -> {135}; 135 -> {136}; 136 -> {137}; - 136 -> {141} [style=dotted]; 137 -> {138}; 138 -> {139}; 139 -> {140}; - 140 -> {142}; - 141 -> {142} [style=dotted]; + 140 -> {141}; + + subgraph cluster_33 { + color=red + 142 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_34 { + color=blue + 143 [label="Enter when"]; + subgraph cluster_35 { + color=blue + 144 [label="Enter when branch condition "]; + subgraph cluster_36 { + color=blue + 145 [label="Enter &&"]; + 146 [label="Access variable R|/x|"]; + 147 [label="Type operator: x is A"]; + 148 [label="Exit left part of &&"]; + 149 [label="Enter right part of &&"]; + 150 [label="Access variable R|/x|"]; + 151 [label="Function call: R|/x|.R|/A.bool|()"]; + 152 [label="Exit &&"]; + } + 153 [label="Exit when branch condition"]; + } + 154 [label="Synthetic else branch"]; + 155 [label="Enter when branch result"]; + subgraph cluster_37 { + color=blue + 156 [label="Enter block"]; + 157 [label="Access variable R|/x|"]; + 158 [label="Function call: R|/x|.R|/A.foo|()"]; + 159 [label="Exit block"]; + } + 160 [label="Exit when branch result"]; + 161 [label="Exit when"]; + } + 162 [label="Exit function test_7" style="filled" fillcolor=red]; + } + 142 -> {143}; - 143 -> {145 144}; - 144 -> {151}; + 143 -> {144}; + 144 -> {145}; 145 -> {146}; 146 -> {147}; 147 -> {148}; - 148 -> {149}; + 148 -> {152 149}; 149 -> {150}; 150 -> {151}; 151 -> {152}; 152 -> {153}; - - subgraph cluster_39 { - color=red - 154 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_40 { - color=blue - 155 [label="Enter block"]; - subgraph cluster_41 { - color=blue - 156 [label="Enter when"]; - subgraph cluster_42 { - color=blue - 157 [label="Enter when branch condition "]; - subgraph cluster_43 { - color=blue - 158 [label="Enter &&"]; - 159 [label="Access variable R|/x|"]; - 160 [label="Type operator: x is A"]; - 161 [label="Exit left part of &&"]; - 162 [label="Enter right part of &&"]; - 163 [label="Access variable R|/x|"]; - 164 [label="Function call: R|/x|.R|/A.bool|()"]; - 165 [label="Exit &&"]; - } - 166 [label="Exit when branch condition"]; - } - 167 [label="Synthetic else branch"]; - 168 [label="Enter when branch result"]; - subgraph cluster_44 { - color=blue - 169 [label="Enter block"]; - 170 [label="Access variable R|/x|"]; - 171 [label="Function call: R|/x|.R|/A.foo|()"]; - 172 [label="Exit block"]; - } - 173 [label="Exit when branch result"]; - 174 [label="Exit when"]; - } - 175 [label="Exit block"]; - } - 176 [label="Exit function test_7" style="filled" fillcolor=red]; - } - - 154 -> {155}; + 153 -> {155 154}; + 154 -> {161}; 155 -> {156}; 156 -> {157}; 157 -> {158}; 158 -> {159}; 159 -> {160}; 160 -> {161}; - 161 -> {165 162}; - 162 -> {163}; - 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - 166 -> {168 167}; - 167 -> {174}; - 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {173}; - 173 -> {174}; - 174 -> {175}; - 175 -> {176}; + 161 -> {162}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot index 8e9140aa3b8..bae3abbaaf6 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot @@ -22,38 +22,33 @@ digraph boundSmartcasts_kt { subgraph cluster_2 { color=red 4 [label="Enter function test_1" style="filled" fillcolor=red]; + 5 [label="Access variable R|/x|"]; + 6 [label="Variable declaration: lval y: R|kotlin/Any|"]; subgraph cluster_3 { color=blue - 5 [label="Enter block"]; - 6 [label="Access variable R|/x|"]; - 7 [label="Variable declaration: lval y: R|kotlin/Any|"]; + 7 [label="Enter when"]; subgraph cluster_4 { color=blue - 8 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 9 [label="Enter when branch condition "]; - 10 [label="Access variable R|/x|"]; - 11 [label="Type operator: x is A"]; - 12 [label="Exit when branch condition"]; - } - 13 [label="Synthetic else branch"]; - 14 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 15 [label="Enter block"]; - 16 [label="Access variable R|/x|"]; - 17 [label="Function call: R|/x|.R|/A.foo|()"]; - 18 [label="Access variable R|/y|"]; - 19 [label="Function call: R|/y|.R|/A.foo|()"]; - 20 [label="Exit block"]; - } - 21 [label="Exit when branch result"]; - 22 [label="Exit when"]; + 8 [label="Enter when branch condition "]; + 9 [label="Access variable R|/x|"]; + 10 [label="Type operator: x is A"]; + 11 [label="Exit when branch condition"]; } - 23 [label="Exit block"]; + 12 [label="Synthetic else branch"]; + 13 [label="Enter when branch result"]; + subgraph cluster_5 { + color=blue + 14 [label="Enter block"]; + 15 [label="Access variable R|/x|"]; + 16 [label="Function call: R|/x|.R|/A.foo|()"]; + 17 [label="Access variable R|/y|"]; + 18 [label="Function call: R|/y|.R|/A.foo|()"]; + 19 [label="Exit block"]; + } + 20 [label="Exit when branch result"]; + 21 [label="Exit when"]; } - 24 [label="Exit function test_1" style="filled" fillcolor=red]; + 22 [label="Exit function test_1" style="filled" fillcolor=red]; } 4 -> {5}; @@ -63,9 +58,9 @@ digraph boundSmartcasts_kt { 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; - 12 -> {14 13}; - 13 -> {22}; + 11 -> {13 12}; + 12 -> {21}; + 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; @@ -74,136 +69,126 @@ digraph boundSmartcasts_kt { 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - subgraph cluster_7 { + subgraph cluster_6 { color=red - 25 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_8 { + 23 [label="Enter function test_2" style="filled" fillcolor=red]; + 24 [label="Access variable R|/x|"]; + 25 [label="Variable declaration: lval y: R|kotlin/Any|"]; + subgraph cluster_7 { color=blue - 26 [label="Enter block"]; - 27 [label="Access variable R|/x|"]; - 28 [label="Variable declaration: lval y: R|kotlin/Any|"]; + 26 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 27 [label="Enter when branch condition "]; + 28 [label="Access variable R|/y|"]; + 29 [label="Type operator: y is A"]; + 30 [label="Exit when branch condition"]; + } + 31 [label="Synthetic else branch"]; + 32 [label="Enter when branch result"]; subgraph cluster_9 { color=blue - 29 [label="Enter when"]; - subgraph cluster_10 { - color=blue - 30 [label="Enter when branch condition "]; - 31 [label="Access variable R|/y|"]; - 32 [label="Type operator: y is A"]; - 33 [label="Exit when branch condition"]; - } - 34 [label="Synthetic else branch"]; - 35 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 36 [label="Enter block"]; - 37 [label="Access variable R|/x|"]; - 38 [label="Function call: R|/x|.R|/A.foo|()"]; - 39 [label="Access variable R|/y|"]; - 40 [label="Function call: R|/y|.R|/A.foo|()"]; - 41 [label="Exit block"]; - } - 42 [label="Exit when branch result"]; - 43 [label="Exit when"]; + 33 [label="Enter block"]; + 34 [label="Access variable R|/x|"]; + 35 [label="Function call: R|/x|.R|/A.foo|()"]; + 36 [label="Access variable R|/y|"]; + 37 [label="Function call: R|/y|.R|/A.foo|()"]; + 38 [label="Exit block"]; } - 44 [label="Exit block"]; + 39 [label="Exit when branch result"]; + 40 [label="Exit when"]; } - 45 [label="Exit function test_2" style="filled" fillcolor=red]; + 41 [label="Exit function test_2" style="filled" fillcolor=red]; } + 23 -> {24}; + 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {31}; - 31 -> {32}; + 30 -> {32 31}; + 31 -> {40}; 32 -> {33}; - 33 -> {35 34}; - 34 -> {43}; + 33 -> {34}; + 34 -> {35}; 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; - 41 -> {42}; + + subgraph cluster_10 { + color=red + 42 [label="Enter function test_3" style="filled" fillcolor=red]; + 43 [label="Access variable R|/x|"]; + 44 [label="Variable declaration: lvar z: R|kotlin/Any|"]; + subgraph cluster_11 { + color=blue + 45 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 46 [label="Enter when branch condition "]; + 47 [label="Access variable R|/x|"]; + 48 [label="Type operator: x is A"]; + 49 [label="Exit when branch condition"]; + } + 50 [label="Synthetic else branch"]; + 51 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 52 [label="Enter block"]; + 53 [label="Access variable R|/z|"]; + 54 [label="Function call: R|/z|.R|/A.foo|()"]; + 55 [label="Exit block"]; + } + 56 [label="Exit when branch result"]; + 57 [label="Exit when"]; + } + 58 [label="Access variable R|/y|"]; + 59 [label="Assignmenet: R|/z|"]; + subgraph cluster_14 { + color=blue + 60 [label="Enter when"]; + subgraph cluster_15 { + color=blue + 61 [label="Enter when branch condition "]; + 62 [label="Access variable R|/y|"]; + 63 [label="Type operator: y is B"]; + 64 [label="Exit when branch condition"]; + } + 65 [label="Synthetic else branch"]; + 66 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 67 [label="Enter block"]; + 68 [label="Access variable R|/z|"]; + 69 [label="Function call: R|/z|.#()"]; + 70 [label="Exit block"]; + } + 71 [label="Exit when branch result"]; + 72 [label="Exit when"]; + } + 73 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 42 -> {43}; 43 -> {44}; 44 -> {45}; - - subgraph cluster_12 { - color=red - 46 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 47 [label="Enter block"]; - 48 [label="Access variable R|/x|"]; - 49 [label="Variable declaration: lvar z: R|kotlin/Any|"]; - subgraph cluster_14 { - color=blue - 50 [label="Enter when"]; - subgraph cluster_15 { - color=blue - 51 [label="Enter when branch condition "]; - 52 [label="Access variable R|/x|"]; - 53 [label="Type operator: x is A"]; - 54 [label="Exit when branch condition"]; - } - 55 [label="Synthetic else branch"]; - 56 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 57 [label="Enter block"]; - 58 [label="Access variable R|/z|"]; - 59 [label="Function call: R|/z|.R|/A.foo|()"]; - 60 [label="Exit block"]; - } - 61 [label="Exit when branch result"]; - 62 [label="Exit when"]; - } - 63 [label="Access variable R|/y|"]; - 64 [label="Assignmenet: R|/z|"]; - subgraph cluster_17 { - color=blue - 65 [label="Enter when"]; - subgraph cluster_18 { - color=blue - 66 [label="Enter when branch condition "]; - 67 [label="Access variable R|/y|"]; - 68 [label="Type operator: y is B"]; - 69 [label="Exit when branch condition"]; - } - 70 [label="Synthetic else branch"]; - 71 [label="Enter when branch result"]; - subgraph cluster_19 { - color=blue - 72 [label="Enter block"]; - 73 [label="Access variable R|/z|"]; - 74 [label="Function call: R|/z|.#()"]; - 75 [label="Exit block"]; - } - 76 [label="Exit when branch result"]; - 77 [label="Exit when"]; - } - 78 [label="Exit block"]; - } - 79 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 45 -> {46}; 46 -> {47}; 47 -> {48}; 48 -> {49}; - 49 -> {50}; - 50 -> {51}; + 49 -> {51 50}; + 50 -> {57}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {56 55}; - 55 -> {62}; + 54 -> {55}; + 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; @@ -212,67 +197,62 @@ digraph boundSmartcasts_kt { 61 -> {62}; 62 -> {63}; 63 -> {64}; - 64 -> {65}; - 65 -> {66}; + 64 -> {66 65}; + 65 -> {72}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {71 70}; - 70 -> {77}; + 69 -> {70}; + 70 -> {71}; 71 -> {72}; 72 -> {73}; - 73 -> {74}; + + subgraph cluster_17 { + color=red + 74 [label="Enter function test_4" style="filled" fillcolor=red]; + 75 [label="Const: Int(1)"]; + 76 [label="Variable declaration: lvar x: R|kotlin/Any|"]; + 77 [label="Access variable R|/x|"]; + 78 [label="Type operator: x as Int"]; + 79 [label="Access variable R|/x|"]; + 80 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 81 [label="Access variable R|/y|"]; + 82 [label="Assignmenet: R|/x|"]; + 83 [label="Access variable R|/x|"]; + 84 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + subgraph cluster_18 { + color=blue + 85 [label="Enter when"]; + subgraph cluster_19 { + color=blue + 86 [label="Enter when branch condition "]; + 87 [label="Access variable R|/y|"]; + 88 [label="Type operator: y is A"]; + 89 [label="Exit when branch condition"]; + } + 90 [label="Synthetic else branch"]; + 91 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 92 [label="Enter block"]; + 93 [label="Access variable R|/x|"]; + 94 [label="Function call: R|/x|.#()"]; + 95 [label="Access variable R|/y|"]; + 96 [label="Function call: R|/y|.R|/A.foo|()"]; + 97 [label="Exit block"]; + } + 98 [label="Exit when branch result"]; + 99 [label="Exit when"]; + } + 100 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; - - subgraph cluster_20 { - color=red - 80 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_21 { - color=blue - 81 [label="Enter block"]; - 82 [label="Const: Int(1)"]; - 83 [label="Variable declaration: lvar x: R|kotlin/Any|"]; - 84 [label="Access variable R|/x|"]; - 85 [label="Type operator: x as Int"]; - 86 [label="Access variable R|/x|"]; - 87 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 88 [label="Access variable R|/y|"]; - 89 [label="Assignmenet: R|/x|"]; - 90 [label="Access variable R|/x|"]; - 91 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - subgraph cluster_22 { - color=blue - 92 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 93 [label="Enter when branch condition "]; - 94 [label="Access variable R|/y|"]; - 95 [label="Type operator: y is A"]; - 96 [label="Exit when branch condition"]; - } - 97 [label="Synthetic else branch"]; - 98 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 99 [label="Enter block"]; - 100 [label="Access variable R|/x|"]; - 101 [label="Function call: R|/x|.#()"]; - 102 [label="Access variable R|/y|"]; - 103 [label="Function call: R|/y|.R|/A.foo|()"]; - 104 [label="Exit block"]; - } - 105 [label="Exit when branch result"]; - 106 [label="Exit when"]; - } - 107 [label="Exit block"]; - } - 108 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 79 -> {80}; 80 -> {81}; 81 -> {82}; 82 -> {83}; @@ -282,24 +262,16 @@ digraph boundSmartcasts_kt { 86 -> {87}; 87 -> {88}; 88 -> {89}; - 89 -> {90}; - 90 -> {91}; + 89 -> {91 90}; + 90 -> {99}; 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; 95 -> {96}; - 96 -> {98 97}; - 97 -> {106}; + 96 -> {97}; + 97 -> {98}; 98 -> {99}; 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot index f08ce150454..09795bc450b 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot @@ -6,16 +6,11 @@ digraph casts_kt { subgraph cluster_0 { color=red 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Access variable R|/x|"]; - 3 [label="Type operator: x as String"]; - 4 [label="Access variable R|/x|"]; - 5 [label="Access variable R|kotlin/String.length|"]; - 6 [label="Exit block"]; - } - 7 [label="Exit function test_1" style="filled" fillcolor=red]; + 1 [label="Access variable R|/x|"]; + 2 [label="Type operator: x as String"]; + 3 [label="Access variable R|/x|"]; + 4 [label="Access variable R|kotlin/String.length|"]; + 5 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -23,185 +18,175 @@ digraph casts_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - subgraph cluster_2 { + subgraph cluster_1 { color=red - 8 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_3 { + 6 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_2 { color=blue - 9 [label="Enter block"]; + 7 [label="Enter when"]; + subgraph cluster_3 { + color=blue + 8 [label="Enter when branch condition "]; + 9 [label="Access variable R|/x|"]; + 10 [label="Type operator: x as Boolean"]; + 11 [label="Exit when branch condition"]; + } + 12 [label="Synthetic else branch"]; + 13 [label="Enter when branch result"]; subgraph cluster_4 { color=blue - 10 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 11 [label="Enter when branch condition "]; - 12 [label="Access variable R|/x|"]; - 13 [label="Type operator: x as Boolean"]; - 14 [label="Exit when branch condition"]; - } - 15 [label="Synthetic else branch"]; - 16 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 17 [label="Enter block"]; - 18 [label="Access variable R|/x|"]; - 19 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; - 20 [label="Exit block"]; - } - 21 [label="Exit when branch result"]; - 22 [label="Exit when"]; + 14 [label="Enter block"]; + 15 [label="Access variable R|/x|"]; + 16 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 17 [label="Exit block"]; } - 23 [label="Access variable R|/x|"]; - 24 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; - 25 [label="Exit block"]; + 18 [label="Exit when branch result"]; + 19 [label="Exit when"]; } - 26 [label="Exit function test_2" style="filled" fillcolor=red]; + 20 [label="Access variable R|/x|"]; + 21 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 22 [label="Exit function test_2" style="filled" fillcolor=red]; } + 6 -> {7}; + 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; - 12 -> {13}; + 11 -> {13 12}; + 12 -> {19}; 13 -> {14}; - 14 -> {16 15}; - 15 -> {22}; + 14 -> {15}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {23}; + + subgraph cluster_5 { + color=red + 23 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 24 [label="Enter when"]; + subgraph cluster_7 { + color=blue + 25 [label="Enter when branch condition "]; + subgraph cluster_8 { + color=blue + 26 [label="Enter &&"]; + 27 [label="Access variable R|/b|"]; + 28 [label="Exit left part of &&"]; + 29 [label="Enter right part of &&"]; + 30 [label="Access variable R|/x|"]; + 31 [label="Type operator: x as Boolean"]; + 32 [label="Exit &&"]; + } + 33 [label="Exit when branch condition"]; + } + 34 [label="Synthetic else branch"]; + 35 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 36 [label="Enter block"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 39 [label="Exit block"]; + } + 40 [label="Exit when branch result"]; + 41 [label="Exit when"]; + } + 42 [label="Access variable R|/x|"]; + 43 [label="Function call: R|/x|.#()"]; + subgraph cluster_10 { + color=blue + 44 [label="Enter when"]; + subgraph cluster_11 { + color=blue + 45 [label="Enter when branch condition "]; + subgraph cluster_12 { + color=blue + 46 [label="Enter &&"]; + 47 [label="Access variable R|/b|"]; + 48 [label="Exit left part of &&"]; + 49 [label="Enter right part of &&"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Type operator: x as Boolean"]; + 52 [label="Const: Boolean(true)"]; + 53 [label="Operator =="]; + 54 [label="Exit &&"]; + } + 55 [label="Exit when branch condition"]; + } + 56 [label="Synthetic else branch"]; + 57 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 58 [label="Enter block"]; + 59 [label="Access variable R|/x|"]; + 60 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 61 [label="Exit block"]; + } + 62 [label="Exit when branch result"]; + 63 [label="Exit when"]; + } + 64 [label="Access variable R|/x|"]; + 65 [label="Function call: R|/x|.#()"]; + subgraph cluster_14 { + color=blue + 66 [label="Enter when"]; + subgraph cluster_15 { + color=blue + 67 [label="Enter when branch condition "]; + subgraph cluster_16 { + color=blue + 68 [label="Enter ||"]; + 69 [label="Access variable R|/b|"]; + 70 [label="Exit left part of ||"]; + 71 [label="Enter right part of ||"]; + 72 [label="Access variable R|/x|"]; + 73 [label="Type operator: x as Boolean"]; + 74 [label="Exit ||"]; + } + 75 [label="Exit when branch condition"]; + } + 76 [label="Synthetic else branch"]; + 77 [label="Enter when branch result"]; + subgraph cluster_17 { + color=blue + 78 [label="Enter block"]; + 79 [label="Access variable R|/x|"]; + 80 [label="Function call: R|/x|.#()"]; + 81 [label="Exit block"]; + } + 82 [label="Exit when branch result"]; + 83 [label="Exit when"]; + } + 84 [label="Access variable R|/x|"]; + 85 [label="Function call: R|/x|.#()"]; + 86 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 23 -> {24}; 24 -> {25}; 25 -> {26}; - - subgraph cluster_7 { - color=red - 27 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_8 { - color=blue - 28 [label="Enter block"]; - subgraph cluster_9 { - color=blue - 29 [label="Enter when"]; - subgraph cluster_10 { - color=blue - 30 [label="Enter when branch condition "]; - subgraph cluster_11 { - color=blue - 31 [label="Enter &&"]; - 32 [label="Access variable R|/b|"]; - 33 [label="Exit left part of &&"]; - 34 [label="Enter right part of &&"]; - 35 [label="Access variable R|/x|"]; - 36 [label="Type operator: x as Boolean"]; - 37 [label="Exit &&"]; - } - 38 [label="Exit when branch condition"]; - } - 39 [label="Synthetic else branch"]; - 40 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 41 [label="Enter block"]; - 42 [label="Access variable R|/x|"]; - 43 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; - 44 [label="Exit block"]; - } - 45 [label="Exit when branch result"]; - 46 [label="Exit when"]; - } - 47 [label="Access variable R|/x|"]; - 48 [label="Function call: R|/x|.#()"]; - subgraph cluster_13 { - color=blue - 49 [label="Enter when"]; - subgraph cluster_14 { - color=blue - 50 [label="Enter when branch condition "]; - subgraph cluster_15 { - color=blue - 51 [label="Enter &&"]; - 52 [label="Access variable R|/b|"]; - 53 [label="Exit left part of &&"]; - 54 [label="Enter right part of &&"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Type operator: x as Boolean"]; - 57 [label="Const: Boolean(true)"]; - 58 [label="Operator =="]; - 59 [label="Exit &&"]; - } - 60 [label="Exit when branch condition"]; - } - 61 [label="Synthetic else branch"]; - 62 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 63 [label="Enter block"]; - 64 [label="Access variable R|/x|"]; - 65 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; - 66 [label="Exit block"]; - } - 67 [label="Exit when branch result"]; - 68 [label="Exit when"]; - } - 69 [label="Access variable R|/x|"]; - 70 [label="Function call: R|/x|.#()"]; - subgraph cluster_17 { - color=blue - 71 [label="Enter when"]; - subgraph cluster_18 { - color=blue - 72 [label="Enter when branch condition "]; - subgraph cluster_19 { - color=blue - 73 [label="Enter ||"]; - 74 [label="Access variable R|/b|"]; - 75 [label="Exit left part of ||"]; - 76 [label="Enter right part of ||"]; - 77 [label="Access variable R|/x|"]; - 78 [label="Type operator: x as Boolean"]; - 79 [label="Exit ||"]; - } - 80 [label="Exit when branch condition"]; - } - 81 [label="Synthetic else branch"]; - 82 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 83 [label="Enter block"]; - 84 [label="Access variable R|/x|"]; - 85 [label="Function call: R|/x|.#()"]; - 86 [label="Exit block"]; - } - 87 [label="Exit when branch result"]; - 88 [label="Exit when"]; - } - 89 [label="Access variable R|/x|"]; - 90 [label="Function call: R|/x|.#()"]; - 91 [label="Exit block"]; - } - 92 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 26 -> {27}; 27 -> {28}; - 28 -> {29}; + 28 -> {32 29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; - 33 -> {37 34}; - 34 -> {35}; + 33 -> {35 34}; + 34 -> {41}; 35 -> {36}; 36 -> {37}; 37 -> {38}; - 38 -> {40 39}; - 39 -> {46}; + 38 -> {39}; + 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; @@ -210,20 +195,20 @@ digraph casts_kt { 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49}; + 48 -> {54 49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; - 53 -> {59 54}; + 53 -> {54}; 54 -> {55}; - 55 -> {56}; - 56 -> {57}; + 55 -> {57 56}; + 56 -> {63}; 57 -> {58}; 58 -> {59}; 59 -> {60}; - 60 -> {62 61}; - 61 -> {68}; + 60 -> {61}; + 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; @@ -232,135 +217,130 @@ digraph casts_kt { 67 -> {68}; 68 -> {69}; 69 -> {70}; - 70 -> {71}; + 70 -> {74 71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; 74 -> {75}; - 75 -> {79 76}; - 76 -> {77}; + 75 -> {77 76}; + 76 -> {83}; 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {82 81}; - 81 -> {88}; + 80 -> {81}; + 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; - 86 -> {87}; + + subgraph cluster_18 { + color=red + 87 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_19 { + color=blue + 88 [label="Enter when"]; + subgraph cluster_20 { + color=blue + 89 [label="Enter when branch condition "]; + 90 [label="Access variable R|/b|"]; + 91 [label="Type operator: b as? Boolean"]; + 92 [label="Const: Null(null)"]; + 93 [label="Operator !="]; + 94 [label="Exit when branch condition"]; + } + subgraph cluster_21 { + color=blue + 95 [label="Enter when branch condition else"]; + 96 [label="Exit when branch condition"]; + } + 97 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 98 [label="Enter block"]; + 99 [label="Access variable R|/b|"]; + 100 [label="Function call: R|/b|.#()"]; + 101 [label="Exit block"]; + } + 102 [label="Exit when branch result"]; + 103 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 104 [label="Enter block"]; + 105 [label="Access variable R|/b|"]; + 106 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 107 [label="Exit block"]; + } + 108 [label="Exit when branch result"]; + 109 [label="Exit when"]; + } + 110 [label="Access variable R|/b|"]; + 111 [label="Function call: R|/b|.#()"]; + subgraph cluster_24 { + color=blue + 112 [label="Enter when"]; + subgraph cluster_25 { + color=blue + 113 [label="Enter when branch condition "]; + 114 [label="Access variable R|/b|"]; + 115 [label="Type operator: b as? Boolean"]; + 116 [label="Const: Null(null)"]; + 117 [label="Operator =="]; + 118 [label="Exit when branch condition"]; + } + subgraph cluster_26 { + color=blue + 119 [label="Enter when branch condition else"]; + 120 [label="Exit when branch condition"]; + } + 121 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 122 [label="Enter block"]; + 123 [label="Access variable R|/b|"]; + 124 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 125 [label="Exit block"]; + } + 126 [label="Exit when branch result"]; + 127 [label="Enter when branch result"]; + subgraph cluster_28 { + color=blue + 128 [label="Enter block"]; + 129 [label="Access variable R|/b|"]; + 130 [label="Function call: R|/b|.#()"]; + 131 [label="Exit block"]; + } + 132 [label="Exit when branch result"]; + 133 [label="Exit when"]; + } + 134 [label="Access variable R|/b|"]; + 135 [label="Function call: R|/b|.#()"]; + 136 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 87 -> {88}; 88 -> {89}; 89 -> {90}; 90 -> {91}; 91 -> {92}; - - subgraph cluster_21 { - color=red - 93 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 94 [label="Enter block"]; - subgraph cluster_23 { - color=blue - 95 [label="Enter when"]; - subgraph cluster_24 { - color=blue - 96 [label="Enter when branch condition "]; - 97 [label="Access variable R|/b|"]; - 98 [label="Type operator: b as? Boolean"]; - 99 [label="Const: Null(null)"]; - 100 [label="Operator !="]; - 101 [label="Exit when branch condition"]; - } - subgraph cluster_25 { - color=blue - 102 [label="Enter when branch condition else"]; - 103 [label="Exit when branch condition"]; - } - 104 [label="Enter when branch result"]; - subgraph cluster_26 { - color=blue - 105 [label="Enter block"]; - 106 [label="Access variable R|/b|"]; - 107 [label="Function call: R|/b|.#()"]; - 108 [label="Exit block"]; - } - 109 [label="Exit when branch result"]; - 110 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 111 [label="Enter block"]; - 112 [label="Access variable R|/b|"]; - 113 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 114 [label="Exit block"]; - } - 115 [label="Exit when branch result"]; - 116 [label="Exit when"]; - } - 117 [label="Access variable R|/b|"]; - 118 [label="Function call: R|/b|.#()"]; - subgraph cluster_28 { - color=blue - 119 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 120 [label="Enter when branch condition "]; - 121 [label="Access variable R|/b|"]; - 122 [label="Type operator: b as? Boolean"]; - 123 [label="Const: Null(null)"]; - 124 [label="Operator =="]; - 125 [label="Exit when branch condition"]; - } - subgraph cluster_30 { - color=blue - 126 [label="Enter when branch condition else"]; - 127 [label="Exit when branch condition"]; - } - 128 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 129 [label="Enter block"]; - 130 [label="Access variable R|/b|"]; - 131 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 132 [label="Exit block"]; - } - 133 [label="Exit when branch result"]; - 134 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 135 [label="Enter block"]; - 136 [label="Access variable R|/b|"]; - 137 [label="Function call: R|/b|.#()"]; - 138 [label="Exit block"]; - } - 139 [label="Exit when branch result"]; - 140 [label="Exit when"]; - } - 141 [label="Access variable R|/b|"]; - 142 [label="Function call: R|/b|.#()"]; - 143 [label="Exit block"]; - } - 144 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 92 -> {93}; 93 -> {94}; - 94 -> {95}; + 94 -> {103 95}; 95 -> {96}; 96 -> {97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; 100 -> {101}; - 101 -> {110 102}; - 102 -> {103}; + 101 -> {102}; + 102 -> {109}; 103 -> {104}; 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; 108 -> {109}; - 109 -> {116}; + 109 -> {110}; 110 -> {111}; 111 -> {112}; 112 -> {113}; @@ -369,31 +349,23 @@ digraph casts_kt { 115 -> {116}; 116 -> {117}; 117 -> {118}; - 118 -> {119}; + 118 -> {127 119}; 119 -> {120}; 120 -> {121}; 121 -> {122}; 122 -> {123}; 123 -> {124}; 124 -> {125}; - 125 -> {134 126}; - 126 -> {127}; + 125 -> {126}; + 126 -> {133}; 127 -> {128}; 128 -> {129}; 129 -> {130}; 130 -> {131}; 131 -> {132}; 132 -> {133}; - 133 -> {140}; + 133 -> {134}; 134 -> {135}; 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {141}; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot b/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot index 25577dd874c..63c34a496ea 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot @@ -14,47 +14,42 @@ digraph dataFlowInfoFromWhileCondition_kt { subgraph cluster_1 { color=red 2 [label="Enter function test" style="filled" fillcolor=red]; + 3 [label="Const: Null(null)"]; + 4 [label="Variable declaration: lvar a: R|A?|"]; subgraph cluster_2 { color=blue - 3 [label="Enter block"]; - 4 [label="Const: Null(null)"]; - 5 [label="Variable declaration: lvar a: R|A?|"]; + 5 [label="Enter while loop"]; subgraph cluster_3 { color=blue - 6 [label="Enter while loop"]; + 6 [label="Enter loop condition"]; subgraph cluster_4 { color=blue - 7 [label="Enter loop condition"]; - subgraph cluster_5 { - color=blue - 8 [label="Enter ||"]; - 9 [label="Access variable R|/a|"]; - 10 [label="Type operator: a is B"]; - 11 [label="Exit left part of ||"]; - 12 [label="Enter right part of ||"]; - 13 [label="Access variable R|/a|"]; - 14 [label="Type operator: a is C"]; - 15 [label="Exit ||"]; - } - 16 [label="Exit loop condition"]; + 7 [label="Enter ||"]; + 8 [label="Access variable R|/a|"]; + 9 [label="Type operator: a is B"]; + 10 [label="Exit left part of ||"]; + 11 [label="Enter right part of ||"]; + 12 [label="Access variable R|/a|"]; + 13 [label="Type operator: a is C"]; + 14 [label="Exit ||"]; } + 15 [label="Exit loop condition"]; + } + subgraph cluster_5 { + color=blue + 16 [label="Enter loop block"]; subgraph cluster_6 { color=blue - 17 [label="Enter loop block"]; - subgraph cluster_7 { - color=blue - 18 [label="Enter block"]; - 19 [label="Access variable R|/a|"]; - 20 [label="Function call: R|/a|.R|/A.foo|()"]; - 21 [label="Exit block"]; - } - 22 [label="Exit loop block"]; + 17 [label="Enter block"]; + 18 [label="Access variable R|/a|"]; + 19 [label="Function call: R|/a|.R|/A.foo|()"]; + 20 [label="Exit block"]; } - 23 [label="Exit whileloop"]; + 21 [label="Exit loop block"]; } - 24 [label="Exit block"]; + 22 [label="Exit whileloop"]; } - 25 [label="Exit function test" style="filled" fillcolor=red]; + 23 [label="Exit function test" style="filled" fillcolor=red]; } 2 -> {3}; @@ -65,20 +60,18 @@ digraph dataFlowInfoFromWhileCondition_kt { 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; - 11 -> {15 12}; + 10 -> {14 11}; + 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; - 15 -> {16}; - 16 -> {23 17}; + 15 -> {22 16}; + 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; - 21 -> {22}; - 22 -> {7}; - 23 -> {24}; - 24 -> {25}; + 21 -> {6}; + 22 -> {23}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot b/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot index fbb26a71c22..a5c55e230b1 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot @@ -14,83 +14,73 @@ digraph delayedAssignment_kt { subgraph cluster_1 { color=red 2 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 3 [label="Enter block"]; - 4 [label="Exit block"]; - } - 5 [label="Exit function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 6 [label="Enter function test" style="filled" fillcolor=red]; - subgraph cluster_4 { + 4 [label="Enter function test" style="filled" fillcolor=red]; + 5 [label="Variable declaration: lval a: R|A?|"]; + subgraph cluster_3 { color=blue - 7 [label="Enter block"]; - 8 [label="Variable declaration: lval a: R|A?|"]; + 6 [label="Enter when"]; + subgraph cluster_4 { + color=blue + 7 [label="Enter when branch condition "]; + 8 [label="Access variable R|/b|"]; + 9 [label="Exit when branch condition"]; + } subgraph cluster_5 { color=blue - 9 [label="Enter when"]; - subgraph cluster_6 { - color=blue - 10 [label="Enter when branch condition "]; - 11 [label="Access variable R|/b|"]; - 12 [label="Exit when branch condition"]; - } - subgraph cluster_7 { - color=blue - 13 [label="Enter when branch condition else"]; - 14 [label="Exit when branch condition"]; - } - 15 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 16 [label="Enter block"]; - 17 [label="Const: Null(null)"]; - 18 [label="Assignmenet: R|/a|"]; - 19 [label="Exit block"]; - } - 20 [label="Exit when branch result"]; - 21 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 22 [label="Enter block"]; - 23 [label="Function call: R|/A.A|()"]; - 24 [label="Assignmenet: R|/a|"]; - 25 [label="Access variable R|/a|"]; - 26 [label="Function call: R|/a|.R|/A.foo|()"]; - 27 [label="Exit block"]; - } - 28 [label="Exit when branch result"]; - 29 [label="Exit when"]; + 10 [label="Enter when branch condition else"]; + 11 [label="Exit when branch condition"]; } - 30 [label="Access variable R|/a|"]; - 31 [label="Function call: R|/a|.#()"]; - 32 [label="Exit block"]; + 12 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 13 [label="Enter block"]; + 14 [label="Const: Null(null)"]; + 15 [label="Assignmenet: R|/a|"]; + 16 [label="Exit block"]; + } + 17 [label="Exit when branch result"]; + 18 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 19 [label="Enter block"]; + 20 [label="Function call: R|/A.A|()"]; + 21 [label="Assignmenet: R|/a|"]; + 22 [label="Access variable R|/a|"]; + 23 [label="Function call: R|/a|.R|/A.foo|()"]; + 24 [label="Exit block"]; + } + 25 [label="Exit when branch result"]; + 26 [label="Exit when"]; } - 33 [label="Exit function test" style="filled" fillcolor=red]; + 27 [label="Access variable R|/a|"]; + 28 [label="Function call: R|/a|.#()"]; + 29 [label="Exit function test" style="filled" fillcolor=red]; } + 4 -> {5}; + 5 -> {6}; 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; + 9 -> {18 10}; 10 -> {11}; 11 -> {12}; - 12 -> {21 13}; + 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; - 17 -> {18}; + 17 -> {26}; 18 -> {19}; 19 -> {20}; - 20 -> {29}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; @@ -99,9 +89,5 @@ digraph delayedAssignment_kt { 26 -> {27}; 27 -> {28}; 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot b/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot index d8c2c8e4b70..8b02484031f 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot @@ -32,199 +32,189 @@ digraph elvis_kt { 6 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 7 [label="Enter block"]; + 7 [label="Enter when"]; subgraph cluster_5 { color=blue - 8 [label="Enter when"]; + 8 [label="Enter when branch condition "]; subgraph cluster_6 { color=blue - 9 [label="Enter when branch condition "]; + 9 [label="Enter when"]; + 10 [label="Access variable R|/x|"]; + 11 [label="Enter safe call"]; + 12 [label="Access variable R|/A.b|"]; + 13 [label="Exit safe call"]; + 14 [label="Variable declaration: lval : R|kotlin/Boolean?|"]; subgraph cluster_7 { color=blue - 10 [label="Enter when"]; - 11 [label="Access variable R|/x|"]; - 12 [label="Enter safe call"]; - 13 [label="Access variable R|/A.b|"]; - 14 [label="Exit safe call"]; - 15 [label="Variable declaration: lval : R|kotlin/Boolean?|"]; - subgraph cluster_8 { - color=blue - 16 [label="Enter when branch condition "]; - 17 [label="Const: Null(null)"]; - 18 [label="Operator =="]; - 19 [label="Exit when branch condition"]; - } - subgraph cluster_9 { - color=blue - 20 [label="Enter when branch condition else"]; - 21 [label="Exit when branch condition"]; - } - 22 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 23 [label="Enter block"]; - 24 [label="Access variable R|/|"]; - 25 [label="Exit block"]; - } - 26 [label="Exit when branch result"]; - 27 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 28 [label="Enter block"]; - 29 [label="Jump: ^test_1 Unit"]; - 30 [label="Stub" style="filled" fillcolor=gray]; - 31 [label="Exit block" style="filled" fillcolor=gray]; - } - 32 [label="Exit when branch result" style="filled" fillcolor=gray]; - 33 [label="Exit when"]; + 15 [label="Enter when branch condition "]; + 16 [label="Const: Null(null)"]; + 17 [label="Operator =="]; + 18 [label="Exit when branch condition"]; } - 34 [label="Exit when branch condition"]; + subgraph cluster_8 { + color=blue + 19 [label="Enter when branch condition else"]; + 20 [label="Exit when branch condition"]; + } + 21 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 22 [label="Enter block"]; + 23 [label="Access variable R|/|"]; + 24 [label="Exit block"]; + } + 25 [label="Exit when branch result"]; + 26 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 27 [label="Enter block"]; + 28 [label="Jump: ^test_1 Unit"]; + 29 [label="Stub" style="filled" fillcolor=gray]; + 30 [label="Exit block" style="filled" fillcolor=gray]; + } + 31 [label="Exit when branch result" style="filled" fillcolor=gray]; + 32 [label="Exit when"]; } - 35 [label="Synthetic else branch"]; - 36 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 37 [label="Enter block"]; - 38 [label="Access variable R|/x|"]; - 39 [label="Function call: R|/x|.R|/A.foo|()"]; - 40 [label="Exit block"]; - } - 41 [label="Exit when branch result"]; - 42 [label="Exit when"]; + 33 [label="Exit when branch condition"]; } - 43 [label="Exit block"]; + 34 [label="Synthetic else branch"]; + 35 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 36 [label="Enter block"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Function call: R|/x|.R|/A.foo|()"]; + 39 [label="Exit block"]; + } + 40 [label="Exit when branch result"]; + 41 [label="Exit when"]; } - 44 [label="Exit function test_1" style="filled" fillcolor=red]; + 42 [label="Exit function test_1" style="filled" fillcolor=red]; } 6 -> {7}; 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; - 11 -> {12 14}; + 10 -> {11 13}; + 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {18}; - 18 -> {19}; - 19 -> {27 20}; + 18 -> {26 19}; + 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {26}; - 26 -> {33}; + 25 -> {32}; + 26 -> {27}; 27 -> {28}; - 28 -> {29}; - 29 -> {44}; + 28 -> {42}; + 28 -> {29} [style=dotted]; 29 -> {30} [style=dotted]; 30 -> {31} [style=dotted]; 31 -> {32} [style=dotted]; - 32 -> {33} [style=dotted]; - 33 -> {34}; - 34 -> {36 35}; - 35 -> {42}; + 32 -> {33}; + 33 -> {35 34}; + 34 -> {41}; + 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - subgraph cluster_13 { + subgraph cluster_12 { color=red - 45 [label="Enter function test2" style="filled" fillcolor=red]; - subgraph cluster_14 { + 43 [label="Enter function test2" style="filled" fillcolor=red]; + subgraph cluster_13 { color=blue - 46 [label="Enter block"]; + 44 [label="Enter when"]; + subgraph cluster_14 { + color=blue + 45 [label="Enter when branch condition "]; + 46 [label="Access variable R|/b|"]; + 47 [label="Type operator: b !is String"]; + 48 [label="Exit when branch condition"]; + } + 49 [label="Synthetic else branch"]; + 50 [label="Enter when branch result"]; subgraph cluster_15 { color=blue - 47 [label="Enter when"]; - subgraph cluster_16 { - color=blue - 48 [label="Enter when branch condition "]; - 49 [label="Access variable R|/b|"]; - 50 [label="Type operator: b !is String"]; - 51 [label="Exit when branch condition"]; - } - 52 [label="Synthetic else branch"]; - 53 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 54 [label="Enter block"]; - 55 [label="Const: String()"]; - 56 [label="Jump: ^test2 String()"]; - 57 [label="Stub" style="filled" fillcolor=gray]; - 58 [label="Exit block" style="filled" fillcolor=gray]; - } - 59 [label="Exit when branch result" style="filled" fillcolor=gray]; - 60 [label="Exit when"]; + 51 [label="Enter block"]; + 52 [label="Const: String()"]; + 53 [label="Jump: ^test2 String()"]; + 54 [label="Stub" style="filled" fillcolor=gray]; + 55 [label="Exit block" style="filled" fillcolor=gray]; } + 56 [label="Exit when branch result" style="filled" fillcolor=gray]; + 57 [label="Exit when"]; + } + subgraph cluster_16 { + color=blue + 58 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 59 [label="Enter when branch condition "]; + 60 [label="Access variable R|/a|"]; + 61 [label="Type operator: a !is String?"]; + 62 [label="Exit when branch condition"]; + } + 63 [label="Synthetic else branch"]; + 64 [label="Enter when branch result"]; subgraph cluster_18 { color=blue - 61 [label="Enter when"]; - subgraph cluster_19 { - color=blue - 62 [label="Enter when branch condition "]; - 63 [label="Access variable R|/a|"]; - 64 [label="Type operator: a !is String?"]; - 65 [label="Exit when branch condition"]; - } - 66 [label="Synthetic else branch"]; - 67 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 68 [label="Enter block"]; - 69 [label="Const: String()"]; - 70 [label="Jump: ^test2 String()"]; - 71 [label="Stub" style="filled" fillcolor=gray]; - 72 [label="Exit block" style="filled" fillcolor=gray]; - } - 73 [label="Exit when branch result" style="filled" fillcolor=gray]; - 74 [label="Exit when"]; + 65 [label="Enter block"]; + 66 [label="Const: String()"]; + 67 [label="Jump: ^test2 String()"]; + 68 [label="Stub" style="filled" fillcolor=gray]; + 69 [label="Exit block" style="filled" fillcolor=gray]; + } + 70 [label="Exit when branch result" style="filled" fillcolor=gray]; + 71 [label="Exit when"]; + } + subgraph cluster_19 { + color=blue + 72 [label="Enter when"]; + 73 [label="Access variable R|/a|"]; + 74 [label="Variable declaration: lval : R|kotlin/String?|"]; + subgraph cluster_20 { + color=blue + 75 [label="Enter when branch condition "]; + 76 [label="Const: Null(null)"]; + 77 [label="Operator =="]; + 78 [label="Exit when branch condition"]; } subgraph cluster_21 { color=blue - 75 [label="Enter when"]; - 76 [label="Access variable R|/a|"]; - 77 [label="Variable declaration: lval : R|kotlin/String?|"]; - subgraph cluster_22 { - color=blue - 78 [label="Enter when branch condition "]; - 79 [label="Const: Null(null)"]; - 80 [label="Operator =="]; - 81 [label="Exit when branch condition"]; - } - subgraph cluster_23 { - color=blue - 82 [label="Enter when branch condition else"]; - 83 [label="Exit when branch condition"]; - } - 84 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 85 [label="Enter block"]; - 86 [label="Access variable R|/|"]; - 87 [label="Exit block"]; - } - 88 [label="Exit when branch result"]; - 89 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 90 [label="Enter block"]; - 91 [label="Access variable R|/b|"]; - 92 [label="Exit block"]; - } - 93 [label="Exit when branch result"]; - 94 [label="Exit when"]; + 79 [label="Enter when branch condition else"]; + 80 [label="Exit when branch condition"]; } - 95 [label="Jump: ^test2 when (lval : R|kotlin/String?| = R|/a|) { + 81 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 82 [label="Enter block"]; + 83 [label="Access variable R|/|"]; + 84 [label="Exit block"]; + } + 85 [label="Exit when branch result"]; + 86 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 87 [label="Enter block"]; + 88 [label="Access variable R|/b|"]; + 89 [label="Exit block"]; + } + 90 [label="Exit when branch result"]; + 91 [label="Exit when"]; + } + 92 [label="Jump: ^test2 when (lval : R|kotlin/String?| = R|/a|) { ==($subj$, Null(null)) -> { R|/b| } @@ -233,67 +223,63 @@ digraph elvis_kt { } } "]; - 96 [label="Stub" style="filled" fillcolor=gray]; - 97 [label="Exit block" style="filled" fillcolor=gray]; - } - 98 [label="Exit function test2" style="filled" fillcolor=red]; + 93 [label="Stub" style="filled" fillcolor=gray]; + 94 [label="Exit function test2" style="filled" fillcolor=red]; } + 43 -> {44}; + 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49}; - 49 -> {50}; + 48 -> {50 49}; + 49 -> {57}; 50 -> {51}; - 51 -> {53 52}; - 52 -> {60}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {98}; + 51 -> {52}; + 52 -> {53}; + 53 -> {94}; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; + 55 -> {56} [style=dotted]; 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 58 -> {59} [style=dotted]; - 59 -> {60} [style=dotted]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; 60 -> {61}; 61 -> {62}; - 62 -> {63}; - 63 -> {64}; + 62 -> {64 63}; + 63 -> {71}; 64 -> {65}; - 65 -> {67 66}; - 66 -> {74}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {98}; + 65 -> {66}; + 66 -> {67}; + 67 -> {94}; + 67 -> {68} [style=dotted]; + 68 -> {69} [style=dotted]; + 69 -> {70} [style=dotted]; 70 -> {71} [style=dotted]; - 71 -> {72} [style=dotted]; - 72 -> {73} [style=dotted]; - 73 -> {74} [style=dotted]; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; - 78 -> {79}; + 78 -> {86 79}; 79 -> {80}; 80 -> {81}; - 81 -> {89 82}; + 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; - 85 -> {86}; + 85 -> {91}; 86 -> {87}; 87 -> {88}; - 88 -> {94}; + 88 -> {89}; 89 -> {90}; 90 -> {91}; 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {98}; - 95 -> {96} [style=dotted]; - 96 -> {97} [style=dotted]; - 97 -> {98} [style=dotted]; + 92 -> {94}; + 92 -> {93} [style=dotted]; + 93 -> {94} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot b/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot index 3d1b4ffa4b4..19219fef3fe 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot @@ -16,57 +16,52 @@ digraph endlessLoops_kt { 2 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_2 { color=blue - 3 [label="Enter block"]; + 3 [label="Enter while loop"]; subgraph cluster_3 { color=blue - 4 [label="Enter while loop"]; - subgraph cluster_4 { - color=blue - 5 [label="Enter loop condition"]; - 6 [label="Const: Boolean(true)"]; - 7 [label="Exit loop condition"]; - } + 4 [label="Enter loop condition"]; + 5 [label="Const: Boolean(true)"]; + 6 [label="Exit loop condition"]; + } + subgraph cluster_4 { + color=blue + 7 [label="Enter loop block"]; subgraph cluster_5 { color=blue - 8 [label="Enter loop block"]; + 8 [label="Enter block"]; + 9 [label="Access variable R|/x|"]; + 10 [label="Type operator: x as A"]; subgraph cluster_6 { color=blue - 9 [label="Enter block"]; - 10 [label="Access variable R|/x|"]; - 11 [label="Type operator: x as A"]; + 11 [label="Enter when"]; subgraph cluster_7 { color=blue - 12 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 13 [label="Enter when branch condition "]; - 14 [label="Access variable R|/b|"]; - 15 [label="Exit when branch condition"]; - } - 16 [label="Synthetic else branch"]; - 17 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 18 [label="Enter block"]; - 19 [label="Jump: break@@@[Boolean(true)] "]; - 20 [label="Stub" style="filled" fillcolor=gray]; - 21 [label="Exit block" style="filled" fillcolor=gray]; - } - 22 [label="Exit when branch result" style="filled" fillcolor=gray]; - 23 [label="Exit when"]; + 12 [label="Enter when branch condition "]; + 13 [label="Access variable R|/b|"]; + 14 [label="Exit when branch condition"]; } - 24 [label="Exit block"]; + 15 [label="Synthetic else branch"]; + 16 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 17 [label="Enter block"]; + 18 [label="Jump: break@@@[Boolean(true)] "]; + 19 [label="Stub" style="filled" fillcolor=gray]; + 20 [label="Exit block" style="filled" fillcolor=gray]; + } + 21 [label="Exit when branch result" style="filled" fillcolor=gray]; + 22 [label="Exit when"]; } - 25 [label="Exit loop block"]; + 23 [label="Exit block"]; } - 26 [label="Stub" style="filled" fillcolor=gray]; - 27 [label="Exit whileloop"]; + 24 [label="Exit loop block"]; } - 28 [label="Access variable R|/x|"]; - 29 [label="Function call: R|/x|.R|/A.foo|()"]; - 30 [label="Exit block"]; + 25 [label="Stub" style="filled" fillcolor=gray]; + 26 [label="Exit whileloop"]; } - 31 [label="Exit function test_1" style="filled" fillcolor=red]; + 27 [label="Access variable R|/x|"]; + 28 [label="Function call: R|/x|.R|/A.foo|()"]; + 29 [label="Exit function test_1" style="filled" fillcolor=red]; } 2 -> {3}; @@ -74,576 +69,532 @@ digraph endlessLoops_kt { 4 -> {5}; 5 -> {6}; 6 -> {7}; + 6 -> {25} [style=dotted]; 7 -> {8}; - 7 -> {26} [style=dotted]; 8 -> {9}; 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {17 16}; - 16 -> {23}; + 14 -> {16 15}; + 15 -> {22}; + 16 -> {17}; 17 -> {18}; - 18 -> {19}; - 19 -> {27}; + 18 -> {26}; + 18 -> {19} [style=dotted]; 19 -> {20} [style=dotted]; 20 -> {21} [style=dotted]; 21 -> {22} [style=dotted]; - 22 -> {23} [style=dotted]; + 22 -> {23}; 23 -> {24}; - 24 -> {25}; - 25 -> {5}; - 26 -> {27} [style=dotted]; + 24 -> {4}; + 25 -> {26} [style=dotted]; + 26 -> {27}; 27 -> {28}; 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - subgraph cluster_10 { + subgraph cluster_9 { color=red - 32 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_11 { + 30 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { color=blue - 33 [label="Enter block"]; + 31 [label="Enter while loop"]; + subgraph cluster_11 { + color=blue + 32 [label="Enter loop condition"]; + 33 [label="Const: Boolean(true)"]; + 34 [label="Exit loop condition"]; + } subgraph cluster_12 { color=blue - 34 [label="Enter while loop"]; + 35 [label="Enter loop block"]; subgraph cluster_13 { color=blue - 35 [label="Enter loop condition"]; - 36 [label="Const: Boolean(true)"]; - 37 [label="Exit loop condition"]; - } - subgraph cluster_14 { - color=blue - 38 [label="Enter loop block"]; - subgraph cluster_15 { + 36 [label="Enter block"]; + subgraph cluster_14 { color=blue - 39 [label="Enter block"]; + 37 [label="Enter when"]; + subgraph cluster_15 { + color=blue + 38 [label="Enter when branch condition "]; + 39 [label="Access variable R|/b|"]; + 40 [label="Exit when branch condition"]; + } + 41 [label="Synthetic else branch"]; + 42 [label="Enter when branch result"]; subgraph cluster_16 { color=blue - 40 [label="Enter when"]; - subgraph cluster_17 { - color=blue - 41 [label="Enter when branch condition "]; - 42 [label="Access variable R|/b|"]; - 43 [label="Exit when branch condition"]; - } - 44 [label="Synthetic else branch"]; - 45 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 46 [label="Enter block"]; - 47 [label="Access variable R|/x|"]; - 48 [label="Type operator: x as A"]; - 49 [label="Jump: break@@@[Boolean(true)] "]; - 50 [label="Stub" style="filled" fillcolor=gray]; - 51 [label="Exit block" style="filled" fillcolor=gray]; - } - 52 [label="Exit when branch result" style="filled" fillcolor=gray]; - 53 [label="Exit when"]; + 43 [label="Enter block"]; + 44 [label="Access variable R|/x|"]; + 45 [label="Type operator: x as A"]; + 46 [label="Jump: break@@@[Boolean(true)] "]; + 47 [label="Stub" style="filled" fillcolor=gray]; + 48 [label="Exit block" style="filled" fillcolor=gray]; } - 54 [label="Exit block"]; + 49 [label="Exit when branch result" style="filled" fillcolor=gray]; + 50 [label="Exit when"]; } - 55 [label="Exit loop block"]; + 51 [label="Exit block"]; } - 56 [label="Stub" style="filled" fillcolor=gray]; - 57 [label="Exit whileloop"]; + 52 [label="Exit loop block"]; } - 58 [label="Access variable R|/x|"]; - 59 [label="Function call: R|/x|.R|/A.foo|()"]; - 60 [label="Exit block"]; + 53 [label="Stub" style="filled" fillcolor=gray]; + 54 [label="Exit whileloop"]; } - 61 [label="Exit function test_2" style="filled" fillcolor=red]; + 55 [label="Access variable R|/x|"]; + 56 [label="Function call: R|/x|.R|/A.foo|()"]; + 57 [label="Exit function test_2" style="filled" fillcolor=red]; } + 30 -> {31}; + 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; + 34 -> {53} [style=dotted]; 35 -> {36}; 36 -> {37}; 37 -> {38}; - 37 -> {56} [style=dotted]; 38 -> {39}; 39 -> {40}; - 40 -> {41}; - 41 -> {42}; + 40 -> {42 41}; + 41 -> {50}; 42 -> {43}; - 43 -> {45 44}; - 44 -> {53}; + 43 -> {44}; + 44 -> {45}; 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {57}; + 46 -> {54}; + 46 -> {47} [style=dotted]; + 47 -> {48} [style=dotted]; + 48 -> {49} [style=dotted]; 49 -> {50} [style=dotted]; - 50 -> {51} [style=dotted]; - 51 -> {52} [style=dotted]; - 52 -> {53} [style=dotted]; - 53 -> {54}; + 50 -> {51}; + 51 -> {52}; + 52 -> {32}; + 53 -> {54} [style=dotted]; 54 -> {55}; - 55 -> {35}; - 56 -> {57} [style=dotted]; - 57 -> {58}; + 55 -> {56}; + 56 -> {57}; + + subgraph cluster_17 { + color=red + 58 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 59 [label="Enter while loop"]; + subgraph cluster_19 { + color=blue + 60 [label="Enter loop condition"]; + 61 [label="Const: Boolean(true)"]; + 62 [label="Exit loop condition"]; + } + subgraph cluster_20 { + color=blue + 63 [label="Enter loop block"]; + subgraph cluster_21 { + color=blue + 64 [label="Enter block"]; + 65 [label="Access variable R|/x|"]; + 66 [label="Type operator: x as A"]; + subgraph cluster_22 { + color=blue + 67 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 68 [label="Enter when branch condition "]; + 69 [label="Access variable R|/b|"]; + 70 [label="Exit when branch condition"]; + } + 71 [label="Synthetic else branch"]; + 72 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 73 [label="Enter block"]; + 74 [label="Jump: break@@@[Boolean(true)] "]; + 75 [label="Stub" style="filled" fillcolor=gray]; + 76 [label="Exit block" style="filled" fillcolor=gray]; + } + 77 [label="Exit when branch result" style="filled" fillcolor=gray]; + 78 [label="Exit when"]; + } + subgraph cluster_25 { + color=blue + 79 [label="Enter when"]; + subgraph cluster_26 { + color=blue + 80 [label="Enter when branch condition "]; + 81 [label="Access variable R|/b|"]; + 82 [label="Exit when branch condition"]; + } + 83 [label="Synthetic else branch"]; + 84 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 85 [label="Enter block"]; + 86 [label="Jump: break@@@[Boolean(true)] "]; + 87 [label="Stub" style="filled" fillcolor=gray]; + 88 [label="Exit block" style="filled" fillcolor=gray]; + } + 89 [label="Exit when branch result" style="filled" fillcolor=gray]; + 90 [label="Exit when"]; + } + 91 [label="Exit block"]; + } + 92 [label="Exit loop block"]; + } + 93 [label="Stub" style="filled" fillcolor=gray]; + 94 [label="Exit whileloop"]; + } + 95 [label="Access variable R|/x|"]; + 96 [label="Function call: R|/x|.R|/A.foo|()"]; + 97 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 58 -> {59}; 59 -> {60}; 60 -> {61}; - - subgraph cluster_19 { - color=red - 62 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_20 { - color=blue - 63 [label="Enter block"]; - subgraph cluster_21 { - color=blue - 64 [label="Enter while loop"]; - subgraph cluster_22 { - color=blue - 65 [label="Enter loop condition"]; - 66 [label="Const: Boolean(true)"]; - 67 [label="Exit loop condition"]; - } - subgraph cluster_23 { - color=blue - 68 [label="Enter loop block"]; - subgraph cluster_24 { - color=blue - 69 [label="Enter block"]; - 70 [label="Access variable R|/x|"]; - 71 [label="Type operator: x as A"]; - subgraph cluster_25 { - color=blue - 72 [label="Enter when"]; - subgraph cluster_26 { - color=blue - 73 [label="Enter when branch condition "]; - 74 [label="Access variable R|/b|"]; - 75 [label="Exit when branch condition"]; - } - 76 [label="Synthetic else branch"]; - 77 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 78 [label="Enter block"]; - 79 [label="Jump: break@@@[Boolean(true)] "]; - 80 [label="Stub" style="filled" fillcolor=gray]; - 81 [label="Exit block" style="filled" fillcolor=gray]; - } - 82 [label="Exit when branch result" style="filled" fillcolor=gray]; - 83 [label="Exit when"]; - } - subgraph cluster_28 { - color=blue - 84 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 85 [label="Enter when branch condition "]; - 86 [label="Access variable R|/b|"]; - 87 [label="Exit when branch condition"]; - } - 88 [label="Synthetic else branch"]; - 89 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 90 [label="Enter block"]; - 91 [label="Jump: break@@@[Boolean(true)] "]; - 92 [label="Stub" style="filled" fillcolor=gray]; - 93 [label="Exit block" style="filled" fillcolor=gray]; - } - 94 [label="Exit when branch result" style="filled" fillcolor=gray]; - 95 [label="Exit when"]; - } - 96 [label="Exit block"]; - } - 97 [label="Exit loop block"]; - } - 98 [label="Stub" style="filled" fillcolor=gray]; - 99 [label="Exit whileloop"]; - } - 100 [label="Access variable R|/x|"]; - 101 [label="Function call: R|/x|.R|/A.foo|()"]; - 102 [label="Exit block"]; - } - 103 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 61 -> {62}; 62 -> {63}; + 62 -> {93} [style=dotted]; 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; - 67 -> {98} [style=dotted]; 68 -> {69}; 69 -> {70}; - 70 -> {71}; - 71 -> {72}; + 70 -> {72 71}; + 71 -> {78}; 72 -> {73}; 73 -> {74}; - 74 -> {75}; - 75 -> {77 76}; - 76 -> {83}; - 77 -> {78}; + 74 -> {94}; + 74 -> {75} [style=dotted]; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; 78 -> {79}; - 79 -> {99}; - 79 -> {80} [style=dotted]; - 80 -> {81} [style=dotted]; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; - 83 -> {84}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {84 83}; + 83 -> {90}; 84 -> {85}; 85 -> {86}; - 86 -> {87}; - 87 -> {89 88}; - 88 -> {95}; - 89 -> {90}; + 86 -> {94}; + 86 -> {87} [style=dotted]; + 87 -> {88} [style=dotted]; + 88 -> {89} [style=dotted]; + 89 -> {90} [style=dotted]; 90 -> {91}; - 91 -> {99}; - 91 -> {92} [style=dotted]; - 92 -> {93} [style=dotted]; + 91 -> {92}; + 92 -> {60}; 93 -> {94} [style=dotted]; - 94 -> {95} [style=dotted]; + 94 -> {95}; 95 -> {96}; 96 -> {97}; - 97 -> {65}; - 98 -> {99} [style=dotted]; + + subgraph cluster_28 { + color=red + 98 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 99 [label="Enter while loop"]; + subgraph cluster_30 { + color=blue + 100 [label="Enter loop condition"]; + 101 [label="Const: Boolean(true)"]; + 102 [label="Exit loop condition"]; + } + subgraph cluster_31 { + color=blue + 103 [label="Enter loop block"]; + subgraph cluster_32 { + color=blue + 104 [label="Enter block"]; + subgraph cluster_33 { + color=blue + 105 [label="Enter when"]; + subgraph cluster_34 { + color=blue + 106 [label="Enter when branch condition "]; + 107 [label="Access variable R|/b|"]; + 108 [label="Exit when branch condition"]; + } + 109 [label="Synthetic else branch"]; + 110 [label="Enter when branch result"]; + subgraph cluster_35 { + color=blue + 111 [label="Enter block"]; + 112 [label="Access variable R|/x|"]; + 113 [label="Type operator: x as A"]; + 114 [label="Jump: break@@@[Boolean(true)] "]; + 115 [label="Stub" style="filled" fillcolor=gray]; + 116 [label="Exit block" style="filled" fillcolor=gray]; + } + 117 [label="Exit when branch result" style="filled" fillcolor=gray]; + 118 [label="Exit when"]; + } + 119 [label="Jump: break@@@[Boolean(true)] "]; + 120 [label="Stub" style="filled" fillcolor=gray]; + 121 [label="Exit block" style="filled" fillcolor=gray]; + } + 122 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 123 [label="Stub" style="filled" fillcolor=gray]; + 124 [label="Exit whileloop"]; + } + 125 [label="Access variable R|/x|"]; + 126 [label="Function call: R|/x|.#()"]; + 127 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 98 -> {99}; 99 -> {100}; 100 -> {101}; 101 -> {102}; 102 -> {103}; - - subgraph cluster_31 { - color=red - 104 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_32 { - color=blue - 105 [label="Enter block"]; - subgraph cluster_33 { - color=blue - 106 [label="Enter while loop"]; - subgraph cluster_34 { - color=blue - 107 [label="Enter loop condition"]; - 108 [label="Const: Boolean(true)"]; - 109 [label="Exit loop condition"]; - } - subgraph cluster_35 { - color=blue - 110 [label="Enter loop block"]; - subgraph cluster_36 { - color=blue - 111 [label="Enter block"]; - subgraph cluster_37 { - color=blue - 112 [label="Enter when"]; - subgraph cluster_38 { - color=blue - 113 [label="Enter when branch condition "]; - 114 [label="Access variable R|/b|"]; - 115 [label="Exit when branch condition"]; - } - 116 [label="Synthetic else branch"]; - 117 [label="Enter when branch result"]; - subgraph cluster_39 { - color=blue - 118 [label="Enter block"]; - 119 [label="Access variable R|/x|"]; - 120 [label="Type operator: x as A"]; - 121 [label="Jump: break@@@[Boolean(true)] "]; - 122 [label="Stub" style="filled" fillcolor=gray]; - 123 [label="Exit block" style="filled" fillcolor=gray]; - } - 124 [label="Exit when branch result" style="filled" fillcolor=gray]; - 125 [label="Exit when"]; - } - 126 [label="Jump: break@@@[Boolean(true)] "]; - 127 [label="Stub" style="filled" fillcolor=gray]; - 128 [label="Exit block" style="filled" fillcolor=gray]; - } - 129 [label="Exit loop block" style="filled" fillcolor=gray]; - } - 130 [label="Stub" style="filled" fillcolor=gray]; - 131 [label="Exit whileloop"]; - } - 132 [label="Access variable R|/x|"]; - 133 [label="Function call: R|/x|.#()"]; - 134 [label="Exit block"]; - } - 135 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 102 -> {123} [style=dotted]; + 103 -> {104}; 104 -> {105}; 105 -> {106}; 106 -> {107}; 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 109 -> {130} [style=dotted]; + 108 -> {110 109}; + 109 -> {118}; 110 -> {111}; 111 -> {112}; 112 -> {113}; 113 -> {114}; - 114 -> {115}; - 115 -> {117 116}; - 116 -> {125}; - 117 -> {118}; + 114 -> {124}; + 114 -> {115} [style=dotted]; + 115 -> {116} [style=dotted]; + 116 -> {117} [style=dotted]; + 117 -> {118} [style=dotted]; 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {131}; + 119 -> {124}; + 119 -> {120} [style=dotted]; + 120 -> {121} [style=dotted]; 121 -> {122} [style=dotted]; - 122 -> {123} [style=dotted]; + 122 -> {100} [style=dotted]; 123 -> {124} [style=dotted]; - 124 -> {125} [style=dotted]; + 124 -> {125}; 125 -> {126}; - 126 -> {131}; - 126 -> {127} [style=dotted]; - 127 -> {128} [style=dotted]; - 128 -> {129} [style=dotted]; - 129 -> {107} [style=dotted]; - 130 -> {131} [style=dotted]; + 126 -> {127}; + + subgraph cluster_36 { + color=red + 128 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_37 { + color=blue + 129 [label="Enter do-while loop"]; + subgraph cluster_38 { + color=blue + 130 [label="Enter loop block"]; + subgraph cluster_39 { + color=blue + 131 [label="Enter block"]; + subgraph cluster_40 { + color=blue + 132 [label="Enter when"]; + subgraph cluster_41 { + color=blue + 133 [label="Enter when branch condition "]; + 134 [label="Access variable R|/b|"]; + 135 [label="Exit when branch condition"]; + } + 136 [label="Synthetic else branch"]; + 137 [label="Enter when branch result"]; + subgraph cluster_42 { + color=blue + 138 [label="Enter block"]; + 139 [label="Access variable R|/x|"]; + 140 [label="Type operator: x as A"]; + 141 [label="Jump: break@@@[Boolean(true)] "]; + 142 [label="Stub" style="filled" fillcolor=gray]; + 143 [label="Exit block" style="filled" fillcolor=gray]; + } + 144 [label="Exit when branch result" style="filled" fillcolor=gray]; + 145 [label="Exit when"]; + } + 146 [label="Exit block"]; + } + 147 [label="Exit loop block"]; + } + subgraph cluster_43 { + color=blue + 148 [label="Enter loop condition"]; + 149 [label="Const: Boolean(true)"]; + 150 [label="Exit loop condition"]; + } + 151 [label="Stub" style="filled" fillcolor=gray]; + 152 [label="Exit do-whileloop"]; + } + 153 [label="Access variable R|/x|"]; + 154 [label="Function call: R|/x|.R|/A.foo|()"]; + 155 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; 131 -> {132}; 132 -> {133}; 133 -> {134}; 134 -> {135}; - - subgraph cluster_40 { - color=red - 136 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_41 { - color=blue - 137 [label="Enter block"]; - subgraph cluster_42 { - color=blue - 138 [label="Enter do-while loop"]; - subgraph cluster_43 { - color=blue - 139 [label="Enter loop block"]; - subgraph cluster_44 { - color=blue - 140 [label="Enter block"]; - subgraph cluster_45 { - color=blue - 141 [label="Enter when"]; - subgraph cluster_46 { - color=blue - 142 [label="Enter when branch condition "]; - 143 [label="Access variable R|/b|"]; - 144 [label="Exit when branch condition"]; - } - 145 [label="Synthetic else branch"]; - 146 [label="Enter when branch result"]; - subgraph cluster_47 { - color=blue - 147 [label="Enter block"]; - 148 [label="Access variable R|/x|"]; - 149 [label="Type operator: x as A"]; - 150 [label="Jump: break@@@[Boolean(true)] "]; - 151 [label="Stub" style="filled" fillcolor=gray]; - 152 [label="Exit block" style="filled" fillcolor=gray]; - } - 153 [label="Exit when branch result" style="filled" fillcolor=gray]; - 154 [label="Exit when"]; - } - 155 [label="Exit block"]; - } - 156 [label="Exit loop block"]; - } - subgraph cluster_48 { - color=blue - 157 [label="Enter loop condition"]; - 158 [label="Const: Boolean(true)"]; - 159 [label="Exit loop condition"]; - } - 160 [label="Stub" style="filled" fillcolor=gray]; - 161 [label="Exit do-whileloop"]; - } - 162 [label="Access variable R|/x|"]; - 163 [label="Function call: R|/x|.R|/A.foo|()"]; - 164 [label="Exit block"]; - } - 165 [label="Exit function test_5" style="filled" fillcolor=red]; - } - - 136 -> {137}; + 135 -> {137 136}; + 136 -> {145}; 137 -> {138}; 138 -> {139}; 139 -> {140}; 140 -> {141}; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; - 144 -> {146 145}; - 145 -> {154}; + 141 -> {152}; + 141 -> {142} [style=dotted]; + 142 -> {143} [style=dotted]; + 143 -> {144} [style=dotted]; + 144 -> {145} [style=dotted]; + 145 -> {146}; 146 -> {147}; 147 -> {148}; 148 -> {149}; 149 -> {150}; - 150 -> {161}; + 150 -> {130}; 150 -> {151} [style=dotted]; 151 -> {152} [style=dotted]; - 152 -> {153} [style=dotted]; - 153 -> {154} [style=dotted]; + 152 -> {153}; + 153 -> {154}; 154 -> {155}; - 155 -> {156}; + + subgraph cluster_44 { + color=red + 156 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_45 { + color=blue + 157 [label="Enter do-while loop"]; + subgraph cluster_46 { + color=blue + 158 [label="Enter loop block"]; + subgraph cluster_47 { + color=blue + 159 [label="Enter block"]; + 160 [label="Access variable R|/x|"]; + 161 [label="Type operator: x as A"]; + subgraph cluster_48 { + color=blue + 162 [label="Enter when"]; + subgraph cluster_49 { + color=blue + 163 [label="Enter when branch condition "]; + 164 [label="Access variable R|/b|"]; + 165 [label="Exit when branch condition"]; + } + 166 [label="Synthetic else branch"]; + 167 [label="Enter when branch result"]; + subgraph cluster_50 { + color=blue + 168 [label="Enter block"]; + 169 [label="Jump: break@@@[Boolean(true)] "]; + 170 [label="Stub" style="filled" fillcolor=gray]; + 171 [label="Exit block" style="filled" fillcolor=gray]; + } + 172 [label="Exit when branch result" style="filled" fillcolor=gray]; + 173 [label="Exit when"]; + } + 174 [label="Exit block"]; + } + 175 [label="Exit loop block"]; + } + subgraph cluster_51 { + color=blue + 176 [label="Enter loop condition"]; + 177 [label="Const: Boolean(true)"]; + 178 [label="Exit loop condition"]; + } + 179 [label="Stub" style="filled" fillcolor=gray]; + 180 [label="Exit do-whileloop"]; + } + 181 [label="Access variable R|/x|"]; + 182 [label="Function call: R|/x|.R|/A.foo|()"]; + 183 [label="Exit function test_6" style="filled" fillcolor=red]; + } + 156 -> {157}; 157 -> {158}; 158 -> {159}; - 159 -> {139}; - 159 -> {160} [style=dotted]; - 160 -> {161} [style=dotted]; + 159 -> {160}; + 160 -> {161}; 161 -> {162}; 162 -> {163}; 163 -> {164}; 164 -> {165}; - - subgraph cluster_49 { - color=red - 166 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_50 { - color=blue - 167 [label="Enter block"]; - subgraph cluster_51 { - color=blue - 168 [label="Enter do-while loop"]; - subgraph cluster_52 { - color=blue - 169 [label="Enter loop block"]; - subgraph cluster_53 { - color=blue - 170 [label="Enter block"]; - 171 [label="Access variable R|/x|"]; - 172 [label="Type operator: x as A"]; - subgraph cluster_54 { - color=blue - 173 [label="Enter when"]; - subgraph cluster_55 { - color=blue - 174 [label="Enter when branch condition "]; - 175 [label="Access variable R|/b|"]; - 176 [label="Exit when branch condition"]; - } - 177 [label="Synthetic else branch"]; - 178 [label="Enter when branch result"]; - subgraph cluster_56 { - color=blue - 179 [label="Enter block"]; - 180 [label="Jump: break@@@[Boolean(true)] "]; - 181 [label="Stub" style="filled" fillcolor=gray]; - 182 [label="Exit block" style="filled" fillcolor=gray]; - } - 183 [label="Exit when branch result" style="filled" fillcolor=gray]; - 184 [label="Exit when"]; - } - 185 [label="Exit block"]; - } - 186 [label="Exit loop block"]; - } - subgraph cluster_57 { - color=blue - 187 [label="Enter loop condition"]; - 188 [label="Const: Boolean(true)"]; - 189 [label="Exit loop condition"]; - } - 190 [label="Stub" style="filled" fillcolor=gray]; - 191 [label="Exit do-whileloop"]; - } - 192 [label="Access variable R|/x|"]; - 193 [label="Function call: R|/x|.R|/A.foo|()"]; - 194 [label="Exit block"]; - } - 195 [label="Exit function test_6" style="filled" fillcolor=red]; - } - - 166 -> {167}; + 165 -> {167 166}; + 166 -> {173}; 167 -> {168}; 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {173}; + 169 -> {180}; + 169 -> {170} [style=dotted]; + 170 -> {171} [style=dotted]; + 171 -> {172} [style=dotted]; + 172 -> {173} [style=dotted]; 173 -> {174}; 174 -> {175}; 175 -> {176}; - 176 -> {178 177}; - 177 -> {184}; - 178 -> {179}; - 179 -> {180}; - 180 -> {191}; - 180 -> {181} [style=dotted]; - 181 -> {182} [style=dotted]; - 182 -> {183} [style=dotted]; - 183 -> {184} [style=dotted]; + 176 -> {177}; + 177 -> {178}; + 178 -> {158}; + 178 -> {179} [style=dotted]; + 179 -> {180} [style=dotted]; + 180 -> {181}; + 181 -> {182}; + 182 -> {183}; + + subgraph cluster_52 { + color=red + 184 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_53 { + color=blue + 185 [label="Enter do-while loop"]; + subgraph cluster_54 { + color=blue + 186 [label="Enter loop block"]; + subgraph cluster_55 { + color=blue + 187 [label="Enter block"]; + 188 [label="Access variable R|/x|"]; + 189 [label="Type operator: x as A"]; + 190 [label="Exit block"]; + } + 191 [label="Exit loop block"]; + } + subgraph cluster_56 { + color=blue + 192 [label="Enter loop condition"]; + 193 [label="Const: Boolean(true)"]; + 194 [label="Exit loop condition"]; + } + 195 [label="Stub" style="filled" fillcolor=gray]; + 196 [label="Exit do-whileloop" style="filled" fillcolor=gray]; + } + 197 [label="Access variable R|/x|" style="filled" fillcolor=gray]; + 198 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=gray]; + 199 [label="Exit function test_7" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + 184 -> {185}; 185 -> {186}; 186 -> {187}; 187 -> {188}; 188 -> {189}; - 189 -> {169}; - 189 -> {190} [style=dotted]; - 190 -> {191} [style=dotted]; + 189 -> {190}; + 190 -> {191}; 191 -> {192}; 192 -> {193}; 193 -> {194}; - 194 -> {195}; - - subgraph cluster_58 { - color=red - 196 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_59 { - color=blue - 197 [label="Enter block"]; - subgraph cluster_60 { - color=blue - 198 [label="Enter do-while loop"]; - subgraph cluster_61 { - color=blue - 199 [label="Enter loop block"]; - subgraph cluster_62 { - color=blue - 200 [label="Enter block"]; - 201 [label="Access variable R|/x|"]; - 202 [label="Type operator: x as A"]; - 203 [label="Exit block"]; - } - 204 [label="Exit loop block"]; - } - subgraph cluster_63 { - color=blue - 205 [label="Enter loop condition"]; - 206 [label="Const: Boolean(true)"]; - 207 [label="Exit loop condition"]; - } - 208 [label="Stub" style="filled" fillcolor=gray]; - 209 [label="Exit do-whileloop" style="filled" fillcolor=gray]; - } - 210 [label="Access variable R|/x|" style="filled" fillcolor=gray]; - 211 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=gray]; - 212 [label="Exit block" style="filled" fillcolor=gray]; - } - 213 [label="Exit function test_7" style="filled" fillcolor=red style="filled" fillcolor=gray]; - } - - 196 -> {197}; - 197 -> {198}; - 198 -> {199}; - 199 -> {200}; - 200 -> {201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {204}; - 204 -> {205}; - 205 -> {206}; - 206 -> {207}; - 207 -> {199}; - 207 -> {208} [style=dotted]; - 208 -> {209} [style=dotted]; - 209 -> {210} [style=dotted]; - 210 -> {211} [style=dotted]; - 211 -> {212} [style=dotted]; - 212 -> {213} [style=dotted]; + 194 -> {186}; + 194 -> {195} [style=dotted]; + 195 -> {196} [style=dotted]; + 196 -> {197} [style=dotted]; + 197 -> {198} [style=dotted]; + 198 -> {199} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot index 26d1faf5766..c002f23846d 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot @@ -16,60 +16,55 @@ digraph equalsAndIdentity_kt { 2 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_2 { color=blue - 3 [label="Enter block"]; + 3 [label="Enter when"]; subgraph cluster_3 { color=blue - 4 [label="Enter when"]; - subgraph cluster_4 { - color=blue - 5 [label="Enter when branch condition "]; - 6 [label="Access variable R|/x|"]; - 7 [label="Access variable R|/y|"]; - 8 [label="Operator =="]; - 9 [label="Exit when branch condition"]; - } - 10 [label="Synthetic else branch"]; - 11 [label="Enter when branch result"]; - subgraph cluster_5 { - color=blue - 12 [label="Enter block"]; - 13 [label="Access variable R|/x|"]; - 14 [label="Function call: R|/x|.R|/A.foo|()"]; - 15 [label="Access variable R|/y|"]; - 16 [label="Function call: R|/y|.R|/A.foo|()"]; - 17 [label="Exit block"]; - } - 18 [label="Exit when branch result"]; - 19 [label="Exit when"]; + 4 [label="Enter when branch condition "]; + 5 [label="Access variable R|/x|"]; + 6 [label="Access variable R|/y|"]; + 7 [label="Operator =="]; + 8 [label="Exit when branch condition"]; } + 9 [label="Synthetic else branch"]; + 10 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 11 [label="Enter block"]; + 12 [label="Access variable R|/x|"]; + 13 [label="Function call: R|/x|.R|/A.foo|()"]; + 14 [label="Access variable R|/y|"]; + 15 [label="Function call: R|/y|.R|/A.foo|()"]; + 16 [label="Exit block"]; + } + 17 [label="Exit when branch result"]; + 18 [label="Exit when"]; + } + subgraph cluster_5 { + color=blue + 19 [label="Enter when"]; subgraph cluster_6 { color=blue - 20 [label="Enter when"]; - subgraph cluster_7 { - color=blue - 21 [label="Enter when branch condition "]; - 22 [label="Access variable R|/x|"]; - 23 [label="Access variable R|/y|"]; - 24 [label="Operator ==="]; - 25 [label="Exit when branch condition"]; - } - 26 [label="Synthetic else branch"]; - 27 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 28 [label="Enter block"]; - 29 [label="Access variable R|/x|"]; - 30 [label="Function call: R|/x|.R|/A.foo|()"]; - 31 [label="Access variable R|/y|"]; - 32 [label="Function call: R|/y|.R|/A.foo|()"]; - 33 [label="Exit block"]; - } - 34 [label="Exit when branch result"]; - 35 [label="Exit when"]; + 20 [label="Enter when branch condition "]; + 21 [label="Access variable R|/x|"]; + 22 [label="Access variable R|/y|"]; + 23 [label="Operator ==="]; + 24 [label="Exit when branch condition"]; } - 36 [label="Exit block"]; + 25 [label="Synthetic else branch"]; + 26 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 27 [label="Enter block"]; + 28 [label="Access variable R|/x|"]; + 29 [label="Function call: R|/x|.R|/A.foo|()"]; + 30 [label="Access variable R|/y|"]; + 31 [label="Function call: R|/y|.R|/A.foo|()"]; + 32 [label="Exit block"]; + } + 33 [label="Exit when branch result"]; + 34 [label="Exit when"]; } - 37 [label="Exit function test_1" style="filled" fillcolor=red]; + 35 [label="Exit function test_1" style="filled" fillcolor=red]; } 2 -> {3}; @@ -78,9 +73,9 @@ digraph equalsAndIdentity_kt { 5 -> {6}; 6 -> {7}; 7 -> {8}; - 8 -> {9}; - 9 -> {11 10}; - 10 -> {19}; + 8 -> {10 9}; + 9 -> {18}; + 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; @@ -94,9 +89,9 @@ digraph equalsAndIdentity_kt { 21 -> {22}; 22 -> {23}; 23 -> {24}; - 24 -> {25}; - 25 -> {27 26}; - 26 -> {35}; + 24 -> {26 25}; + 25 -> {34}; + 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; @@ -105,79 +100,74 @@ digraph equalsAndIdentity_kt { 32 -> {33}; 33 -> {34}; 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - subgraph cluster_9 { + subgraph cluster_8 { color=red - 38 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { + 36 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 39 [label="Enter block"]; + 37 [label="Enter when"]; + subgraph cluster_10 { + color=blue + 38 [label="Enter when branch condition "]; + 39 [label="Access variable R|/x|"]; + 40 [label="Access variable R|/y|"]; + 41 [label="Operator =="]; + 42 [label="Exit when branch condition"]; + } + 43 [label="Synthetic else branch"]; + 44 [label="Enter when branch result"]; subgraph cluster_11 { color=blue - 40 [label="Enter when"]; - subgraph cluster_12 { - color=blue - 41 [label="Enter when branch condition "]; - 42 [label="Access variable R|/x|"]; - 43 [label="Access variable R|/y|"]; - 44 [label="Operator =="]; - 45 [label="Exit when branch condition"]; - } - 46 [label="Synthetic else branch"]; - 47 [label="Enter when branch result"]; - subgraph cluster_13 { - color=blue - 48 [label="Enter block"]; - 49 [label="Access variable R|/x|"]; - 50 [label="Function call: R|/x|.#()"]; - 51 [label="Access variable R|/y|"]; - 52 [label="Function call: R|/y|.#()"]; - 53 [label="Exit block"]; - } - 54 [label="Exit when branch result"]; - 55 [label="Exit when"]; + 45 [label="Enter block"]; + 46 [label="Access variable R|/x|"]; + 47 [label="Function call: R|/x|.#()"]; + 48 [label="Access variable R|/y|"]; + 49 [label="Function call: R|/y|.#()"]; + 50 [label="Exit block"]; } + 51 [label="Exit when branch result"]; + 52 [label="Exit when"]; + } + subgraph cluster_12 { + color=blue + 53 [label="Enter when"]; + subgraph cluster_13 { + color=blue + 54 [label="Enter when branch condition "]; + 55 [label="Access variable R|/x|"]; + 56 [label="Access variable R|/y|"]; + 57 [label="Operator ==="]; + 58 [label="Exit when branch condition"]; + } + 59 [label="Synthetic else branch"]; + 60 [label="Enter when branch result"]; subgraph cluster_14 { color=blue - 56 [label="Enter when"]; - subgraph cluster_15 { - color=blue - 57 [label="Enter when branch condition "]; - 58 [label="Access variable R|/x|"]; - 59 [label="Access variable R|/y|"]; - 60 [label="Operator ==="]; - 61 [label="Exit when branch condition"]; - } - 62 [label="Synthetic else branch"]; - 63 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 64 [label="Enter block"]; - 65 [label="Access variable R|/x|"]; - 66 [label="Function call: R|/x|.#()"]; - 67 [label="Access variable R|/y|"]; - 68 [label="Function call: R|/y|.#()"]; - 69 [label="Exit block"]; - } - 70 [label="Exit when branch result"]; - 71 [label="Exit when"]; + 61 [label="Enter block"]; + 62 [label="Access variable R|/x|"]; + 63 [label="Function call: R|/x|.#()"]; + 64 [label="Access variable R|/y|"]; + 65 [label="Function call: R|/y|.#()"]; + 66 [label="Exit block"]; } - 72 [label="Exit block"]; + 67 [label="Exit when branch result"]; + 68 [label="Exit when"]; } - 73 [label="Exit function test_2" style="filled" fillcolor=red]; + 69 [label="Exit function test_2" style="filled" fillcolor=red]; } + 36 -> {37}; + 37 -> {38}; 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; - 42 -> {43}; - 43 -> {44}; + 42 -> {44 43}; + 43 -> {52}; 44 -> {45}; - 45 -> {47 46}; - 46 -> {55}; + 45 -> {46}; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; @@ -189,130 +179,125 @@ digraph equalsAndIdentity_kt { 55 -> {56}; 56 -> {57}; 57 -> {58}; - 58 -> {59}; - 59 -> {60}; + 58 -> {60 59}; + 59 -> {68}; 60 -> {61}; - 61 -> {63 62}; - 62 -> {71}; + 61 -> {62}; + 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {70}; + + subgraph cluster_15 { + color=red + 70 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 71 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 72 [label="Enter when branch condition "]; + 73 [label="Access variable R|/y|"]; + 74 [label="Const: Null(null)"]; + 75 [label="Operator =="]; + 76 [label="Exit when branch condition"]; + } + 77 [label="Synthetic else branch"]; + 78 [label="Enter when branch result"]; + subgraph cluster_18 { + color=blue + 79 [label="Enter block"]; + 80 [label="Jump: ^test_3 Unit"]; + 81 [label="Stub" style="filled" fillcolor=gray]; + 82 [label="Exit block" style="filled" fillcolor=gray]; + } + 83 [label="Exit when branch result" style="filled" fillcolor=gray]; + 84 [label="Exit when"]; + } + subgraph cluster_19 { + color=blue + 85 [label="Enter when"]; + subgraph cluster_20 { + color=blue + 86 [label="Enter when branch condition "]; + 87 [label="Access variable R|/x|"]; + 88 [label="Access variable R|/y|"]; + 89 [label="Operator =="]; + 90 [label="Exit when branch condition"]; + } + 91 [label="Synthetic else branch"]; + 92 [label="Enter when branch result"]; + subgraph cluster_21 { + color=blue + 93 [label="Enter block"]; + 94 [label="Access variable R|/x|"]; + 95 [label="Function call: R|/x|.R|/A.foo|()"]; + 96 [label="Access variable R|/y|"]; + 97 [label="Function call: R|/y|.R|/A.foo|()"]; + 98 [label="Exit block"]; + } + 99 [label="Exit when branch result"]; + 100 [label="Exit when"]; + } + subgraph cluster_22 { + color=blue + 101 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 102 [label="Enter when branch condition "]; + 103 [label="Access variable R|/x|"]; + 104 [label="Access variable R|/y|"]; + 105 [label="Operator ==="]; + 106 [label="Exit when branch condition"]; + } + 107 [label="Synthetic else branch"]; + 108 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 109 [label="Enter block"]; + 110 [label="Access variable R|/x|"]; + 111 [label="Function call: R|/x|.R|/A.foo|()"]; + 112 [label="Access variable R|/y|"]; + 113 [label="Function call: R|/y|.R|/A.foo|()"]; + 114 [label="Exit block"]; + } + 115 [label="Exit when branch result"]; + 116 [label="Exit when"]; + } + 117 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 70 -> {71}; 71 -> {72}; 72 -> {73}; - - subgraph cluster_17 { - color=red - 74 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_18 { - color=blue - 75 [label="Enter block"]; - subgraph cluster_19 { - color=blue - 76 [label="Enter when"]; - subgraph cluster_20 { - color=blue - 77 [label="Enter when branch condition "]; - 78 [label="Access variable R|/y|"]; - 79 [label="Const: Null(null)"]; - 80 [label="Operator =="]; - 81 [label="Exit when branch condition"]; - } - 82 [label="Synthetic else branch"]; - 83 [label="Enter when branch result"]; - subgraph cluster_21 { - color=blue - 84 [label="Enter block"]; - 85 [label="Jump: ^test_3 Unit"]; - 86 [label="Stub" style="filled" fillcolor=gray]; - 87 [label="Exit block" style="filled" fillcolor=gray]; - } - 88 [label="Exit when branch result" style="filled" fillcolor=gray]; - 89 [label="Exit when"]; - } - subgraph cluster_22 { - color=blue - 90 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 91 [label="Enter when branch condition "]; - 92 [label="Access variable R|/x|"]; - 93 [label="Access variable R|/y|"]; - 94 [label="Operator =="]; - 95 [label="Exit when branch condition"]; - } - 96 [label="Synthetic else branch"]; - 97 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 98 [label="Enter block"]; - 99 [label="Access variable R|/x|"]; - 100 [label="Function call: R|/x|.R|/A.foo|()"]; - 101 [label="Access variable R|/y|"]; - 102 [label="Function call: R|/y|.R|/A.foo|()"]; - 103 [label="Exit block"]; - } - 104 [label="Exit when branch result"]; - 105 [label="Exit when"]; - } - subgraph cluster_25 { - color=blue - 106 [label="Enter when"]; - subgraph cluster_26 { - color=blue - 107 [label="Enter when branch condition "]; - 108 [label="Access variable R|/x|"]; - 109 [label="Access variable R|/y|"]; - 110 [label="Operator ==="]; - 111 [label="Exit when branch condition"]; - } - 112 [label="Synthetic else branch"]; - 113 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 114 [label="Enter block"]; - 115 [label="Access variable R|/x|"]; - 116 [label="Function call: R|/x|.R|/A.foo|()"]; - 117 [label="Access variable R|/y|"]; - 118 [label="Function call: R|/y|.R|/A.foo|()"]; - 119 [label="Exit block"]; - } - 120 [label="Exit when branch result"]; - 121 [label="Exit when"]; - } - 122 [label="Exit block"]; - } - 123 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 73 -> {74}; 74 -> {75}; 75 -> {76}; - 76 -> {77}; - 77 -> {78}; + 76 -> {78 77}; + 77 -> {84}; 78 -> {79}; 79 -> {80}; - 80 -> {81}; - 81 -> {83 82}; - 82 -> {89}; - 83 -> {84}; + 80 -> {117}; + 80 -> {81} [style=dotted]; + 81 -> {82} [style=dotted]; + 82 -> {83} [style=dotted]; + 83 -> {84} [style=dotted]; 84 -> {85}; - 85 -> {123}; - 85 -> {86} [style=dotted]; - 86 -> {87} [style=dotted]; - 87 -> {88} [style=dotted]; - 88 -> {89} [style=dotted]; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; 89 -> {90}; - 90 -> {91}; - 91 -> {92}; + 90 -> {92 91}; + 91 -> {100}; 92 -> {93}; 93 -> {94}; 94 -> {95}; - 95 -> {97 96}; - 96 -> {105}; + 95 -> {96}; + 96 -> {97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; @@ -322,22 +307,16 @@ digraph equalsAndIdentity_kt { 103 -> {104}; 104 -> {105}; 105 -> {106}; - 106 -> {107}; - 107 -> {108}; + 106 -> {108 107}; + 107 -> {116}; 108 -> {109}; 109 -> {110}; 110 -> {111}; - 111 -> {113 112}; - 112 -> {121}; + 111 -> {112}; + 112 -> {113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot index 1db858f3b2d..774dd5cd4a6 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot @@ -32,48 +32,43 @@ digraph equalsToBoolean_kt { 6 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 7 [label="Enter block"]; + 7 [label="Enter when"]; subgraph cluster_5 { color=blue - 8 [label="Enter when"]; - subgraph cluster_6 { - color=blue - 9 [label="Enter when branch condition "]; - 10 [label="Access variable R|/b|"]; - 11 [label="Const: Boolean(true)"]; - 12 [label="Operator =="]; - 13 [label="Const: Boolean(true)"]; - 14 [label="Operator =="]; - 15 [label="Exit when branch condition"]; - } - subgraph cluster_7 { - color=blue - 16 [label="Enter when branch condition else"]; - 17 [label="Exit when branch condition"]; - } - 18 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 19 [label="Enter block"]; - 20 [label="Access variable R|/b|"]; - 21 [label="Function call: R|/b|.#()"]; - 22 [label="Exit block"]; - } - 23 [label="Exit when branch result"]; - 24 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 25 [label="Enter block"]; - 26 [label="Access variable R|/b|"]; - 27 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 28 [label="Exit block"]; - } - 29 [label="Exit when branch result"]; - 30 [label="Exit when"]; + 8 [label="Enter when branch condition "]; + 9 [label="Access variable R|/b|"]; + 10 [label="Const: Boolean(true)"]; + 11 [label="Operator =="]; + 12 [label="Const: Boolean(true)"]; + 13 [label="Operator =="]; + 14 [label="Exit when branch condition"]; } - 31 [label="Exit block"]; + subgraph cluster_6 { + color=blue + 15 [label="Enter when branch condition else"]; + 16 [label="Exit when branch condition"]; + } + 17 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 18 [label="Enter block"]; + 19 [label="Access variable R|/b|"]; + 20 [label="Function call: R|/b|.#()"]; + 21 [label="Exit block"]; + } + 22 [label="Exit when branch result"]; + 23 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 24 [label="Enter block"]; + 25 [label="Access variable R|/b|"]; + 26 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 27 [label="Exit block"]; + } + 28 [label="Exit when branch result"]; + 29 [label="Exit when"]; } - 32 [label="Exit function test_1" style="filled" fillcolor=red]; + 30 [label="Exit function test_1" style="filled" fillcolor=red]; } 6 -> {7}; @@ -84,245 +79,274 @@ digraph equalsToBoolean_kt { 11 -> {12}; 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {24 16}; + 14 -> {23 15}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {23}; - 23 -> {30}; + 22 -> {29}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - subgraph cluster_10 { + subgraph cluster_9 { color=red - 33 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_11 { + 31 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { color=blue - 34 [label="Enter block"]; + 32 [label="Enter when"]; + subgraph cluster_11 { + color=blue + 33 [label="Enter when branch condition "]; + 34 [label="Access variable R|/b|"]; + 35 [label="Const: Boolean(true)"]; + 36 [label="Operator =="]; + 37 [label="Const: Boolean(true)"]; + 38 [label="Operator !="]; + 39 [label="Exit when branch condition"]; + } subgraph cluster_12 { color=blue - 35 [label="Enter when"]; - subgraph cluster_13 { - color=blue - 36 [label="Enter when branch condition "]; - 37 [label="Access variable R|/b|"]; - 38 [label="Const: Boolean(true)"]; - 39 [label="Operator =="]; - 40 [label="Const: Boolean(true)"]; - 41 [label="Operator !="]; - 42 [label="Exit when branch condition"]; - } - subgraph cluster_14 { - color=blue - 43 [label="Enter when branch condition else"]; - 44 [label="Exit when branch condition"]; - } - 45 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 46 [label="Enter block"]; - 47 [label="Access variable R|/b|"]; - 48 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 49 [label="Exit block"]; - } - 50 [label="Exit when branch result"]; - 51 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 52 [label="Enter block"]; - 53 [label="Access variable R|/b|"]; - 54 [label="Function call: R|/b|.#()"]; - 55 [label="Exit block"]; - } - 56 [label="Exit when branch result"]; - 57 [label="Exit when"]; + 40 [label="Enter when branch condition else"]; + 41 [label="Exit when branch condition"]; } - 58 [label="Exit block"]; + 42 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 43 [label="Enter block"]; + 44 [label="Access variable R|/b|"]; + 45 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 46 [label="Exit block"]; + } + 47 [label="Exit when branch result"]; + 48 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable R|/b|"]; + 51 [label="Function call: R|/b|.#()"]; + 52 [label="Exit block"]; + } + 53 [label="Exit when branch result"]; + 54 [label="Exit when"]; } - 59 [label="Exit function test_2" style="filled" fillcolor=red]; + 55 [label="Exit function test_2" style="filled" fillcolor=red]; } + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; - 39 -> {40}; + 39 -> {48 40}; 40 -> {41}; 41 -> {42}; - 42 -> {51 43}; + 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; + 47 -> {54}; 48 -> {49}; 49 -> {50}; - 50 -> {57}; + 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; - 55 -> {56}; + + subgraph cluster_15 { + color=red + 56 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 57 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 58 [label="Enter when branch condition "]; + 59 [label="Access variable R|/b|"]; + 60 [label="Const: Boolean(true)"]; + 61 [label="Operator =="]; + 62 [label="Const: Boolean(false)"]; + 63 [label="Operator =="]; + 64 [label="Exit when branch condition"]; + } + subgraph cluster_18 { + color=blue + 65 [label="Enter when branch condition else"]; + 66 [label="Exit when branch condition"]; + } + 67 [label="Enter when branch result"]; + subgraph cluster_19 { + color=blue + 68 [label="Enter block"]; + 69 [label="Access variable R|/b|"]; + 70 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 71 [label="Exit block"]; + } + 72 [label="Exit when branch result"]; + 73 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 74 [label="Enter block"]; + 75 [label="Access variable R|/b|"]; + 76 [label="Function call: R|/b|.#()"]; + 77 [label="Exit block"]; + } + 78 [label="Exit when branch result"]; + 79 [label="Exit when"]; + } + 80 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 56 -> {57}; 57 -> {58}; 58 -> {59}; - - subgraph cluster_17 { - color=red - 60 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_18 { - color=blue - 61 [label="Enter block"]; - subgraph cluster_19 { - color=blue - 62 [label="Enter when"]; - subgraph cluster_20 { - color=blue - 63 [label="Enter when branch condition "]; - 64 [label="Access variable R|/b|"]; - 65 [label="Const: Boolean(true)"]; - 66 [label="Operator =="]; - 67 [label="Const: Boolean(false)"]; - 68 [label="Operator =="]; - 69 [label="Exit when branch condition"]; - } - subgraph cluster_21 { - color=blue - 70 [label="Enter when branch condition else"]; - 71 [label="Exit when branch condition"]; - } - 72 [label="Enter when branch result"]; - subgraph cluster_22 { - color=blue - 73 [label="Enter block"]; - 74 [label="Access variable R|/b|"]; - 75 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 76 [label="Exit block"]; - } - 77 [label="Exit when branch result"]; - 78 [label="Enter when branch result"]; - subgraph cluster_23 { - color=blue - 79 [label="Enter block"]; - 80 [label="Access variable R|/b|"]; - 81 [label="Function call: R|/b|.#()"]; - 82 [label="Exit block"]; - } - 83 [label="Exit when branch result"]; - 84 [label="Exit when"]; - } - 85 [label="Exit block"]; - } - 86 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; - 64 -> {65}; + 64 -> {73 65}; 65 -> {66}; 66 -> {67}; 67 -> {68}; 68 -> {69}; - 69 -> {78 70}; + 69 -> {70}; 70 -> {71}; 71 -> {72}; - 72 -> {73}; + 72 -> {79}; 73 -> {74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; - 77 -> {84}; + 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {81}; + + subgraph cluster_21 { + color=red + 81 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_22 { + color=blue + 82 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 83 [label="Enter when branch condition "]; + 84 [label="Access variable R|/b|"]; + 85 [label="Const: Boolean(true)"]; + 86 [label="Operator =="]; + 87 [label="Const: Boolean(false)"]; + 88 [label="Operator !="]; + 89 [label="Exit when branch condition"]; + } + subgraph cluster_24 { + color=blue + 90 [label="Enter when branch condition else"]; + 91 [label="Exit when branch condition"]; + } + 92 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 93 [label="Enter block"]; + 94 [label="Access variable R|/b|"]; + 95 [label="Function call: R|/b|.#()"]; + 96 [label="Exit block"]; + } + 97 [label="Exit when branch result"]; + 98 [label="Enter when branch result"]; + subgraph cluster_26 { + color=blue + 99 [label="Enter block"]; + 100 [label="Access variable R|/b|"]; + 101 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 102 [label="Exit block"]; + } + 103 [label="Exit when branch result"]; + 104 [label="Exit when"]; + } + 105 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 81 -> {82}; 82 -> {83}; 83 -> {84}; 84 -> {85}; 85 -> {86}; - - subgraph cluster_24 { - color=red - 87 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_25 { - color=blue - 88 [label="Enter block"]; - subgraph cluster_26 { - color=blue - 89 [label="Enter when"]; - subgraph cluster_27 { - color=blue - 90 [label="Enter when branch condition "]; - 91 [label="Access variable R|/b|"]; - 92 [label="Const: Boolean(true)"]; - 93 [label="Operator =="]; - 94 [label="Const: Boolean(false)"]; - 95 [label="Operator !="]; - 96 [label="Exit when branch condition"]; - } - subgraph cluster_28 { - color=blue - 97 [label="Enter when branch condition else"]; - 98 [label="Exit when branch condition"]; - } - 99 [label="Enter when branch result"]; - subgraph cluster_29 { - color=blue - 100 [label="Enter block"]; - 101 [label="Access variable R|/b|"]; - 102 [label="Function call: R|/b|.#()"]; - 103 [label="Exit block"]; - } - 104 [label="Exit when branch result"]; - 105 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 106 [label="Enter block"]; - 107 [label="Access variable R|/b|"]; - 108 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 109 [label="Exit block"]; - } - 110 [label="Exit when branch result"]; - 111 [label="Exit when"]; - } - 112 [label="Exit block"]; - } - 113 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 86 -> {87}; 87 -> {88}; 88 -> {89}; - 89 -> {90}; + 89 -> {98 90}; 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; 95 -> {96}; - 96 -> {105 97}; - 97 -> {98}; + 96 -> {97}; + 97 -> {104}; 98 -> {99}; 99 -> {100}; 100 -> {101}; 101 -> {102}; 102 -> {103}; 103 -> {104}; - 104 -> {111}; - 105 -> {106}; + 104 -> {105}; + + subgraph cluster_27 { + color=red + 106 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_28 { + color=blue + 107 [label="Enter when"]; + subgraph cluster_29 { + color=blue + 108 [label="Enter when branch condition "]; + 109 [label="Access variable R|/b|"]; + 110 [label="Const: Boolean(true)"]; + 111 [label="Operator !="]; + 112 [label="Const: Boolean(true)"]; + 113 [label="Operator =="]; + 114 [label="Exit when branch condition"]; + } + subgraph cluster_30 { + color=blue + 115 [label="Enter when branch condition else"]; + 116 [label="Exit when branch condition"]; + } + 117 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 118 [label="Enter block"]; + 119 [label="Access variable R|/b|"]; + 120 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 121 [label="Exit block"]; + } + 122 [label="Exit when branch result"]; + 123 [label="Enter when branch result"]; + subgraph cluster_32 { + color=blue + 124 [label="Enter block"]; + 125 [label="Access variable R|/b|"]; + 126 [label="Function call: R|/b|.#()"]; + 127 [label="Exit block"]; + } + 128 [label="Exit when branch result"]; + 129 [label="Exit when"]; + } + 130 [label="Exit function test_5" style="filled" fillcolor=red]; + } + 106 -> {107}; 107 -> {108}; 108 -> {109}; @@ -330,57 +354,8 @@ digraph equalsToBoolean_kt { 110 -> {111}; 111 -> {112}; 112 -> {113}; - - subgraph cluster_31 { - color=red - 114 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_32 { - color=blue - 115 [label="Enter block"]; - subgraph cluster_33 { - color=blue - 116 [label="Enter when"]; - subgraph cluster_34 { - color=blue - 117 [label="Enter when branch condition "]; - 118 [label="Access variable R|/b|"]; - 119 [label="Const: Boolean(true)"]; - 120 [label="Operator !="]; - 121 [label="Const: Boolean(true)"]; - 122 [label="Operator =="]; - 123 [label="Exit when branch condition"]; - } - subgraph cluster_35 { - color=blue - 124 [label="Enter when branch condition else"]; - 125 [label="Exit when branch condition"]; - } - 126 [label="Enter when branch result"]; - subgraph cluster_36 { - color=blue - 127 [label="Enter block"]; - 128 [label="Access variable R|/b|"]; - 129 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 130 [label="Exit block"]; - } - 131 [label="Exit when branch result"]; - 132 [label="Enter when branch result"]; - subgraph cluster_37 { - color=blue - 133 [label="Enter block"]; - 134 [label="Access variable R|/b|"]; - 135 [label="Function call: R|/b|.#()"]; - 136 [label="Exit block"]; - } - 137 [label="Exit when branch result"]; - 138 [label="Exit when"]; - } - 139 [label="Exit block"]; - } - 140 [label="Exit function test_5" style="filled" fillcolor=red]; - } - - 114 -> {115}; + 113 -> {114}; + 114 -> {123 115}; 115 -> {116}; 116 -> {117}; 117 -> {118}; @@ -388,16 +363,60 @@ digraph equalsToBoolean_kt { 119 -> {120}; 120 -> {121}; 121 -> {122}; - 122 -> {123}; - 123 -> {132 124}; + 122 -> {129}; + 123 -> {124}; 124 -> {125}; 125 -> {126}; 126 -> {127}; 127 -> {128}; 128 -> {129}; 129 -> {130}; - 130 -> {131}; - 131 -> {138}; + + subgraph cluster_33 { + color=red + 131 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_34 { + color=blue + 132 [label="Enter when"]; + subgraph cluster_35 { + color=blue + 133 [label="Enter when branch condition "]; + 134 [label="Access variable R|/b|"]; + 135 [label="Const: Boolean(true)"]; + 136 [label="Operator !="]; + 137 [label="Const: Boolean(true)"]; + 138 [label="Operator !="]; + 139 [label="Exit when branch condition"]; + } + subgraph cluster_36 { + color=blue + 140 [label="Enter when branch condition else"]; + 141 [label="Exit when branch condition"]; + } + 142 [label="Enter when branch result"]; + subgraph cluster_37 { + color=blue + 143 [label="Enter block"]; + 144 [label="Access variable R|/b|"]; + 145 [label="Function call: R|/b|.#()"]; + 146 [label="Exit block"]; + } + 147 [label="Exit when branch result"]; + 148 [label="Enter when branch result"]; + subgraph cluster_38 { + color=blue + 149 [label="Enter block"]; + 150 [label="Access variable R|/b|"]; + 151 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 152 [label="Exit block"]; + } + 153 [label="Exit when branch result"]; + 154 [label="Exit when"]; + } + 155 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 131 -> {132}; 132 -> {133}; 133 -> {134}; 134 -> {135}; @@ -405,234 +424,159 @@ digraph equalsToBoolean_kt { 136 -> {137}; 137 -> {138}; 138 -> {139}; - 139 -> {140}; - - subgraph cluster_38 { - color=red - 141 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_39 { - color=blue - 142 [label="Enter block"]; - subgraph cluster_40 { - color=blue - 143 [label="Enter when"]; - subgraph cluster_41 { - color=blue - 144 [label="Enter when branch condition "]; - 145 [label="Access variable R|/b|"]; - 146 [label="Const: Boolean(true)"]; - 147 [label="Operator !="]; - 148 [label="Const: Boolean(true)"]; - 149 [label="Operator !="]; - 150 [label="Exit when branch condition"]; - } - subgraph cluster_42 { - color=blue - 151 [label="Enter when branch condition else"]; - 152 [label="Exit when branch condition"]; - } - 153 [label="Enter when branch result"]; - subgraph cluster_43 { - color=blue - 154 [label="Enter block"]; - 155 [label="Access variable R|/b|"]; - 156 [label="Function call: R|/b|.#()"]; - 157 [label="Exit block"]; - } - 158 [label="Exit when branch result"]; - 159 [label="Enter when branch result"]; - subgraph cluster_44 { - color=blue - 160 [label="Enter block"]; - 161 [label="Access variable R|/b|"]; - 162 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 163 [label="Exit block"]; - } - 164 [label="Exit when branch result"]; - 165 [label="Exit when"]; - } - 166 [label="Exit block"]; - } - 167 [label="Exit function test_6" style="filled" fillcolor=red]; - } - + 139 -> {148 140}; + 140 -> {141}; 141 -> {142}; 142 -> {143}; 143 -> {144}; 144 -> {145}; 145 -> {146}; 146 -> {147}; - 147 -> {148}; + 147 -> {154}; 148 -> {149}; 149 -> {150}; - 150 -> {159 151}; + 150 -> {151}; 151 -> {152}; 152 -> {153}; 153 -> {154}; 154 -> {155}; - 155 -> {156}; + + subgraph cluster_39 { + color=red + 156 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_40 { + color=blue + 157 [label="Enter when"]; + subgraph cluster_41 { + color=blue + 158 [label="Enter when branch condition "]; + 159 [label="Access variable R|/b|"]; + 160 [label="Const: Boolean(true)"]; + 161 [label="Operator !="]; + 162 [label="Const: Boolean(false)"]; + 163 [label="Operator =="]; + 164 [label="Exit when branch condition"]; + } + subgraph cluster_42 { + color=blue + 165 [label="Enter when branch condition else"]; + 166 [label="Exit when branch condition"]; + } + 167 [label="Enter when branch result"]; + subgraph cluster_43 { + color=blue + 168 [label="Enter block"]; + 169 [label="Access variable R|/b|"]; + 170 [label="Function call: R|/b|.#()"]; + 171 [label="Exit block"]; + } + 172 [label="Exit when branch result"]; + 173 [label="Enter when branch result"]; + subgraph cluster_44 { + color=blue + 174 [label="Enter block"]; + 175 [label="Access variable R|/b|"]; + 176 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 177 [label="Exit block"]; + } + 178 [label="Exit when branch result"]; + 179 [label="Exit when"]; + } + 180 [label="Exit function test_7" style="filled" fillcolor=red]; + } + 156 -> {157}; 157 -> {158}; - 158 -> {165}; + 158 -> {159}; 159 -> {160}; 160 -> {161}; 161 -> {162}; 162 -> {163}; 163 -> {164}; - 164 -> {165}; + 164 -> {173 165}; 165 -> {166}; 166 -> {167}; - - subgraph cluster_45 { - color=red - 168 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_46 { - color=blue - 169 [label="Enter block"]; - subgraph cluster_47 { - color=blue - 170 [label="Enter when"]; - subgraph cluster_48 { - color=blue - 171 [label="Enter when branch condition "]; - 172 [label="Access variable R|/b|"]; - 173 [label="Const: Boolean(true)"]; - 174 [label="Operator !="]; - 175 [label="Const: Boolean(false)"]; - 176 [label="Operator =="]; - 177 [label="Exit when branch condition"]; - } - subgraph cluster_49 { - color=blue - 178 [label="Enter when branch condition else"]; - 179 [label="Exit when branch condition"]; - } - 180 [label="Enter when branch result"]; - subgraph cluster_50 { - color=blue - 181 [label="Enter block"]; - 182 [label="Access variable R|/b|"]; - 183 [label="Function call: R|/b|.#()"]; - 184 [label="Exit block"]; - } - 185 [label="Exit when branch result"]; - 186 [label="Enter when branch result"]; - subgraph cluster_51 { - color=blue - 187 [label="Enter block"]; - 188 [label="Access variable R|/b|"]; - 189 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 190 [label="Exit block"]; - } - 191 [label="Exit when branch result"]; - 192 [label="Exit when"]; - } - 193 [label="Exit block"]; - } - 194 [label="Exit function test_7" style="filled" fillcolor=red]; - } - + 167 -> {168}; 168 -> {169}; 169 -> {170}; 170 -> {171}; 171 -> {172}; - 172 -> {173}; + 172 -> {179}; 173 -> {174}; 174 -> {175}; 175 -> {176}; 176 -> {177}; - 177 -> {186 178}; + 177 -> {178}; 178 -> {179}; 179 -> {180}; - 180 -> {181}; + + subgraph cluster_45 { + color=red + 181 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_46 { + color=blue + 182 [label="Enter when"]; + subgraph cluster_47 { + color=blue + 183 [label="Enter when branch condition "]; + 184 [label="Access variable R|/b|"]; + 185 [label="Const: Boolean(true)"]; + 186 [label="Operator !="]; + 187 [label="Const: Boolean(false)"]; + 188 [label="Operator !="]; + 189 [label="Exit when branch condition"]; + } + subgraph cluster_48 { + color=blue + 190 [label="Enter when branch condition else"]; + 191 [label="Exit when branch condition"]; + } + 192 [label="Enter when branch result"]; + subgraph cluster_49 { + color=blue + 193 [label="Enter block"]; + 194 [label="Access variable R|/b|"]; + 195 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 196 [label="Exit block"]; + } + 197 [label="Exit when branch result"]; + 198 [label="Enter when branch result"]; + subgraph cluster_50 { + color=blue + 199 [label="Enter block"]; + 200 [label="Access variable R|/b|"]; + 201 [label="Function call: R|/b|.#()"]; + 202 [label="Exit block"]; + } + 203 [label="Exit when branch result"]; + 204 [label="Exit when"]; + } + 205 [label="Exit function test_8" style="filled" fillcolor=red]; + } + 181 -> {182}; 182 -> {183}; 183 -> {184}; 184 -> {185}; - 185 -> {192}; + 185 -> {186}; 186 -> {187}; 187 -> {188}; 188 -> {189}; - 189 -> {190}; + 189 -> {198 190}; 190 -> {191}; 191 -> {192}; 192 -> {193}; 193 -> {194}; - - subgraph cluster_52 { - color=red - 195 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_53 { - color=blue - 196 [label="Enter block"]; - subgraph cluster_54 { - color=blue - 197 [label="Enter when"]; - subgraph cluster_55 { - color=blue - 198 [label="Enter when branch condition "]; - 199 [label="Access variable R|/b|"]; - 200 [label="Const: Boolean(true)"]; - 201 [label="Operator !="]; - 202 [label="Const: Boolean(false)"]; - 203 [label="Operator !="]; - 204 [label="Exit when branch condition"]; - } - subgraph cluster_56 { - color=blue - 205 [label="Enter when branch condition else"]; - 206 [label="Exit when branch condition"]; - } - 207 [label="Enter when branch result"]; - subgraph cluster_57 { - color=blue - 208 [label="Enter block"]; - 209 [label="Access variable R|/b|"]; - 210 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 211 [label="Exit block"]; - } - 212 [label="Exit when branch result"]; - 213 [label="Enter when branch result"]; - subgraph cluster_58 { - color=blue - 214 [label="Enter block"]; - 215 [label="Access variable R|/b|"]; - 216 [label="Function call: R|/b|.#()"]; - 217 [label="Exit block"]; - } - 218 [label="Exit when branch result"]; - 219 [label="Exit when"]; - } - 220 [label="Exit block"]; - } - 221 [label="Exit function test_8" style="filled" fillcolor=red]; - } - + 194 -> {195}; 195 -> {196}; 196 -> {197}; - 197 -> {198}; + 197 -> {204}; 198 -> {199}; 199 -> {200}; 200 -> {201}; 201 -> {202}; 202 -> {203}; 203 -> {204}; - 204 -> {213 205}; - 205 -> {206}; - 206 -> {207}; - 207 -> {208}; - 208 -> {209}; - 209 -> {210}; - 210 -> {211}; - 211 -> {212}; - 212 -> {219}; - 213 -> {214}; - 214 -> {215}; - 215 -> {216}; - 216 -> {217}; - 217 -> {218}; - 218 -> {219}; - 219 -> {220}; - 220 -> {221}; + 204 -> {205}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot index eb27564dcab..a671e9c1016 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot @@ -8,56 +8,53 @@ digraph implicitReceiverAsWhenSubject_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; + 2 [label="Access variable this@R|/test_1|"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - 3 [label="Access variable this@R|/test_1|"]; - subgraph cluster_3 { - color=blue - 4 [label="Enter when branch condition "]; - 5 [label="Type operator: List<*>"]; - 6 [label="Exit when branch condition"]; - } - subgraph cluster_4 { - color=blue - 7 [label="Enter when branch condition "]; - 8 [label="Type operator: String"]; - 9 [label="Exit when branch condition"]; - } - subgraph cluster_5 { - color=blue - 10 [label="Enter when branch condition else"]; - 11 [label="Exit when branch condition"]; - } - 12 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 13 [label="Enter block"]; - 14 [label="Const: Int(0)"]; - 15 [label="Exit block"]; - } - 16 [label="Exit when branch result"]; - 17 [label="Enter when branch result"]; - subgraph cluster_7 { - color=blue - 18 [label="Enter block"]; - 19 [label="Access variable R|kotlin/String.length|"]; - 20 [label="Exit block"]; - } - 21 [label="Exit when branch result"]; - 22 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 23 [label="Enter block"]; - 24 [label="Access variable this@R|/test_1|"]; - 25 [label="Access variable R|kotlin/collections/List.size|"]; - 26 [label="Exit block"]; - } - 27 [label="Exit when branch result"]; - 28 [label="Exit when"]; + 3 [label="Enter when branch condition "]; + 4 [label="Type operator: List<*>"]; + 5 [label="Exit when branch condition"]; } - 29 [label="Jump: ^test_1 when (this@R|/test_1|) { + subgraph cluster_3 { + color=blue + 6 [label="Enter when branch condition "]; + 7 [label="Type operator: String"]; + 8 [label="Exit when branch condition"]; + } + subgraph cluster_4 { + color=blue + 9 [label="Enter when branch condition else"]; + 10 [label="Exit when branch condition"]; + } + 11 [label="Enter when branch result"]; + subgraph cluster_5 { + color=blue + 12 [label="Enter block"]; + 13 [label="Const: Int(0)"]; + 14 [label="Exit block"]; + } + 15 [label="Exit when branch result"]; + 16 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 17 [label="Enter block"]; + 18 [label="Access variable R|kotlin/String.length|"]; + 19 [label="Exit block"]; + } + 20 [label="Exit when branch result"]; + 21 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 22 [label="Enter block"]; + 23 [label="Access variable this@R|/test_1|"]; + 24 [label="Access variable R|kotlin/collections/List.size|"]; + 25 [label="Exit block"]; + } + 26 [label="Exit when branch result"]; + 27 [label="Exit when"]; + } + 28 [label="Jump: ^test_1 when (this@R|/test_1|) { ($subj$ is R|kotlin/collections/List<*>|) -> { this@R|/test_1|.R|kotlin/collections/List.size| } @@ -69,10 +66,8 @@ digraph implicitReceiverAsWhenSubject_kt { } } "]; - 30 [label="Stub" style="filled" fillcolor=gray]; - 31 [label="Exit block" style="filled" fillcolor=gray]; - } - 32 [label="Exit function test_1" style="filled" fillcolor=red]; + 29 [label="Stub" style="filled" fillcolor=gray]; + 30 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -80,95 +75,90 @@ digraph implicitReceiverAsWhenSubject_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {22 7}; + 5 -> {21 6}; + 6 -> {7}; 7 -> {8}; - 8 -> {9}; - 9 -> {17 10}; + 8 -> {16 9}; + 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; - 15 -> {16}; - 16 -> {28}; + 15 -> {27}; + 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {28}; + 20 -> {27}; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; - 28 -> {29}; - 29 -> {32}; + 28 -> {30}; + 28 -> {29} [style=dotted]; 29 -> {30} [style=dotted]; - 30 -> {31} [style=dotted]; - 31 -> {32} [style=dotted]; - subgraph cluster_9 { + subgraph cluster_8 { color=red - 33 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { + 31 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 34 [label="Enter block"]; + 32 [label="Enter when"]; + 33 [label="Access variable this@R|/test_2|"]; + 34 [label="Variable declaration: lval x: R|kotlin/Any|"]; + subgraph cluster_10 { + color=blue + 35 [label="Enter when branch condition "]; + 36 [label="Type operator: List<*>"]; + 37 [label="Exit when branch condition"]; + } subgraph cluster_11 { color=blue - 35 [label="Enter when"]; - 36 [label="Access variable this@R|/test_2|"]; - 37 [label="Variable declaration: lval x: R|kotlin/Any|"]; - subgraph cluster_12 { - color=blue - 38 [label="Enter when branch condition "]; - 39 [label="Type operator: List<*>"]; - 40 [label="Exit when branch condition"]; - } - subgraph cluster_13 { - color=blue - 41 [label="Enter when branch condition "]; - 42 [label="Type operator: String"]; - 43 [label="Exit when branch condition"]; - } - subgraph cluster_14 { - color=blue - 44 [label="Enter when branch condition else"]; - 45 [label="Exit when branch condition"]; - } - 46 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 47 [label="Enter block"]; - 48 [label="Const: Int(0)"]; - 49 [label="Exit block"]; - } - 50 [label="Exit when branch result"]; - 51 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 52 [label="Enter block"]; - 53 [label="Access variable R|/x|"]; - 54 [label="Access variable R|kotlin/String.length|"]; - 55 [label="Access variable R|kotlin/String.length|"]; - 56 [label="Exit block"]; - } - 57 [label="Exit when branch result"]; - 58 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 59 [label="Enter block"]; - 60 [label="Access variable R|/x|"]; - 61 [label="Access variable R|kotlin/collections/List.size|"]; - 62 [label="Access variable this@R|/test_2|"]; - 63 [label="Access variable R|kotlin/collections/List.size|"]; - 64 [label="Exit block"]; - } - 65 [label="Exit when branch result"]; - 66 [label="Exit when"]; + 38 [label="Enter when branch condition "]; + 39 [label="Type operator: String"]; + 40 [label="Exit when branch condition"]; } - 67 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) { + subgraph cluster_12 { + color=blue + 41 [label="Enter when branch condition else"]; + 42 [label="Exit when branch condition"]; + } + 43 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 44 [label="Enter block"]; + 45 [label="Const: Int(0)"]; + 46 [label="Exit block"]; + } + 47 [label="Exit when branch result"]; + 48 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Access variable R|kotlin/String.length|"]; + 52 [label="Access variable R|kotlin/String.length|"]; + 53 [label="Exit block"]; + } + 54 [label="Exit when branch result"]; + 55 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 56 [label="Enter block"]; + 57 [label="Access variable R|/x|"]; + 58 [label="Access variable R|kotlin/collections/List.size|"]; + 59 [label="Access variable this@R|/test_2|"]; + 60 [label="Access variable R|kotlin/collections/List.size|"]; + 61 [label="Exit block"]; + } + 62 [label="Exit when branch result"]; + 63 [label="Exit when"]; + } + 64 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) { ($subj$ is R|kotlin/collections/List<*>|) -> { R|/x|.R|kotlin/collections/List.size| this@R|/test_2|.R|kotlin/collections/List.size| @@ -182,49 +172,45 @@ digraph implicitReceiverAsWhenSubject_kt { } } "]; - 68 [label="Stub" style="filled" fillcolor=gray]; - 69 [label="Exit block" style="filled" fillcolor=gray]; - } - 70 [label="Exit function test_2" style="filled" fillcolor=red]; + 65 [label="Stub" style="filled" fillcolor=gray]; + 66 [label="Exit function test_2" style="filled" fillcolor=red]; } + 31 -> {32}; + 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {36}; 36 -> {37}; - 37 -> {38}; + 37 -> {55 38}; 38 -> {39}; 39 -> {40}; - 40 -> {58 41}; + 40 -> {48 41}; 41 -> {42}; 42 -> {43}; - 43 -> {51 44}; + 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; + 47 -> {63}; 48 -> {49}; 49 -> {50}; - 50 -> {66}; + 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {55}; + 54 -> {63}; 55 -> {56}; 56 -> {57}; - 57 -> {66}; + 57 -> {58}; 58 -> {59}; 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {70}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; + 64 -> {66}; + 64 -> {65} [style=dotted]; + 65 -> {66} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot index 2da8b477012..d711997bbc9 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot @@ -14,243 +14,199 @@ digraph implicitReceivers_kt { subgraph cluster_1 { color=red 2 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 3 [label="Enter block"]; - 4 [label="Exit block"]; - } - 5 [label="Exit function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } 2 -> {3}; - 3 -> {4}; + + subgraph cluster_2 { + color=red + 4 [label="Enter function with" style="filled" fillcolor=red]; + 5 [label="Exit function with" style="filled" fillcolor=red]; + } + 4 -> {5}; subgraph cluster_3 { color=red - 6 [label="Enter function with" style="filled" fillcolor=red]; + 6 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_4 { color=blue - 7 [label="Enter block"]; - 8 [label="Exit block"]; + 7 [label="Enter when"]; + subgraph cluster_5 { + color=blue + 8 [label="Enter when branch condition "]; + 9 [label="Access variable this@R|/test_1|"]; + 10 [label="Type operator: this is A"]; + 11 [label="Exit when branch condition"]; + } + subgraph cluster_6 { + color=blue + 12 [label="Enter when branch condition else"]; + 13 [label="Exit when branch condition"]; + } + 14 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 15 [label="Enter block"]; + 16 [label="Access variable this@R|/test_1|"]; + 17 [label="Function call: this@R|/test_1|.#()"]; + 18 [label="Function call: #()"]; + 19 [label="Exit block"]; + } + 20 [label="Exit when branch result"]; + 21 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 22 [label="Enter block"]; + 23 [label="Access variable this@R|/test_1|"]; + 24 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; + 25 [label="Function call: this@R|/A|.R|/A.foo|()"]; + 26 [label="Exit block"]; + } + 27 [label="Exit when branch result"]; + 28 [label="Exit when"]; } - 9 [label="Exit function with" style="filled" fillcolor=red]; + 29 [label="Access variable this@R|/test_1|"]; + 30 [label="Function call: this@R|/test_1|.#()"]; + 31 [label="Function call: #()"]; + 32 [label="Exit function test_1" style="filled" fillcolor=red]; } 6 -> {7}; 7 -> {8}; 8 -> {9}; - - subgraph cluster_5 { - color=red - 10 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 11 [label="Enter block"]; - subgraph cluster_7 { - color=blue - 12 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 13 [label="Enter when branch condition "]; - 14 [label="Access variable this@R|/test_1|"]; - 15 [label="Type operator: this is A"]; - 16 [label="Exit when branch condition"]; - } - subgraph cluster_9 { - color=blue - 17 [label="Enter when branch condition else"]; - 18 [label="Exit when branch condition"]; - } - 19 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 20 [label="Enter block"]; - 21 [label="Access variable this@R|/test_1|"]; - 22 [label="Function call: this@R|/test_1|.#()"]; - 23 [label="Function call: #()"]; - 24 [label="Exit block"]; - } - 25 [label="Exit when branch result"]; - 26 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 27 [label="Enter block"]; - 28 [label="Access variable this@R|/test_1|"]; - 29 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; - 30 [label="Function call: this@R|/A|.R|/A.foo|()"]; - 31 [label="Exit block"]; - } - 32 [label="Exit when branch result"]; - 33 [label="Exit when"]; - } - 34 [label="Access variable this@R|/test_1|"]; - 35 [label="Function call: this@R|/test_1|.#()"]; - 36 [label="Function call: #()"]; - 37 [label="Exit block"]; - } - 38 [label="Exit function test_1" style="filled" fillcolor=red]; - } - + 9 -> {10}; 10 -> {11}; - 11 -> {12}; + 11 -> {21 12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {26 17}; + 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; + 20 -> {28}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; - 25 -> {33}; + 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; + + subgraph cluster_9 { + color=red + 33 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 34 [label="Enter when"]; + subgraph cluster_11 { + color=blue + 35 [label="Enter when branch condition "]; + 36 [label="Access variable this@R|/test_2|"]; + 37 [label="Type operator: this !is A"]; + 38 [label="Exit when branch condition"]; + } + subgraph cluster_12 { + color=blue + 39 [label="Enter when branch condition else"]; + 40 [label="Exit when branch condition"]; + } + 41 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 42 [label="Enter block"]; + 43 [label="Access variable this@R|/test_2|"]; + 44 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; + 45 [label="Function call: this@R|/A|.R|/A.foo|()"]; + 46 [label="Exit block"]; + } + 47 [label="Exit when branch result"]; + 48 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable this@R|/test_2|"]; + 51 [label="Function call: this@R|/test_2|.#()"]; + 52 [label="Function call: #()"]; + 53 [label="Exit block"]; + } + 54 [label="Exit when branch result"]; + 55 [label="Exit when"]; + } + 56 [label="Access variable this@R|/test_2|"]; + 57 [label="Function call: this@R|/test_2|.#()"]; + 58 [label="Function call: #()"]; + 59 [label="Exit function test_2" style="filled" fillcolor=red]; + } + 33 -> {34}; 34 -> {35}; 35 -> {36}; 36 -> {37}; 37 -> {38}; - - subgraph cluster_12 { - color=red - 39 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 40 [label="Enter block"]; - subgraph cluster_14 { - color=blue - 41 [label="Enter when"]; - subgraph cluster_15 { - color=blue - 42 [label="Enter when branch condition "]; - 43 [label="Access variable this@R|/test_2|"]; - 44 [label="Type operator: this !is A"]; - 45 [label="Exit when branch condition"]; - } - subgraph cluster_16 { - color=blue - 46 [label="Enter when branch condition else"]; - 47 [label="Exit when branch condition"]; - } - 48 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 49 [label="Enter block"]; - 50 [label="Access variable this@R|/test_2|"]; - 51 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; - 52 [label="Function call: this@R|/A|.R|/A.foo|()"]; - 53 [label="Exit block"]; - } - 54 [label="Exit when branch result"]; - 55 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 56 [label="Enter block"]; - 57 [label="Access variable this@R|/test_2|"]; - 58 [label="Function call: this@R|/test_2|.#()"]; - 59 [label="Function call: #()"]; - 60 [label="Exit block"]; - } - 61 [label="Exit when branch result"]; - 62 [label="Exit when"]; - } - 63 [label="Access variable this@R|/test_2|"]; - 64 [label="Function call: this@R|/test_2|.#()"]; - 65 [label="Function call: #()"]; - 66 [label="Exit block"]; - } - 67 [label="Exit function test_2" style="filled" fillcolor=red]; - } - + 38 -> {48 39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {55 46}; + 45 -> {46}; 46 -> {47}; - 47 -> {48}; + 47 -> {55}; 48 -> {49}; 49 -> {50}; 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {62}; + 54 -> {55}; 55 -> {56}; 56 -> {57}; 57 -> {58}; 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - subgraph cluster_19 { + subgraph cluster_15 { color=red - 68 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_20 { + 60 [label="Enter function test_3" style="filled" fillcolor=red]; + 61 [label="Access variable R|/a|"]; + subgraph cluster_16 { color=blue - 69 [label="Enter block"]; - 70 [label="Access variable R|/a|"]; - subgraph cluster_21 { + 62 [label="Enter function anonymousFunction"]; + 63 [label="Access variable R|/b|"]; + subgraph cluster_17 { color=blue - 71 [label="Enter function anonymousFunction"]; - subgraph cluster_22 { + 64 [label="Enter function anonymousFunction"]; + 65 [label="Access variable R|/c|"]; + subgraph cluster_18 { color=blue - 72 [label="Enter block"]; - 73 [label="Access variable R|/b|"]; - subgraph cluster_23 { - color=blue - 74 [label="Enter function anonymousFunction"]; - subgraph cluster_24 { - color=blue - 75 [label="Enter block"]; - 76 [label="Access variable R|/c|"]; - subgraph cluster_25 { - color=blue - 77 [label="Enter function anonymousFunction"]; - subgraph cluster_26 { - color=blue - 78 [label="Enter block"]; - 79 [label="Access variable this@R|special/anonymous|"]; - 80 [label="Type operator: this@wb as A"]; - 81 [label="Access variable this@R|special/anonymous|"]; - 82 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 83 [label="Function call: this@R|/A|.R|/A.foo|()"]; - 84 [label="Exit block"]; - } - 85 [label="Exit function anonymousFunction"]; - } - 86 [label="Function call: R|kotlin/with|(R|/c|, = wc@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 66 [label="Enter function anonymousFunction"]; + 67 [label="Access variable this@R|special/anonymous|"]; + 68 [label="Type operator: this@wb as A"]; + 69 [label="Access variable this@R|special/anonymous|"]; + 70 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 71 [label="Function call: this@R|/A|.R|/A.foo|()"]; + 72 [label="Exit function anonymousFunction"]; + } + 73 [label="Function call: R|kotlin/with|(R|/c|, = wc@fun R|kotlin/Any|.(): R|kotlin/Unit| { (this@R|special/anonymous| as R|A|) this@R|special/anonymous|.R|/A.foo|() this@R|/A|.R|/A.foo|() } )"]; - 87 [label="Access variable this@R|special/anonymous|"]; - 88 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 89 [label="Function call: this@R|/A|.R|/A.foo|()"]; - 90 [label="Exit block"]; - } - 91 [label="Exit function anonymousFunction"]; - } - 92 [label="Function call: R|kotlin/with|(R|/b|, = wb@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 74 [label="Access variable this@R|special/anonymous|"]; + 75 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 76 [label="Function call: this@R|/A|.R|/A.foo|()"]; + 77 [label="Exit function anonymousFunction"]; + } + 78 [label="Function call: R|kotlin/with|(R|/b|, = wb@fun R|kotlin/Any|.(): R|kotlin/Unit| { R|kotlin/with|(R|/c|, = wc@fun R|kotlin/Any|.(): R|kotlin/Unit| { (this@R|special/anonymous| as R|A|) this@R|special/anonymous|.R|/A.foo|() @@ -261,11 +217,9 @@ digraph implicitReceivers_kt { this@R|/A|.R|/A.foo|() } )"]; - 93 [label="Exit block"]; - } - 94 [label="Exit function anonymousFunction"]; - } - 95 [label="Function call: R|kotlin/with|(R|/a|, = wa@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 79 [label="Exit function anonymousFunction"]; + } + 80 [label="Function call: R|kotlin/with|(R|/a|, = wa@fun R|kotlin/Any|.(): R|kotlin/Unit| { R|kotlin/with|(R|/b|, = wb@fun R|kotlin/Any|.(): R|kotlin/Unit| { R|kotlin/with|(R|/c|, = wc@fun R|kotlin/Any|.(): R|kotlin/Unit| { (this@R|special/anonymous| as R|A|) @@ -279,11 +233,17 @@ digraph implicitReceivers_kt { ) } )"]; - 96 [label="Exit block"]; - } - 97 [label="Exit function test_3" style="filled" fillcolor=red]; + 81 [label="Exit function test_3" style="filled" fillcolor=red]; } + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; @@ -297,21 +257,5 @@ digraph implicitReceivers_kt { 78 -> {79}; 79 -> {80}; 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot b/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot index 5969091fb16..2481e054886 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot @@ -22,207 +22,158 @@ digraph inPlaceLambdas_kt { subgraph cluster_2 { color=red 4 [label="Enter function run" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 5 [label="Enter block"]; - 6 [label="Function call: R|/block|.R|FakeOverride|()"]; - 7 [label="Exit block"]; - } - 8 [label="Exit function run" style="filled" fillcolor=red]; + 5 [label="Function call: R|/block|.R|FakeOverride|()"]; + 6 [label="Exit function run" style="filled" fillcolor=red]; } 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - subgraph cluster_4 { + subgraph cluster_3 { color=red - 9 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_5 { + 7 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_4 { color=blue - 10 [label="Enter block"]; + 8 [label="Enter when"]; + subgraph cluster_5 { + color=blue + 9 [label="Enter when branch condition "]; + 10 [label="Access variable R|/x|"]; + 11 [label="Type operator: x is A"]; + 12 [label="Exit when branch condition"]; + } + 13 [label="Synthetic else branch"]; + 14 [label="Enter when branch result"]; subgraph cluster_6 { color=blue - 11 [label="Enter when"]; + 15 [label="Enter block"]; subgraph cluster_7 { color=blue - 12 [label="Enter when branch condition "]; - 13 [label="Access variable R|/x|"]; - 14 [label="Type operator: x is A"]; - 15 [label="Exit when branch condition"]; + 16 [label="Enter function anonymousFunction"]; + 17 [label="Access variable R|/x|"]; + 18 [label="Function call: R|/x|.R|/A.foo|()"]; + 19 [label="Exit function anonymousFunction"]; } - 16 [label="Synthetic else branch"]; - 17 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 18 [label="Enter block"]; - subgraph cluster_9 { - color=blue - 19 [label="Enter function anonymousFunction"]; - subgraph cluster_10 { - color=blue - 20 [label="Enter block"]; - 21 [label="Access variable R|/x|"]; - 22 [label="Function call: R|/x|.R|/A.foo|()"]; - 23 [label="Exit block"]; - } - 24 [label="Exit function anonymousFunction"]; - } - 25 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 20 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|/A.foo|() } )"]; - 26 [label="Exit block"]; - } - 27 [label="Exit when branch result"]; - 28 [label="Exit when"]; + 21 [label="Exit block"]; } - 29 [label="Exit block"]; + 22 [label="Exit when branch result"]; + 23 [label="Exit when"]; } - 30 [label="Exit function test_1" style="filled" fillcolor=red]; + 24 [label="Exit function test_1" style="filled" fillcolor=red]; } + 7 -> {8}; + 8 -> {9}; 9 -> {10}; 10 -> {11}; 11 -> {12}; - 12 -> {13}; - 13 -> {14}; + 12 -> {14 13}; + 13 -> {23}; 14 -> {15}; - 15 -> {17 16}; - 16 -> {28}; + 15 -> {16}; + 16 -> {19 17}; 17 -> {18}; 18 -> {19}; - 19 -> {24 20}; + 19 -> {16 20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; - 24 -> {19 25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - subgraph cluster_11 { + subgraph cluster_8 { color=red - 31 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_12 { + 25 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { color=blue - 32 [label="Enter block"]; - subgraph cluster_13 { - color=blue - 33 [label="Enter function anonymousFunction"]; - subgraph cluster_14 { - color=blue - 34 [label="Enter block"]; - 35 [label="Access variable R|/x|"]; - 36 [label="Type operator: x as B"]; - 37 [label="Exit block"]; - } - 38 [label="Exit function anonymousFunction"]; - } - 39 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 26 [label="Enter function anonymousFunction"]; + 27 [label="Access variable R|/x|"]; + 28 [label="Type operator: x as B"]; + 29 [label="Exit function anonymousFunction"]; + } + 30 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { (R|/x| as R|B|) } )"]; - 40 [label="Access variable R|/x|"]; - 41 [label="Function call: R|/x|.R|/B.bar|()"]; - 42 [label="Exit block"]; - } - 43 [label="Exit function test_2" style="filled" fillcolor=red]; + 31 [label="Access variable R|/x|"]; + 32 [label="Function call: R|/x|.R|/B.bar|()"]; + 33 [label="Exit function test_2" style="filled" fillcolor=red]; } + 25 -> {26}; + 26 -> {29 27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {26 30}; + 30 -> {31}; 31 -> {32}; 32 -> {33}; - 33 -> {38 34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {33 39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - subgraph cluster_15 { + subgraph cluster_10 { color=red - 44 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_16 { + 34 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_11 { color=blue - 45 [label="Enter block"]; - subgraph cluster_17 { + 35 [label="Enter when"]; + subgraph cluster_12 { color=blue - 46 [label="Enter when"]; - subgraph cluster_18 { + 36 [label="Enter when branch condition "]; + 37 [label="Access variable R|/x|"]; + 38 [label="Type operator: x is A"]; + 39 [label="Exit when branch condition"]; + } + 40 [label="Synthetic else branch"]; + 41 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 42 [label="Enter block"]; + subgraph cluster_14 { color=blue - 47 [label="Enter when branch condition "]; - 48 [label="Access variable R|/x|"]; - 49 [label="Type operator: x is A"]; - 50 [label="Exit when branch condition"]; + 43 [label="Enter function anonymousFunction"]; + 44 [label="Access variable R|/x|"]; + 45 [label="Function call: R|/x|.R|/A.foo|()"]; + 46 [label="Access variable R|/x|"]; + 47 [label="Type operator: x as B"]; + 48 [label="Exit function anonymousFunction"]; } - 51 [label="Synthetic else branch"]; - 52 [label="Enter when branch result"]; - subgraph cluster_19 { - color=blue - 53 [label="Enter block"]; - subgraph cluster_20 { - color=blue - 54 [label="Enter function anonymousFunction"]; - subgraph cluster_21 { - color=blue - 55 [label="Enter block"]; - 56 [label="Access variable R|/x|"]; - 57 [label="Function call: R|/x|.R|/A.foo|()"]; - 58 [label="Access variable R|/x|"]; - 59 [label="Type operator: x as B"]; - 60 [label="Exit block"]; - } - 61 [label="Exit function anonymousFunction"]; - } - 62 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + 49 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|/A.foo|() (R|/x| as R|B|) } )"]; - 63 [label="Access variable R|/x|"]; - 64 [label="Function call: R|/x|.R|/B.bar|()"]; - 65 [label="Exit block"]; - } - 66 [label="Exit when branch result"]; - 67 [label="Exit when"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Function call: R|/x|.R|/B.bar|()"]; + 52 [label="Exit block"]; } - 68 [label="Exit block"]; + 53 [label="Exit when branch result"]; + 54 [label="Exit when"]; } - 69 [label="Exit function test_3" style="filled" fillcolor=red]; + 55 [label="Exit function test_3" style="filled" fillcolor=red]; } + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {41 40}; + 40 -> {54}; + 41 -> {42}; + 42 -> {43}; + 43 -> {48 44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49}; + 48 -> {43 49}; 49 -> {50}; - 50 -> {52 51}; - 51 -> {67}; + 50 -> {51}; + 51 -> {52}; 52 -> {53}; 53 -> {54}; - 54 -> {61 55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {54 62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; + 54 -> {55}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot index 36e1c72d686..36eef3566f0 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot @@ -72,48 +72,43 @@ digraph nullability_kt { 16 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_9 { color=blue - 17 [label="Enter block"]; + 17 [label="Enter when"]; subgraph cluster_10 { color=blue - 18 [label="Enter when"]; - subgraph cluster_11 { - color=blue - 19 [label="Enter when branch condition "]; - 20 [label="Access variable R|/x|"]; - 21 [label="Const: Null(null)"]; - 22 [label="Operator !="]; - 23 [label="Exit when branch condition"]; - } - subgraph cluster_12 { - color=blue - 24 [label="Enter when branch condition else"]; - 25 [label="Exit when branch condition"]; - } - 26 [label="Enter when branch result"]; - subgraph cluster_13 { - color=blue - 27 [label="Enter block"]; - 28 [label="Access variable R|/x|"]; - 29 [label="Function call: R|/x|.#()"]; - 30 [label="Exit block"]; - } - 31 [label="Exit when branch result"]; - 32 [label="Enter when branch result"]; - subgraph cluster_14 { - color=blue - 33 [label="Enter block"]; - 34 [label="Access variable R|/x|"]; - 35 [label="Function call: R|/x|.R|/A.foo|()"]; - 36 [label="Exit block"]; - } - 37 [label="Exit when branch result"]; - 38 [label="Exit when"]; + 18 [label="Enter when branch condition "]; + 19 [label="Access variable R|/x|"]; + 20 [label="Const: Null(null)"]; + 21 [label="Operator !="]; + 22 [label="Exit when branch condition"]; } - 39 [label="Access variable R|/x|"]; - 40 [label="Function call: R|/x|.#()"]; - 41 [label="Exit block"]; + subgraph cluster_11 { + color=blue + 23 [label="Enter when branch condition else"]; + 24 [label="Exit when branch condition"]; + } + 25 [label="Enter when branch result"]; + subgraph cluster_12 { + color=blue + 26 [label="Enter block"]; + 27 [label="Access variable R|/x|"]; + 28 [label="Function call: R|/x|.#()"]; + 29 [label="Exit block"]; + } + 30 [label="Exit when branch result"]; + 31 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 32 [label="Enter block"]; + 33 [label="Access variable R|/x|"]; + 34 [label="Function call: R|/x|.R|/A.foo|()"]; + 35 [label="Exit block"]; + } + 36 [label="Exit when branch result"]; + 37 [label="Exit when"]; } - 42 [label="Exit function test_1" style="filled" fillcolor=red]; + 38 [label="Access variable R|/x|"]; + 39 [label="Function call: R|/x|.#()"]; + 40 [label="Exit function test_1" style="filled" fillcolor=red]; } 16 -> {17}; @@ -122,16 +117,16 @@ digraph nullability_kt { 19 -> {20}; 20 -> {21}; 21 -> {22}; - 22 -> {23}; - 23 -> {32 24}; + 22 -> {31 23}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; 29 -> {30}; - 30 -> {31}; - 31 -> {38}; + 30 -> {37}; + 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; @@ -140,546 +135,617 @@ digraph nullability_kt { 37 -> {38}; 38 -> {39}; 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - subgraph cluster_15 { + subgraph cluster_14 { color=red - 43 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_16 { + 41 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_15 { color=blue - 44 [label="Enter block"]; + 42 [label="Enter when"]; + subgraph cluster_16 { + color=blue + 43 [label="Enter when branch condition "]; + 44 [label="Access variable R|/x|"]; + 45 [label="Const: Null(null)"]; + 46 [label="Operator =="]; + 47 [label="Exit when branch condition"]; + } subgraph cluster_17 { color=blue - 45 [label="Enter when"]; - subgraph cluster_18 { - color=blue - 46 [label="Enter when branch condition "]; - 47 [label="Access variable R|/x|"]; - 48 [label="Const: Null(null)"]; - 49 [label="Operator =="]; - 50 [label="Exit when branch condition"]; - } - subgraph cluster_19 { - color=blue - 51 [label="Enter when branch condition else"]; - 52 [label="Exit when branch condition"]; - } - 53 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 54 [label="Enter block"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Function call: R|/x|.R|/A.foo|()"]; - 57 [label="Exit block"]; - } - 58 [label="Exit when branch result"]; - 59 [label="Enter when branch result"]; - subgraph cluster_21 { - color=blue - 60 [label="Enter block"]; - 61 [label="Access variable R|/x|"]; - 62 [label="Function call: R|/x|.#()"]; - 63 [label="Exit block"]; - } - 64 [label="Exit when branch result"]; - 65 [label="Exit when"]; + 48 [label="Enter when branch condition else"]; + 49 [label="Exit when branch condition"]; } - 66 [label="Access variable R|/x|"]; - 67 [label="Function call: R|/x|.#()"]; - 68 [label="Exit block"]; + 50 [label="Enter when branch result"]; + subgraph cluster_18 { + color=blue + 51 [label="Enter block"]; + 52 [label="Access variable R|/x|"]; + 53 [label="Function call: R|/x|.R|/A.foo|()"]; + 54 [label="Exit block"]; + } + 55 [label="Exit when branch result"]; + 56 [label="Enter when branch result"]; + subgraph cluster_19 { + color=blue + 57 [label="Enter block"]; + 58 [label="Access variable R|/x|"]; + 59 [label="Function call: R|/x|.#()"]; + 60 [label="Exit block"]; + } + 61 [label="Exit when branch result"]; + 62 [label="Exit when"]; } - 69 [label="Exit function test_2" style="filled" fillcolor=red]; + 63 [label="Access variable R|/x|"]; + 64 [label="Function call: R|/x|.#()"]; + 65 [label="Exit function test_2" style="filled" fillcolor=red]; } + 41 -> {42}; + 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; + 47 -> {56 48}; 48 -> {49}; 49 -> {50}; - 50 -> {59 51}; + 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; - 55 -> {56}; + 55 -> {62}; 56 -> {57}; 57 -> {58}; - 58 -> {65}; + 58 -> {59}; 59 -> {60}; 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; - 65 -> {66}; + + subgraph cluster_20 { + color=red + 66 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_21 { + color=blue + 67 [label="Enter when"]; + 68 [label="Access variable R|/x|"]; + 69 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_22 { + color=blue + 70 [label="Enter when branch condition "]; + 71 [label="Const: Null(null)"]; + 72 [label="Operator =="]; + 73 [label="Exit when branch condition"]; + } + subgraph cluster_23 { + color=blue + 74 [label="Enter when branch condition else"]; + 75 [label="Exit when branch condition"]; + } + 76 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 77 [label="Enter block"]; + 78 [label="Access variable R|/|"]; + 79 [label="Exit block"]; + } + 80 [label="Exit when branch result"]; + 81 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 82 [label="Enter block"]; + 83 [label="Jump: ^test_3 Unit"]; + 84 [label="Stub" style="filled" fillcolor=gray]; + 85 [label="Exit block" style="filled" fillcolor=gray]; + } + 86 [label="Exit when branch result" style="filled" fillcolor=gray]; + 87 [label="Exit when"]; + } + 88 [label="Access variable R|/x|"]; + 89 [label="Function call: R|/x|.R|/A.foo|()"]; + 90 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 66 -> {67}; 67 -> {68}; 68 -> {69}; - - subgraph cluster_22 { - color=red - 70 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_23 { - color=blue - 71 [label="Enter block"]; - subgraph cluster_24 { - color=blue - 72 [label="Enter when"]; - 73 [label="Access variable R|/x|"]; - 74 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_25 { - color=blue - 75 [label="Enter when branch condition "]; - 76 [label="Const: Null(null)"]; - 77 [label="Operator =="]; - 78 [label="Exit when branch condition"]; - } - subgraph cluster_26 { - color=blue - 79 [label="Enter when branch condition else"]; - 80 [label="Exit when branch condition"]; - } - 81 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 82 [label="Enter block"]; - 83 [label="Access variable R|/|"]; - 84 [label="Exit block"]; - } - 85 [label="Exit when branch result"]; - 86 [label="Enter when branch result"]; - subgraph cluster_28 { - color=blue - 87 [label="Enter block"]; - 88 [label="Jump: ^test_3 Unit"]; - 89 [label="Stub" style="filled" fillcolor=gray]; - 90 [label="Exit block" style="filled" fillcolor=gray]; - } - 91 [label="Exit when branch result" style="filled" fillcolor=gray]; - 92 [label="Exit when"]; - } - 93 [label="Access variable R|/x|"]; - 94 [label="Function call: R|/x|.R|/A.foo|()"]; - 95 [label="Exit block"]; - } - 96 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 69 -> {70}; 70 -> {71}; 71 -> {72}; 72 -> {73}; - 73 -> {74}; + 73 -> {81 74}; 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; - 78 -> {86 79}; + 78 -> {79}; 79 -> {80}; - 80 -> {81}; + 80 -> {87}; 81 -> {82}; 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {92}; - 86 -> {87}; + 83 -> {90}; + 83 -> {84} [style=dotted]; + 84 -> {85} [style=dotted]; + 85 -> {86} [style=dotted]; + 86 -> {87} [style=dotted]; 87 -> {88}; - 88 -> {96}; - 88 -> {89} [style=dotted]; - 89 -> {90} [style=dotted]; - 90 -> {91} [style=dotted]; - 91 -> {92} [style=dotted]; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; + 88 -> {89}; + 89 -> {90}; - subgraph cluster_29 { + subgraph cluster_26 { color=red - 97 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_30 { + 91 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_27 { color=blue - 98 [label="Enter block"]; - subgraph cluster_31 { + 92 [label="Enter when"]; + subgraph cluster_28 { color=blue - 99 [label="Enter when"]; - subgraph cluster_32 { - color=blue - 100 [label="Enter when branch condition "]; - 101 [label="Access variable R|/x|"]; - 102 [label="Enter safe call"]; - 103 [label="Function call: R|/x|?.R|/A.getA|()"]; - 104 [label="Exit safe call"]; - 105 [label="Const: Null(null)"]; - 106 [label="Operator =="]; - 107 [label="Exit when branch condition"]; - } - 108 [label="Synthetic else branch"]; - 109 [label="Enter when branch result"]; - subgraph cluster_33 { - color=blue - 110 [label="Enter block"]; - 111 [label="Jump: ^test_4 Unit"]; - 112 [label="Stub" style="filled" fillcolor=gray]; - 113 [label="Exit block" style="filled" fillcolor=gray]; - } - 114 [label="Exit when branch result" style="filled" fillcolor=gray]; - 115 [label="Exit when"]; + 93 [label="Enter when branch condition "]; + 94 [label="Access variable R|/x|"]; + 95 [label="Enter safe call"]; + 96 [label="Function call: R|/x|?.R|/A.getA|()"]; + 97 [label="Exit safe call"]; + 98 [label="Const: Null(null)"]; + 99 [label="Operator =="]; + 100 [label="Exit when branch condition"]; } - 116 [label="Access variable R|/x|"]; - 117 [label="Function call: R|/x|.R|/A.foo|()"]; - 118 [label="Exit block"]; + 101 [label="Synthetic else branch"]; + 102 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 103 [label="Enter block"]; + 104 [label="Jump: ^test_4 Unit"]; + 105 [label="Stub" style="filled" fillcolor=gray]; + 106 [label="Exit block" style="filled" fillcolor=gray]; + } + 107 [label="Exit when branch result" style="filled" fillcolor=gray]; + 108 [label="Exit when"]; } - 119 [label="Exit function test_4" style="filled" fillcolor=red]; + 109 [label="Access variable R|/x|"]; + 110 [label="Function call: R|/x|.R|/A.foo|()"]; + 111 [label="Exit function test_4" style="filled" fillcolor=red]; } + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95 97}; + 95 -> {96}; + 96 -> {97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; - 100 -> {101}; - 101 -> {102 104}; + 100 -> {102 101}; + 101 -> {108}; 102 -> {103}; 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {109 108}; - 108 -> {115}; + 104 -> {111}; + 104 -> {105} [style=dotted]; + 105 -> {106} [style=dotted]; + 106 -> {107} [style=dotted]; + 107 -> {108} [style=dotted]; + 108 -> {109}; 109 -> {110}; 110 -> {111}; - 111 -> {119}; - 111 -> {112} [style=dotted]; - 112 -> {113} [style=dotted]; - 113 -> {114} [style=dotted]; - 114 -> {115} [style=dotted]; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - subgraph cluster_34 { + subgraph cluster_30 { color=red - 120 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_35 { + 112 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_31 { color=blue - 121 [label="Enter block"]; - subgraph cluster_36 { + 113 [label="Enter when"]; + subgraph cluster_32 { color=blue - 122 [label="Enter when"]; - subgraph cluster_37 { - color=blue - 123 [label="Enter when branch condition "]; - 124 [label="Access variable R|/q|"]; - 125 [label="Enter safe call"]; - 126 [label="Access variable R|/Q.data|"]; - 127 [label="Exit safe call"]; - 128 [label="Enter safe call"]; - 129 [label="Access variable R|/MyData.s|"]; - 130 [label="Exit safe call"]; - 131 [label="Enter safe call"]; - 132 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 133 [label="Exit safe call"]; - 134 [label="Const: Null(null)"]; - 135 [label="Operator !="]; - 136 [label="Exit when branch condition"]; - } - 137 [label="Synthetic else branch"]; - 138 [label="Enter when branch result"]; - subgraph cluster_38 { - color=blue - 139 [label="Enter block"]; - 140 [label="Access variable R|/q|"]; - 141 [label="Access variable R|/Q.data|"]; - 142 [label="Access variable R|/q|"]; - 143 [label="Access variable R|/Q.data|"]; - 144 [label="Access variable R|/MyData.s|"]; - 145 [label="Access variable R|/q|"]; - 146 [label="Access variable R|/Q.data|"]; - 147 [label="Access variable R|/MyData.s|"]; - 148 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 149 [label="Exit block"]; - } - 150 [label="Exit when branch result"]; - 151 [label="Exit when"]; + 114 [label="Enter when branch condition "]; + 115 [label="Access variable R|/q|"]; + 116 [label="Enter safe call"]; + 117 [label="Access variable R|/Q.data|"]; + 118 [label="Exit safe call"]; + 119 [label="Enter safe call"]; + 120 [label="Access variable R|/MyData.s|"]; + 121 [label="Exit safe call"]; + 122 [label="Enter safe call"]; + 123 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 124 [label="Exit safe call"]; + 125 [label="Const: Null(null)"]; + 126 [label="Operator !="]; + 127 [label="Exit when branch condition"]; } - 152 [label="Exit block"]; + 128 [label="Synthetic else branch"]; + 129 [label="Enter when branch result"]; + subgraph cluster_33 { + color=blue + 130 [label="Enter block"]; + 131 [label="Access variable R|/q|"]; + 132 [label="Access variable R|/Q.data|"]; + 133 [label="Access variable R|/q|"]; + 134 [label="Access variable R|/Q.data|"]; + 135 [label="Access variable R|/MyData.s|"]; + 136 [label="Access variable R|/q|"]; + 137 [label="Access variable R|/Q.data|"]; + 138 [label="Access variable R|/MyData.s|"]; + 139 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 140 [label="Exit block"]; + } + 141 [label="Exit when branch result"]; + 142 [label="Exit when"]; } - 153 [label="Exit function test_5" style="filled" fillcolor=red]; + 143 [label="Exit function test_5" style="filled" fillcolor=red]; } + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116 118}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119 121}; + 119 -> {120}; 120 -> {121}; - 121 -> {122}; + 121 -> {122 124}; 122 -> {123}; 123 -> {124}; - 124 -> {125 127}; + 124 -> {125}; 125 -> {126}; 126 -> {127}; - 127 -> {128 130}; - 128 -> {129}; + 127 -> {129 128}; + 128 -> {142}; 129 -> {130}; - 130 -> {131 133}; + 130 -> {131}; 131 -> {132}; 132 -> {133}; 133 -> {134}; 134 -> {135}; 135 -> {136}; - 136 -> {138 137}; - 137 -> {151}; + 136 -> {137}; + 137 -> {138}; 138 -> {139}; 139 -> {140}; 140 -> {141}; 141 -> {142}; 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {149}; - 149 -> {150}; - 150 -> {151}; - 151 -> {152}; - 152 -> {153}; - subgraph cluster_39 { + subgraph cluster_34 { color=red - 154 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_40 { + 144 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_35 { color=blue - 155 [label="Enter block"]; - subgraph cluster_41 { + 145 [label="Enter when"]; + 146 [label="Access variable R|/q|"]; + 147 [label="Enter safe call"]; + 148 [label="Access variable R|/Q.data|"]; + 149 [label="Exit safe call"]; + 150 [label="Enter safe call"]; + 151 [label="Access variable R|/MyData.s|"]; + 152 [label="Exit safe call"]; + 153 [label="Enter safe call"]; + 154 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 155 [label="Exit safe call"]; + 156 [label="Variable declaration: lval : R|kotlin/Int?|"]; + subgraph cluster_36 { color=blue - 156 [label="Enter when"]; - 157 [label="Access variable R|/q|"]; - 158 [label="Enter safe call"]; - 159 [label="Access variable R|/Q.data|"]; - 160 [label="Exit safe call"]; - 161 [label="Enter safe call"]; - 162 [label="Access variable R|/MyData.s|"]; - 163 [label="Exit safe call"]; - 164 [label="Enter safe call"]; - 165 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 166 [label="Exit safe call"]; - 167 [label="Variable declaration: lval : R|kotlin/Int?|"]; - subgraph cluster_42 { - color=blue - 168 [label="Enter when branch condition "]; - 169 [label="Const: Null(null)"]; - 170 [label="Operator =="]; - 171 [label="Exit when branch condition"]; - } - subgraph cluster_43 { - color=blue - 172 [label="Enter when branch condition else"]; - 173 [label="Exit when branch condition"]; - } - 174 [label="Enter when branch result"]; - subgraph cluster_44 { - color=blue - 175 [label="Enter block"]; - 176 [label="Access variable R|/|"]; - 177 [label="Exit block"]; - } - 178 [label="Exit when branch result"]; - 179 [label="Enter when branch result"]; - subgraph cluster_45 { - color=blue - 180 [label="Enter block"]; - 181 [label="Jump: ^test_6 Unit"]; - 182 [label="Stub" style="filled" fillcolor=gray]; - 183 [label="Exit block" style="filled" fillcolor=gray]; - } - 184 [label="Exit when branch result" style="filled" fillcolor=gray]; - 185 [label="Exit when"]; + 157 [label="Enter when branch condition "]; + 158 [label="Const: Null(null)"]; + 159 [label="Operator =="]; + 160 [label="Exit when branch condition"]; } - 186 [label="Access variable R|/q|"]; - 187 [label="Access variable R|/Q.data|"]; - 188 [label="Access variable R|/q|"]; - 189 [label="Access variable R|/Q.data|"]; - 190 [label="Access variable R|/MyData.s|"]; - 191 [label="Access variable R|/q|"]; - 192 [label="Access variable R|/Q.data|"]; - 193 [label="Access variable R|/MyData.s|"]; - 194 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 195 [label="Exit block"]; + subgraph cluster_37 { + color=blue + 161 [label="Enter when branch condition else"]; + 162 [label="Exit when branch condition"]; + } + 163 [label="Enter when branch result"]; + subgraph cluster_38 { + color=blue + 164 [label="Enter block"]; + 165 [label="Access variable R|/|"]; + 166 [label="Exit block"]; + } + 167 [label="Exit when branch result"]; + 168 [label="Enter when branch result"]; + subgraph cluster_39 { + color=blue + 169 [label="Enter block"]; + 170 [label="Jump: ^test_6 Unit"]; + 171 [label="Stub" style="filled" fillcolor=gray]; + 172 [label="Exit block" style="filled" fillcolor=gray]; + } + 173 [label="Exit when branch result" style="filled" fillcolor=gray]; + 174 [label="Exit when"]; } - 196 [label="Exit function test_6" style="filled" fillcolor=red]; + 175 [label="Access variable R|/q|"]; + 176 [label="Access variable R|/Q.data|"]; + 177 [label="Access variable R|/q|"]; + 178 [label="Access variable R|/Q.data|"]; + 179 [label="Access variable R|/MyData.s|"]; + 180 [label="Access variable R|/q|"]; + 181 [label="Access variable R|/Q.data|"]; + 182 [label="Access variable R|/MyData.s|"]; + 183 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 184 [label="Exit function test_6" style="filled" fillcolor=red]; } + 144 -> {145}; + 145 -> {146}; + 146 -> {147 149}; + 147 -> {148}; + 148 -> {149}; + 149 -> {150 152}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153 155}; + 153 -> {154}; 154 -> {155}; 155 -> {156}; 156 -> {157}; - 157 -> {158 160}; + 157 -> {158}; 158 -> {159}; 159 -> {160}; - 160 -> {161 163}; + 160 -> {168 161}; 161 -> {162}; 162 -> {163}; - 163 -> {164 166}; + 163 -> {164}; 164 -> {165}; 165 -> {166}; 166 -> {167}; - 167 -> {168}; + 167 -> {174}; 168 -> {169}; 169 -> {170}; - 170 -> {171}; - 171 -> {179 172}; - 172 -> {173}; - 173 -> {174}; + 170 -> {184}; + 170 -> {171} [style=dotted]; + 171 -> {172} [style=dotted]; + 172 -> {173} [style=dotted]; + 173 -> {174} [style=dotted]; 174 -> {175}; 175 -> {176}; 176 -> {177}; 177 -> {178}; - 178 -> {185}; + 178 -> {179}; 179 -> {180}; 180 -> {181}; - 181 -> {196}; - 181 -> {182} [style=dotted]; - 182 -> {183} [style=dotted]; - 183 -> {184} [style=dotted]; - 184 -> {185} [style=dotted]; + 181 -> {182}; + 182 -> {183}; + 183 -> {184}; + + subgraph cluster_40 { + color=red + 185 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_41 { + color=blue + 186 [label="Enter when"]; + subgraph cluster_42 { + color=blue + 187 [label="Enter when branch condition "]; + 188 [label="Access variable R|/q|"]; + 189 [label="Enter safe call"]; + 190 [label="Function call: R|/q|?.R|/Q.fdata|()"]; + 191 [label="Exit safe call"]; + 192 [label="Enter safe call"]; + 193 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()"]; + 194 [label="Exit safe call"]; + 195 [label="Enter safe call"]; + 196 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|()"]; + 197 [label="Exit safe call"]; + 198 [label="Const: Null(null)"]; + 199 [label="Operator !="]; + 200 [label="Exit when branch condition"]; + } + 201 [label="Synthetic else branch"]; + 202 [label="Enter when branch result"]; + subgraph cluster_43 { + color=blue + 203 [label="Enter block"]; + 204 [label="Access variable R|/q|"]; + 205 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 206 [label="Access variable R|/q|"]; + 207 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 208 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 209 [label="Access variable R|/q|"]; + 210 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 211 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 212 [label="Function call: R|/q|.R|/Q.fdata|().#().#()"]; + 213 [label="Exit block"]; + } + 214 [label="Exit when branch result"]; + 215 [label="Exit when"]; + } + 216 [label="Exit function test_7" style="filled" fillcolor=red]; + } + 185 -> {186}; 186 -> {187}; 187 -> {188}; - 188 -> {189}; + 188 -> {189 191}; 189 -> {190}; 190 -> {191}; - 191 -> {192}; + 191 -> {192 194}; 192 -> {193}; 193 -> {194}; - 194 -> {195}; + 194 -> {195 197}; 195 -> {196}; - - subgraph cluster_46 { - color=red - 197 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_47 { - color=blue - 198 [label="Enter block"]; - subgraph cluster_48 { - color=blue - 199 [label="Enter when"]; - subgraph cluster_49 { - color=blue - 200 [label="Enter when branch condition "]; - 201 [label="Access variable R|/q|"]; - 202 [label="Enter safe call"]; - 203 [label="Function call: R|/q|?.R|/Q.fdata|()"]; - 204 [label="Exit safe call"]; - 205 [label="Enter safe call"]; - 206 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()"]; - 207 [label="Exit safe call"]; - 208 [label="Enter safe call"]; - 209 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|()"]; - 210 [label="Exit safe call"]; - 211 [label="Const: Null(null)"]; - 212 [label="Operator !="]; - 213 [label="Exit when branch condition"]; - } - 214 [label="Synthetic else branch"]; - 215 [label="Enter when branch result"]; - subgraph cluster_50 { - color=blue - 216 [label="Enter block"]; - 217 [label="Access variable R|/q|"]; - 218 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 219 [label="Access variable R|/q|"]; - 220 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 221 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 222 [label="Access variable R|/q|"]; - 223 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 224 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 225 [label="Function call: R|/q|.R|/Q.fdata|().#().#()"]; - 226 [label="Exit block"]; - } - 227 [label="Exit when branch result"]; - 228 [label="Exit when"]; - } - 229 [label="Exit block"]; - } - 230 [label="Exit function test_7" style="filled" fillcolor=red]; - } - + 196 -> {197}; 197 -> {198}; 198 -> {199}; 199 -> {200}; - 200 -> {201}; - 201 -> {202 204}; + 200 -> {202 201}; + 201 -> {215}; 202 -> {203}; 203 -> {204}; - 204 -> {205 207}; + 204 -> {205}; 205 -> {206}; 206 -> {207}; - 207 -> {208 210}; + 207 -> {208}; 208 -> {209}; 209 -> {210}; 210 -> {211}; 211 -> {212}; 212 -> {213}; - 213 -> {215 214}; - 214 -> {228}; + 213 -> {214}; + 214 -> {215}; 215 -> {216}; - 216 -> {217}; + + subgraph cluster_44 { + color=red + 217 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_45 { + color=blue + 218 [label="Enter when"]; + subgraph cluster_46 { + color=blue + 219 [label="Enter when branch condition "]; + 220 [label="Access variable R|/b|"]; + 221 [label="Const: Boolean(true)"]; + 222 [label="Operator =="]; + 223 [label="Exit when branch condition"]; + } + 224 [label="Synthetic else branch"]; + 225 [label="Enter when branch result"]; + subgraph cluster_47 { + color=blue + 226 [label="Enter block"]; + 227 [label="Access variable R|/b|"]; + 228 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 229 [label="Exit block"]; + } + 230 [label="Exit when branch result"]; + 231 [label="Exit when"]; + } + 232 [label="Exit function test_8" style="filled" fillcolor=red]; + } + 217 -> {218}; 218 -> {219}; 219 -> {220}; 220 -> {221}; 221 -> {222}; 222 -> {223}; - 223 -> {224}; - 224 -> {225}; + 223 -> {225 224}; + 224 -> {231}; 225 -> {226}; 226 -> {227}; 227 -> {228}; 228 -> {229}; 229 -> {230}; + 230 -> {231}; + 231 -> {232}; - subgraph cluster_51 { + subgraph cluster_48 { color=red - 231 [label="Enter function test_8" style="filled" fillcolor=red]; + 233 [label="Enter function test_9" style="filled" fillcolor=red]; + subgraph cluster_49 { + color=blue + 234 [label="Enter when"]; + subgraph cluster_50 { + color=blue + 235 [label="Enter when branch condition "]; + 236 [label="Access variable R|/a|"]; + 237 [label="Access variable R|/b|"]; + 238 [label="Operator =="]; + 239 [label="Exit when branch condition"]; + } + 240 [label="Synthetic else branch"]; + 241 [label="Enter when branch result"]; + subgraph cluster_51 { + color=blue + 242 [label="Enter block"]; + 243 [label="Access variable R|/b|"]; + 244 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 245 [label="Exit block"]; + } + 246 [label="Exit when branch result"]; + 247 [label="Exit when"]; + } + 248 [label="Access variable R|/b|"]; + 249 [label="Function call: R|/b|.#()"]; subgraph cluster_52 { color=blue - 232 [label="Enter block"]; + 250 [label="Enter when"]; subgraph cluster_53 { color=blue - 233 [label="Enter when"]; - subgraph cluster_54 { - color=blue - 234 [label="Enter when branch condition "]; - 235 [label="Access variable R|/b|"]; - 236 [label="Const: Boolean(true)"]; - 237 [label="Operator =="]; - 238 [label="Exit when branch condition"]; - } - 239 [label="Synthetic else branch"]; - 240 [label="Enter when branch result"]; - subgraph cluster_55 { - color=blue - 241 [label="Enter block"]; - 242 [label="Access variable R|/b|"]; - 243 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 244 [label="Exit block"]; - } - 245 [label="Exit when branch result"]; - 246 [label="Exit when"]; + 251 [label="Enter when branch condition "]; + 252 [label="Access variable R|/a|"]; + 253 [label="Access variable R|/b|"]; + 254 [label="Operator ==="]; + 255 [label="Exit when branch condition"]; } - 247 [label="Exit block"]; + 256 [label="Synthetic else branch"]; + 257 [label="Enter when branch result"]; + subgraph cluster_54 { + color=blue + 258 [label="Enter block"]; + 259 [label="Access variable R|/b|"]; + 260 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 261 [label="Exit block"]; + } + 262 [label="Exit when branch result"]; + 263 [label="Exit when"]; } - 248 [label="Exit function test_8" style="filled" fillcolor=red]; + 264 [label="Access variable R|/b|"]; + 265 [label="Function call: R|/b|.#()"]; + subgraph cluster_55 { + color=blue + 266 [label="Enter when"]; + subgraph cluster_56 { + color=blue + 267 [label="Enter when branch condition "]; + 268 [label="Access variable R|/b|"]; + 269 [label="Access variable R|/a|"]; + 270 [label="Operator =="]; + 271 [label="Exit when branch condition"]; + } + 272 [label="Synthetic else branch"]; + 273 [label="Enter when branch result"]; + subgraph cluster_57 { + color=blue + 274 [label="Enter block"]; + 275 [label="Access variable R|/b|"]; + 276 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 277 [label="Exit block"]; + } + 278 [label="Exit when branch result"]; + 279 [label="Exit when"]; + } + 280 [label="Access variable R|/b|"]; + 281 [label="Function call: R|/b|.#()"]; + subgraph cluster_58 { + color=blue + 282 [label="Enter when"]; + subgraph cluster_59 { + color=blue + 283 [label="Enter when branch condition "]; + 284 [label="Access variable R|/b|"]; + 285 [label="Access variable R|/a|"]; + 286 [label="Operator ==="]; + 287 [label="Exit when branch condition"]; + } + 288 [label="Synthetic else branch"]; + 289 [label="Enter when branch result"]; + subgraph cluster_60 { + color=blue + 290 [label="Enter block"]; + 291 [label="Access variable R|/b|"]; + 292 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 293 [label="Exit block"]; + } + 294 [label="Exit when branch result"]; + 295 [label="Exit when"]; + } + 296 [label="Access variable R|/b|"]; + 297 [label="Function call: R|/b|.#()"]; + 298 [label="Exit function test_9" style="filled" fillcolor=red]; } - 231 -> {232}; - 232 -> {233}; 233 -> {234}; 234 -> {235}; 235 -> {236}; 236 -> {237}; 237 -> {238}; - 238 -> {240 239}; - 239 -> {246}; - 240 -> {241}; + 238 -> {239}; + 239 -> {241 240}; + 240 -> {247}; 241 -> {242}; 242 -> {243}; 243 -> {244}; @@ -687,127 +753,16 @@ digraph nullability_kt { 245 -> {246}; 246 -> {247}; 247 -> {248}; - - subgraph cluster_56 { - color=red - 249 [label="Enter function test_9" style="filled" fillcolor=red]; - subgraph cluster_57 { - color=blue - 250 [label="Enter block"]; - subgraph cluster_58 { - color=blue - 251 [label="Enter when"]; - subgraph cluster_59 { - color=blue - 252 [label="Enter when branch condition "]; - 253 [label="Access variable R|/a|"]; - 254 [label="Access variable R|/b|"]; - 255 [label="Operator =="]; - 256 [label="Exit when branch condition"]; - } - 257 [label="Synthetic else branch"]; - 258 [label="Enter when branch result"]; - subgraph cluster_60 { - color=blue - 259 [label="Enter block"]; - 260 [label="Access variable R|/b|"]; - 261 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 262 [label="Exit block"]; - } - 263 [label="Exit when branch result"]; - 264 [label="Exit when"]; - } - 265 [label="Access variable R|/b|"]; - 266 [label="Function call: R|/b|.#()"]; - subgraph cluster_61 { - color=blue - 267 [label="Enter when"]; - subgraph cluster_62 { - color=blue - 268 [label="Enter when branch condition "]; - 269 [label="Access variable R|/a|"]; - 270 [label="Access variable R|/b|"]; - 271 [label="Operator ==="]; - 272 [label="Exit when branch condition"]; - } - 273 [label="Synthetic else branch"]; - 274 [label="Enter when branch result"]; - subgraph cluster_63 { - color=blue - 275 [label="Enter block"]; - 276 [label="Access variable R|/b|"]; - 277 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 278 [label="Exit block"]; - } - 279 [label="Exit when branch result"]; - 280 [label="Exit when"]; - } - 281 [label="Access variable R|/b|"]; - 282 [label="Function call: R|/b|.#()"]; - subgraph cluster_64 { - color=blue - 283 [label="Enter when"]; - subgraph cluster_65 { - color=blue - 284 [label="Enter when branch condition "]; - 285 [label="Access variable R|/b|"]; - 286 [label="Access variable R|/a|"]; - 287 [label="Operator =="]; - 288 [label="Exit when branch condition"]; - } - 289 [label="Synthetic else branch"]; - 290 [label="Enter when branch result"]; - subgraph cluster_66 { - color=blue - 291 [label="Enter block"]; - 292 [label="Access variable R|/b|"]; - 293 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 294 [label="Exit block"]; - } - 295 [label="Exit when branch result"]; - 296 [label="Exit when"]; - } - 297 [label="Access variable R|/b|"]; - 298 [label="Function call: R|/b|.#()"]; - subgraph cluster_67 { - color=blue - 299 [label="Enter when"]; - subgraph cluster_68 { - color=blue - 300 [label="Enter when branch condition "]; - 301 [label="Access variable R|/b|"]; - 302 [label="Access variable R|/a|"]; - 303 [label="Operator ==="]; - 304 [label="Exit when branch condition"]; - } - 305 [label="Synthetic else branch"]; - 306 [label="Enter when branch result"]; - subgraph cluster_69 { - color=blue - 307 [label="Enter block"]; - 308 [label="Access variable R|/b|"]; - 309 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 310 [label="Exit block"]; - } - 311 [label="Exit when branch result"]; - 312 [label="Exit when"]; - } - 313 [label="Access variable R|/b|"]; - 314 [label="Function call: R|/b|.#()"]; - 315 [label="Exit block"]; - } - 316 [label="Exit function test_9" style="filled" fillcolor=red]; - } - + 248 -> {249}; 249 -> {250}; 250 -> {251}; 251 -> {252}; 252 -> {253}; 253 -> {254}; 254 -> {255}; - 255 -> {256}; - 256 -> {258 257}; - 257 -> {264}; + 255 -> {257 256}; + 256 -> {263}; + 257 -> {258}; 258 -> {259}; 259 -> {260}; 260 -> {261}; @@ -821,9 +776,9 @@ digraph nullability_kt { 268 -> {269}; 269 -> {270}; 270 -> {271}; - 271 -> {272}; - 272 -> {274 273}; - 273 -> {280}; + 271 -> {273 272}; + 272 -> {279}; + 273 -> {274}; 274 -> {275}; 275 -> {276}; 276 -> {277}; @@ -837,9 +792,9 @@ digraph nullability_kt { 284 -> {285}; 285 -> {286}; 286 -> {287}; - 287 -> {288}; - 288 -> {290 289}; - 289 -> {296}; + 287 -> {289 288}; + 288 -> {295}; + 289 -> {290}; 290 -> {291}; 291 -> {292}; 292 -> {293}; @@ -848,15 +803,121 @@ digraph nullability_kt { 295 -> {296}; 296 -> {297}; 297 -> {298}; - 298 -> {299}; + + subgraph cluster_61 { + color=red + 299 [label="Enter function test_10" style="filled" fillcolor=red]; + subgraph cluster_62 { + color=blue + 300 [label="Enter when"]; + subgraph cluster_63 { + color=blue + 301 [label="Enter when branch condition "]; + 302 [label="Access variable R|/a|"]; + 303 [label="Access variable R|/b|"]; + 304 [label="Operator =="]; + 305 [label="Exit when branch condition"]; + } + 306 [label="Synthetic else branch"]; + 307 [label="Enter when branch result"]; + subgraph cluster_64 { + color=blue + 308 [label="Enter block"]; + 309 [label="Access variable R|/b|"]; + 310 [label="Function call: R|/b|.#()"]; + 311 [label="Exit block"]; + } + 312 [label="Exit when branch result"]; + 313 [label="Exit when"]; + } + 314 [label="Access variable R|/b|"]; + 315 [label="Function call: R|/b|.#()"]; + subgraph cluster_65 { + color=blue + 316 [label="Enter when"]; + subgraph cluster_66 { + color=blue + 317 [label="Enter when branch condition "]; + 318 [label="Access variable R|/a|"]; + 319 [label="Access variable R|/b|"]; + 320 [label="Operator ==="]; + 321 [label="Exit when branch condition"]; + } + 322 [label="Synthetic else branch"]; + 323 [label="Enter when branch result"]; + subgraph cluster_67 { + color=blue + 324 [label="Enter block"]; + 325 [label="Access variable R|/b|"]; + 326 [label="Function call: R|/b|.#()"]; + 327 [label="Exit block"]; + } + 328 [label="Exit when branch result"]; + 329 [label="Exit when"]; + } + 330 [label="Access variable R|/b|"]; + 331 [label="Function call: R|/b|.#()"]; + subgraph cluster_68 { + color=blue + 332 [label="Enter when"]; + subgraph cluster_69 { + color=blue + 333 [label="Enter when branch condition "]; + 334 [label="Access variable R|/b|"]; + 335 [label="Access variable R|/a|"]; + 336 [label="Operator =="]; + 337 [label="Exit when branch condition"]; + } + 338 [label="Synthetic else branch"]; + 339 [label="Enter when branch result"]; + subgraph cluster_70 { + color=blue + 340 [label="Enter block"]; + 341 [label="Access variable R|/b|"]; + 342 [label="Function call: R|/b|.#()"]; + 343 [label="Exit block"]; + } + 344 [label="Exit when branch result"]; + 345 [label="Exit when"]; + } + 346 [label="Access variable R|/b|"]; + 347 [label="Function call: R|/b|.#()"]; + subgraph cluster_71 { + color=blue + 348 [label="Enter when"]; + subgraph cluster_72 { + color=blue + 349 [label="Enter when branch condition "]; + 350 [label="Access variable R|/b|"]; + 351 [label="Access variable R|/a|"]; + 352 [label="Operator ==="]; + 353 [label="Exit when branch condition"]; + } + 354 [label="Synthetic else branch"]; + 355 [label="Enter when branch result"]; + subgraph cluster_73 { + color=blue + 356 [label="Enter block"]; + 357 [label="Access variable R|/b|"]; + 358 [label="Function call: R|/b|.#()"]; + 359 [label="Exit block"]; + } + 360 [label="Exit when branch result"]; + 361 [label="Exit when"]; + } + 362 [label="Access variable R|/b|"]; + 363 [label="Function call: R|/b|.#()"]; + 364 [label="Exit function test_10" style="filled" fillcolor=red]; + } + 299 -> {300}; 300 -> {301}; 301 -> {302}; 302 -> {303}; 303 -> {304}; - 304 -> {306 305}; - 305 -> {312}; - 306 -> {307}; + 304 -> {305}; + 305 -> {307 306}; + 306 -> {313}; 307 -> {308}; 308 -> {309}; 309 -> {310}; @@ -866,127 +927,16 @@ digraph nullability_kt { 313 -> {314}; 314 -> {315}; 315 -> {316}; - - subgraph cluster_70 { - color=red - 317 [label="Enter function test_10" style="filled" fillcolor=red]; - subgraph cluster_71 { - color=blue - 318 [label="Enter block"]; - subgraph cluster_72 { - color=blue - 319 [label="Enter when"]; - subgraph cluster_73 { - color=blue - 320 [label="Enter when branch condition "]; - 321 [label="Access variable R|/a|"]; - 322 [label="Access variable R|/b|"]; - 323 [label="Operator =="]; - 324 [label="Exit when branch condition"]; - } - 325 [label="Synthetic else branch"]; - 326 [label="Enter when branch result"]; - subgraph cluster_74 { - color=blue - 327 [label="Enter block"]; - 328 [label="Access variable R|/b|"]; - 329 [label="Function call: R|/b|.#()"]; - 330 [label="Exit block"]; - } - 331 [label="Exit when branch result"]; - 332 [label="Exit when"]; - } - 333 [label="Access variable R|/b|"]; - 334 [label="Function call: R|/b|.#()"]; - subgraph cluster_75 { - color=blue - 335 [label="Enter when"]; - subgraph cluster_76 { - color=blue - 336 [label="Enter when branch condition "]; - 337 [label="Access variable R|/a|"]; - 338 [label="Access variable R|/b|"]; - 339 [label="Operator ==="]; - 340 [label="Exit when branch condition"]; - } - 341 [label="Synthetic else branch"]; - 342 [label="Enter when branch result"]; - subgraph cluster_77 { - color=blue - 343 [label="Enter block"]; - 344 [label="Access variable R|/b|"]; - 345 [label="Function call: R|/b|.#()"]; - 346 [label="Exit block"]; - } - 347 [label="Exit when branch result"]; - 348 [label="Exit when"]; - } - 349 [label="Access variable R|/b|"]; - 350 [label="Function call: R|/b|.#()"]; - subgraph cluster_78 { - color=blue - 351 [label="Enter when"]; - subgraph cluster_79 { - color=blue - 352 [label="Enter when branch condition "]; - 353 [label="Access variable R|/b|"]; - 354 [label="Access variable R|/a|"]; - 355 [label="Operator =="]; - 356 [label="Exit when branch condition"]; - } - 357 [label="Synthetic else branch"]; - 358 [label="Enter when branch result"]; - subgraph cluster_80 { - color=blue - 359 [label="Enter block"]; - 360 [label="Access variable R|/b|"]; - 361 [label="Function call: R|/b|.#()"]; - 362 [label="Exit block"]; - } - 363 [label="Exit when branch result"]; - 364 [label="Exit when"]; - } - 365 [label="Access variable R|/b|"]; - 366 [label="Function call: R|/b|.#()"]; - subgraph cluster_81 { - color=blue - 367 [label="Enter when"]; - subgraph cluster_82 { - color=blue - 368 [label="Enter when branch condition "]; - 369 [label="Access variable R|/b|"]; - 370 [label="Access variable R|/a|"]; - 371 [label="Operator ==="]; - 372 [label="Exit when branch condition"]; - } - 373 [label="Synthetic else branch"]; - 374 [label="Enter when branch result"]; - subgraph cluster_83 { - color=blue - 375 [label="Enter block"]; - 376 [label="Access variable R|/b|"]; - 377 [label="Function call: R|/b|.#()"]; - 378 [label="Exit block"]; - } - 379 [label="Exit when branch result"]; - 380 [label="Exit when"]; - } - 381 [label="Access variable R|/b|"]; - 382 [label="Function call: R|/b|.#()"]; - 383 [label="Exit block"]; - } - 384 [label="Exit function test_10" style="filled" fillcolor=red]; - } - + 316 -> {317}; 317 -> {318}; 318 -> {319}; 319 -> {320}; 320 -> {321}; - 321 -> {322}; - 322 -> {323}; + 321 -> {323 322}; + 322 -> {329}; 323 -> {324}; - 324 -> {326 325}; - 325 -> {332}; + 324 -> {325}; + 325 -> {326}; 326 -> {327}; 327 -> {328}; 328 -> {329}; @@ -998,11 +948,11 @@ digraph nullability_kt { 334 -> {335}; 335 -> {336}; 336 -> {337}; - 337 -> {338}; - 338 -> {339}; + 337 -> {339 338}; + 338 -> {345}; 339 -> {340}; - 340 -> {342 341}; - 341 -> {348}; + 340 -> {341}; + 341 -> {342}; 342 -> {343}; 343 -> {344}; 344 -> {345}; @@ -1014,36 +964,16 @@ digraph nullability_kt { 350 -> {351}; 351 -> {352}; 352 -> {353}; - 353 -> {354}; - 354 -> {355}; + 353 -> {355 354}; + 354 -> {361}; 355 -> {356}; - 356 -> {358 357}; - 357 -> {364}; + 356 -> {357}; + 357 -> {358}; 358 -> {359}; 359 -> {360}; 360 -> {361}; 361 -> {362}; 362 -> {363}; 363 -> {364}; - 364 -> {365}; - 365 -> {366}; - 366 -> {367}; - 367 -> {368}; - 368 -> {369}; - 369 -> {370}; - 370 -> {371}; - 371 -> {372}; - 372 -> {374 373}; - 373 -> {380}; - 374 -> {375}; - 375 -> {376}; - 376 -> {377}; - 377 -> {378}; - 378 -> {379}; - 379 -> {380}; - 380 -> {381}; - 381 -> {382}; - 382 -> {383}; - 383 -> {384}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot b/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot index d8bb76b63ac..7a15a131c41 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot @@ -8,45 +8,40 @@ digraph returns_kt { 0 [label="Enter function test_0" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Access variable R|/x|"]; - 5 [label="Type operator: x is String"]; - 6 [label="Exit when branch condition"]; - } - subgraph cluster_4 { - color=blue - 7 [label="Enter when branch condition else"]; - 8 [label="Exit when branch condition"]; - } - 9 [label="Enter when branch result"]; - subgraph cluster_5 { - color=blue - 10 [label="Enter block"]; - 11 [label="Exit block"]; - } - 12 [label="Exit when branch result"]; - 13 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 14 [label="Enter block"]; - 15 [label="Access variable R|/x|"]; - 16 [label="Access variable R|kotlin/String.length|"]; - 17 [label="Exit block"]; - } - 18 [label="Exit when branch result"]; - 19 [label="Exit when"]; + 2 [label="Enter when branch condition "]; + 3 [label="Access variable R|/x|"]; + 4 [label="Type operator: x is String"]; + 5 [label="Exit when branch condition"]; } - 20 [label="Access variable R|/x|"]; - 21 [label="Access variable #"]; - 22 [label="Exit block"]; + subgraph cluster_3 { + color=blue + 6 [label="Enter when branch condition else"]; + 7 [label="Exit when branch condition"]; + } + 8 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 9 [label="Enter block"]; + 10 [label="Exit block"]; + } + 11 [label="Exit when branch result"]; + 12 [label="Enter when branch result"]; + subgraph cluster_5 { + color=blue + 13 [label="Enter block"]; + 14 [label="Access variable R|/x|"]; + 15 [label="Access variable R|kotlin/String.length|"]; + 16 [label="Exit block"]; + } + 17 [label="Exit when branch result"]; + 18 [label="Exit when"]; } - 23 [label="Exit function test_0" style="filled" fillcolor=red]; + 19 [label="Access variable R|/x|"]; + 20 [label="Access variable #"]; + 21 [label="Exit function test_0" style="filled" fillcolor=red]; } 0 -> {1}; @@ -54,14 +49,14 @@ digraph returns_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {13 7}; + 5 -> {12 6}; + 6 -> {7}; 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; - 11 -> {12}; - 12 -> {19}; + 11 -> {18}; + 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; @@ -70,202 +65,192 @@ digraph returns_kt { 18 -> {19}; 19 -> {20}; 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - subgraph cluster_7 { + subgraph cluster_6 { color=red - 24 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_8 { + 22 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_7 { color=blue - 25 [label="Enter block"]; + 23 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 24 [label="Enter when branch condition "]; + 25 [label="Access variable R|/x|"]; + 26 [label="Type operator: x is String"]; + 27 [label="Exit when branch condition"]; + } subgraph cluster_9 { color=blue - 26 [label="Enter when"]; - subgraph cluster_10 { - color=blue - 27 [label="Enter when branch condition "]; - 28 [label="Access variable R|/x|"]; - 29 [label="Type operator: x is String"]; - 30 [label="Exit when branch condition"]; - } - subgraph cluster_11 { - color=blue - 31 [label="Enter when branch condition else"]; - 32 [label="Exit when branch condition"]; - } - 33 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 34 [label="Enter block"]; - 35 [label="Jump: ^test_1 Unit"]; - 36 [label="Stub" style="filled" fillcolor=gray]; - 37 [label="Exit block" style="filled" fillcolor=gray]; - } - 38 [label="Exit when branch result" style="filled" fillcolor=gray]; - 39 [label="Enter when branch result"]; - subgraph cluster_13 { - color=blue - 40 [label="Enter block"]; - 41 [label="Access variable R|/x|"]; - 42 [label="Access variable R|kotlin/String.length|"]; - 43 [label="Exit block"]; - } - 44 [label="Exit when branch result"]; - 45 [label="Exit when"]; + 28 [label="Enter when branch condition else"]; + 29 [label="Exit when branch condition"]; } - 46 [label="Access variable R|/x|"]; - 47 [label="Access variable R|kotlin/String.length|"]; - 48 [label="Exit block"]; + 30 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 31 [label="Enter block"]; + 32 [label="Jump: ^test_1 Unit"]; + 33 [label="Stub" style="filled" fillcolor=gray]; + 34 [label="Exit block" style="filled" fillcolor=gray]; + } + 35 [label="Exit when branch result" style="filled" fillcolor=gray]; + 36 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 37 [label="Enter block"]; + 38 [label="Access variable R|/x|"]; + 39 [label="Access variable R|kotlin/String.length|"]; + 40 [label="Exit block"]; + } + 41 [label="Exit when branch result"]; + 42 [label="Exit when"]; } - 49 [label="Exit function test_1" style="filled" fillcolor=red]; + 43 [label="Access variable R|/x|"]; + 44 [label="Access variable R|kotlin/String.length|"]; + 45 [label="Exit function test_1" style="filled" fillcolor=red]; } + 22 -> {23}; + 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28}; + 27 -> {36 28}; 28 -> {29}; 29 -> {30}; - 30 -> {39 31}; + 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {49}; - 35 -> {36} [style=dotted]; - 36 -> {37} [style=dotted]; - 37 -> {38} [style=dotted]; - 38 -> {45} [style=dotted]; + 32 -> {45}; + 32 -> {33} [style=dotted]; + 33 -> {34} [style=dotted]; + 34 -> {35} [style=dotted]; + 35 -> {42} [style=dotted]; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; 39 -> {40}; 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; + + subgraph cluster_12 { + color=red + 46 [label="Enter function foo" style="filled" fillcolor=red]; + 47 [label="Exit function foo" style="filled" fillcolor=red]; + } + 46 -> {47}; - 47 -> {48}; + + subgraph cluster_13 { + color=red + 48 [label="Enter function bar" style="filled" fillcolor=red]; + 49 [label="Exit function bar" style="filled" fillcolor=red]; + } + 48 -> {49}; subgraph cluster_14 { color=red - 50 [label="Enter function foo" style="filled" fillcolor=red]; - 51 [label="Exit function foo" style="filled" fillcolor=red]; + 50 [label="Enter function baz" style="filled" fillcolor=red]; + 51 [label="Exit function baz" style="filled" fillcolor=red]; } 50 -> {51}; subgraph cluster_15 { color=red - 52 [label="Enter function bar" style="filled" fillcolor=red]; - 53 [label="Exit function bar" style="filled" fillcolor=red]; + 52 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 53 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 54 [label="Enter when branch condition "]; + 55 [label="Access variable R|/x|"]; + 56 [label="Type operator: x is B"]; + 57 [label="Exit when branch condition"]; + } + subgraph cluster_18 { + color=blue + 58 [label="Enter when branch condition "]; + 59 [label="Access variable R|/x|"]; + 60 [label="Type operator: x is C"]; + 61 [label="Exit when branch condition"]; + } + subgraph cluster_19 { + color=blue + 62 [label="Enter when branch condition else"]; + 63 [label="Exit when branch condition"]; + } + 64 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 65 [label="Enter block"]; + 66 [label="Jump: ^test_2 Unit"]; + 67 [label="Stub" style="filled" fillcolor=gray]; + 68 [label="Exit block" style="filled" fillcolor=gray]; + } + 69 [label="Exit when branch result" style="filled" fillcolor=gray]; + 70 [label="Enter when branch result"]; + subgraph cluster_21 { + color=blue + 71 [label="Enter block"]; + 72 [label="Access variable R|/x|"]; + 73 [label="Function call: R|/x|.R|/C.baz|()"]; + 74 [label="Exit block"]; + } + 75 [label="Exit when branch result"]; + 76 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 77 [label="Enter block"]; + 78 [label="Access variable R|/x|"]; + 79 [label="Function call: R|/x|.R|/B.bar|()"]; + 80 [label="Exit block"]; + } + 81 [label="Exit when branch result"]; + 82 [label="Exit when"]; + } + 83 [label="Access variable R|/x|"]; + 84 [label="Function call: R|/x|.R|/A.foo|()"]; + 85 [label="Access variable R|/x|"]; + 86 [label="Function call: R|/x|.#()"]; + 87 [label="Access variable R|/x|"]; + 88 [label="Function call: R|/x|.#()"]; + 89 [label="Exit function test_2" style="filled" fillcolor=red]; } 52 -> {53}; - - subgraph cluster_16 { - color=red - 54 [label="Enter function baz" style="filled" fillcolor=red]; - 55 [label="Exit function baz" style="filled" fillcolor=red]; - } - + 53 -> {54}; 54 -> {55}; - - subgraph cluster_17 { - color=red - 56 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_18 { - color=blue - 57 [label="Enter block"]; - subgraph cluster_19 { - color=blue - 58 [label="Enter when"]; - subgraph cluster_20 { - color=blue - 59 [label="Enter when branch condition "]; - 60 [label="Access variable R|/x|"]; - 61 [label="Type operator: x is B"]; - 62 [label="Exit when branch condition"]; - } - subgraph cluster_21 { - color=blue - 63 [label="Enter when branch condition "]; - 64 [label="Access variable R|/x|"]; - 65 [label="Type operator: x is C"]; - 66 [label="Exit when branch condition"]; - } - subgraph cluster_22 { - color=blue - 67 [label="Enter when branch condition else"]; - 68 [label="Exit when branch condition"]; - } - 69 [label="Enter when branch result"]; - subgraph cluster_23 { - color=blue - 70 [label="Enter block"]; - 71 [label="Jump: ^test_2 Unit"]; - 72 [label="Stub" style="filled" fillcolor=gray]; - 73 [label="Exit block" style="filled" fillcolor=gray]; - } - 74 [label="Exit when branch result" style="filled" fillcolor=gray]; - 75 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 76 [label="Enter block"]; - 77 [label="Access variable R|/x|"]; - 78 [label="Function call: R|/x|.R|/C.baz|()"]; - 79 [label="Exit block"]; - } - 80 [label="Exit when branch result"]; - 81 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 82 [label="Enter block"]; - 83 [label="Access variable R|/x|"]; - 84 [label="Function call: R|/x|.R|/B.bar|()"]; - 85 [label="Exit block"]; - } - 86 [label="Exit when branch result"]; - 87 [label="Exit when"]; - } - 88 [label="Access variable R|/x|"]; - 89 [label="Function call: R|/x|.R|/A.foo|()"]; - 90 [label="Access variable R|/x|"]; - 91 [label="Function call: R|/x|.#()"]; - 92 [label="Access variable R|/x|"]; - 93 [label="Function call: R|/x|.#()"]; - 94 [label="Exit block"]; - } - 95 [label="Exit function test_2" style="filled" fillcolor=red]; - } - + 55 -> {56}; 56 -> {57}; - 57 -> {58}; + 57 -> {76 58}; 58 -> {59}; 59 -> {60}; 60 -> {61}; - 61 -> {62}; - 62 -> {81 63}; + 61 -> {70 62}; + 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; - 66 -> {75 67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; + 66 -> {89}; + 66 -> {67} [style=dotted]; + 67 -> {68} [style=dotted]; + 68 -> {69} [style=dotted]; + 69 -> {82} [style=dotted]; 70 -> {71}; - 71 -> {95}; - 71 -> {72} [style=dotted]; - 72 -> {73} [style=dotted]; - 73 -> {74} [style=dotted]; - 74 -> {87} [style=dotted]; - 75 -> {76}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {82}; 76 -> {77}; 77 -> {78}; 78 -> {79}; 79 -> {80}; - 80 -> {87}; + 80 -> {81}; 81 -> {82}; 82 -> {83}; 83 -> {84}; @@ -274,99 +259,86 @@ digraph returns_kt { 86 -> {87}; 87 -> {88}; 88 -> {89}; - 89 -> {90}; + + subgraph cluster_23 { + color=red + 90 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_24 { + color=blue + 91 [label="Enter when"]; + subgraph cluster_25 { + color=blue + 92 [label="Enter when branch condition "]; + 93 [label="Access variable R|/x|"]; + 94 [label="Type operator: x is B"]; + 95 [label="Exit when branch condition"]; + } + subgraph cluster_26 { + color=blue + 96 [label="Enter when branch condition "]; + 97 [label="Access variable R|/x|"]; + 98 [label="Type operator: x is C"]; + 99 [label="Exit when branch condition"]; + } + 100 [label="Synthetic else branch"]; + 101 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 102 [label="Enter block"]; + 103 [label="Access variable R|/x|"]; + 104 [label="Function call: R|/x|.R|/C.baz|()"]; + 105 [label="Exit block"]; + } + 106 [label="Exit when branch result"]; + 107 [label="Enter when branch result"]; + subgraph cluster_28 { + color=blue + 108 [label="Enter block"]; + 109 [label="Access variable R|/x|"]; + 110 [label="Function call: R|/x|.R|/B.bar|()"]; + 111 [label="Exit block"]; + } + 112 [label="Exit when branch result"]; + 113 [label="Exit when"]; + } + 114 [label="Access variable R|/x|"]; + 115 [label="Function call: R|/x|.#()"]; + 116 [label="Access variable R|/x|"]; + 117 [label="Function call: R|/x|.#()"]; + 118 [label="Access variable R|/x|"]; + 119 [label="Function call: R|/x|.#()"]; + 120 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 90 -> {91}; 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; - - subgraph cluster_26 { - color=red - 96 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_27 { - color=blue - 97 [label="Enter block"]; - subgraph cluster_28 { - color=blue - 98 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 99 [label="Enter when branch condition "]; - 100 [label="Access variable R|/x|"]; - 101 [label="Type operator: x is B"]; - 102 [label="Exit when branch condition"]; - } - subgraph cluster_30 { - color=blue - 103 [label="Enter when branch condition "]; - 104 [label="Access variable R|/x|"]; - 105 [label="Type operator: x is C"]; - 106 [label="Exit when branch condition"]; - } - 107 [label="Synthetic else branch"]; - 108 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 109 [label="Enter block"]; - 110 [label="Access variable R|/x|"]; - 111 [label="Function call: R|/x|.R|/C.baz|()"]; - 112 [label="Exit block"]; - } - 113 [label="Exit when branch result"]; - 114 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 115 [label="Enter block"]; - 116 [label="Access variable R|/x|"]; - 117 [label="Function call: R|/x|.R|/B.bar|()"]; - 118 [label="Exit block"]; - } - 119 [label="Exit when branch result"]; - 120 [label="Exit when"]; - } - 121 [label="Access variable R|/x|"]; - 122 [label="Function call: R|/x|.#()"]; - 123 [label="Access variable R|/x|"]; - 124 [label="Function call: R|/x|.#()"]; - 125 [label="Access variable R|/x|"]; - 126 [label="Function call: R|/x|.#()"]; - 127 [label="Exit block"]; - } - 128 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 95 -> {107 96}; 96 -> {97}; 97 -> {98}; 98 -> {99}; - 99 -> {100}; - 100 -> {101}; + 99 -> {101 100}; + 100 -> {113}; 101 -> {102}; - 102 -> {114 103}; + 102 -> {103}; 103 -> {104}; 104 -> {105}; 105 -> {106}; - 106 -> {108 107}; - 107 -> {120}; + 106 -> {113}; + 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; 111 -> {112}; 112 -> {113}; - 113 -> {120}; + 113 -> {114}; 114 -> {115}; 115 -> {116}; 116 -> {117}; 117 -> {118}; 118 -> {119}; 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; - 127 -> {128}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot index 478657d9e6c..f25698cef23 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot @@ -6,296 +6,233 @@ digraph safeCalls_kt { subgraph cluster_0 { color=red 0 [label="Enter function foo" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Const: String()"]; - 3 [label="Jump: ^foo String()"]; - 4 [label="Stub" style="filled" fillcolor=gray]; - 5 [label="Exit block" style="filled" fillcolor=gray]; - } - 6 [label="Exit function foo" style="filled" fillcolor=red]; + 1 [label="Const: String()"]; + 2 [label="Jump: ^foo String()"]; + 3 [label="Stub" style="filled" fillcolor=gray]; + 4 [label="Exit function foo" style="filled" fillcolor=red]; } 0 -> {1}; 1 -> {2}; - 2 -> {3}; - 3 -> {6}; + 2 -> {4}; + 2 -> {3} [style=dotted]; 3 -> {4} [style=dotted]; - 4 -> {5} [style=dotted]; - 5 -> {6} [style=dotted]; + + subgraph cluster_1 { + color=red + 5 [label="Enter function let" style="filled" fillcolor=red]; + 6 [label="Exit function let" style="filled" fillcolor=red]; + } + + 5 -> {6}; subgraph cluster_2 { color=red - 7 [label="Enter function let" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 8 [label="Enter block"]; - 9 [label="Exit block"]; - } - 10 [label="Exit function let" style="filled" fillcolor=red]; + 7 [label="Enter function test" style="filled" fillcolor=red]; + 8 [label="Access variable R|/x|"]; + 9 [label="Enter safe call"]; + 10 [label="Access variable R|/x|"]; + 11 [label="Access variable R|kotlin/String.length|"]; + 12 [label="Const: Int(1)"]; + 13 [label="Operator =="]; + 14 [label="Function call: R|/x|?.R|/foo|(==(R|/x|.R|kotlin/String.length|, Int(1)))"]; + 15 [label="Exit safe call"]; + 16 [label="Access variable R|/x|"]; + 17 [label="Access variable #"]; + 18 [label="Exit function test" style="filled" fillcolor=red]; } 7 -> {8}; - 8 -> {9}; + 8 -> {9 15}; 9 -> {10}; - - subgraph cluster_4 { - color=red - 11 [label="Enter function test" style="filled" fillcolor=red]; - subgraph cluster_5 { - color=blue - 12 [label="Enter block"]; - 13 [label="Access variable R|/x|"]; - 14 [label="Enter safe call"]; - 15 [label="Access variable R|/x|"]; - 16 [label="Access variable R|kotlin/String.length|"]; - 17 [label="Const: Int(1)"]; - 18 [label="Operator =="]; - 19 [label="Function call: R|/x|?.R|/foo|(==(R|/x|.R|kotlin/String.length|, Int(1)))"]; - 20 [label="Exit safe call"]; - 21 [label="Access variable R|/x|"]; - 22 [label="Access variable #"]; - 23 [label="Exit block"]; - } - 24 [label="Exit function test" style="filled" fillcolor=red]; - } - + 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {14 20}; + 13 -> {14}; 14 -> {15}; 15 -> {16}; 16 -> {17}; 17 -> {18}; - 18 -> {19}; + + subgraph cluster_3 { + color=red + 19 [label="Enter function bar" style="filled" fillcolor=red]; + 20 [label="Exit function bar" style="filled" fillcolor=red]; + } + 19 -> {20}; - 20 -> {21}; + + subgraph cluster_4 { + color=red + 21 [label="Enter function bool" style="filled" fillcolor=red]; + 22 [label="Exit function bool" style="filled" fillcolor=red]; + } + 21 -> {22}; - 22 -> {23}; + + subgraph cluster_5 { + color=red + 23 [label="Enter function id" style="filled" fillcolor=red]; + 24 [label="Exit function id" style="filled" fillcolor=red]; + } + 23 -> {24}; subgraph cluster_6 { color=red - 25 [label="Enter function bar" style="filled" fillcolor=red]; - 26 [label="Exit function bar" style="filled" fillcolor=red]; + 25 [label="Enter function test_2" style="filled" fillcolor=red]; + 26 [label="Access variable R|/x|"]; + 27 [label="Type operator: x as? A"]; + 28 [label="Enter safe call"]; + 29 [label="Access variable R|/x|"]; + 30 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)"]; + 31 [label="Exit safe call"]; + 32 [label="Exit function test_2" style="filled" fillcolor=red]; } 25 -> {26}; + 26 -> {27}; + 27 -> {28 31}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; subgraph cluster_7 { color=red - 27 [label="Enter function bool" style="filled" fillcolor=red]; - 28 [label="Exit function bool" style="filled" fillcolor=red]; - } - - 27 -> {28}; - - subgraph cluster_8 { - color=red - 29 [label="Enter function id" style="filled" fillcolor=red]; - 30 [label="Exit function id" style="filled" fillcolor=red]; - } - - 29 -> {30}; - - subgraph cluster_9 { - color=red - 31 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { - color=blue - 32 [label="Enter block"]; - 33 [label="Access variable R|/x|"]; - 34 [label="Type operator: x as? A"]; - 35 [label="Enter safe call"]; - 36 [label="Access variable R|/x|"]; - 37 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)"]; - 38 [label="Exit safe call"]; - 39 [label="Exit block"]; - } - 40 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35 38}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - - subgraph cluster_11 { - color=red - 41 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 42 [label="Enter block"]; - 43 [label="Access variable R|/x|"]; - 44 [label="Type operator: x as? A"]; - 45 [label="Enter safe call"]; - 46 [label="Access variable R|/x|"]; - 47 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)"]; - 48 [label="Exit safe call"]; - 49 [label="Enter safe call"]; - 50 [label="Access variable R|/x|"]; - 51 [label="Function call: R|/x|.R|/A.bool|()"]; - 52 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)?.R|/foo|(R|/x|.R|/A.bool|())"]; - 53 [label="Exit safe call"]; - 54 [label="Enter safe call"]; - 55 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)?.R|/foo|(R|/x|.R|/A.bool|())?.R|/let|( = let@fun (): R|kotlin/Unit| { + 33 [label="Enter function test_3" style="filled" fillcolor=red]; + 34 [label="Access variable R|/x|"]; + 35 [label="Type operator: x as? A"]; + 36 [label="Enter safe call"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)"]; + 39 [label="Exit safe call"]; + 40 [label="Enter safe call"]; + 41 [label="Access variable R|/x|"]; + 42 [label="Function call: R|/x|.R|/A.bool|()"]; + 43 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)?.R|/foo|(R|/x|.R|/A.bool|())"]; + 44 [label="Exit safe call"]; + 45 [label="Enter safe call"]; + 46 [label="Function call: (R|/x| as? R|A|)?.R|/A.bar|(R|/x|)?.R|/foo|(R|/x|.R|/A.bool|())?.R|/let|( = let@fun (): R|kotlin/Unit| { R|/x|.R|/A.bool|() } )"]; - 56 [label="Exit safe call"]; - 57 [label="Access variable R|/x|"]; - 58 [label="Function call: R|/x|.#()"]; - 59 [label="Exit block"]; - } - 60 [label="Exit function test_3" style="filled" fillcolor=red]; + 47 [label="Exit safe call"]; + 48 [label="Access variable R|/x|"]; + 49 [label="Function call: R|/x|.#()"]; + 50 [label="Exit function test_3" style="filled" fillcolor=red]; } + 33 -> {34}; + 34 -> {35}; + 35 -> {36 39}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40 44}; + 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; - 44 -> {45 48}; + 44 -> {45 47}; 45 -> {46}; 46 -> {47}; 47 -> {48}; - 48 -> {49 53}; + 48 -> {49}; 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54 56}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - subgraph cluster_13 { + subgraph cluster_8 { color=red - 61 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_14 { - color=blue - 62 [label="Enter block"]; - 63 [label="Access variable R|/x|"]; - 64 [label="Function call: R|/x|.R|/A.bool|()"]; - 65 [label="Exit block"]; - } - 66 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 51 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 52 [label="Access variable R|/x|"]; + 53 [label="Function call: R|/x|.R|/A.bool|()"]; + 54 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + + subgraph cluster_9 { + color=red + 55 [label="Enter function test_4" style="filled" fillcolor=red]; + 56 [label="Access variable R|/x|"]; + 57 [label="Enter safe call"]; + 58 [label="Function call: R|/x|?.R|/A.id|()"]; + 59 [label="Exit safe call"]; + 60 [label="Enter safe call"]; + 61 [label="Function call: R|/x|?.R|/A.id|()?.R|/A.bool|()"]; + 62 [label="Exit safe call"]; + 63 [label="Access variable R|/x|"]; + 64 [label="Function call: R|/x|.#()"]; + 65 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 55 -> {56}; + 56 -> {57 59}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60 62}; + 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; - 65 -> {66}; - subgraph cluster_15 { + subgraph cluster_10 { color=red - 67 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_16 { + 66 [label="Enter function boo" style="filled" fillcolor=red]; + 67 [label="Exit function boo" style="filled" fillcolor=red]; + } + + 66 -> {67}; + + subgraph cluster_11 { + color=red + 68 [label="Enter function test_5" style="filled" fillcolor=red]; + 69 [label="Access variable R|/x|"]; + 70 [label="Enter safe call"]; + subgraph cluster_12 { color=blue - 68 [label="Enter block"]; - 69 [label="Access variable R|/x|"]; - 70 [label="Enter safe call"]; - 71 [label="Function call: R|/x|?.R|/A.id|()"]; - 72 [label="Exit safe call"]; - 73 [label="Enter safe call"]; - 74 [label="Function call: R|/x|?.R|/A.id|()?.R|/A.bool|()"]; - 75 [label="Exit safe call"]; - 76 [label="Access variable R|/x|"]; - 77 [label="Function call: R|/x|.#()"]; - 78 [label="Exit block"]; + 71 [label="Enter function anonymousFunction"]; + 72 [label="Jump: ^ Unit"]; + 73 [label="Stub" style="filled" fillcolor=gray]; + 74 [label="Exit function anonymousFunction"]; } - 79 [label="Exit function test_4" style="filled" fillcolor=red]; - } - - 67 -> {68}; - 68 -> {69}; - 69 -> {70 72}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73 75}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - - subgraph cluster_17 { - color=red - 80 [label="Enter function boo" style="filled" fillcolor=red]; - 81 [label="Exit function boo" style="filled" fillcolor=red]; - } - - 80 -> {81}; - - subgraph cluster_18 { - color=red - 82 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_19 { - color=blue - 83 [label="Enter block"]; - 84 [label="Access variable R|/x|"]; - 85 [label="Enter safe call"]; - subgraph cluster_20 { - color=blue - 86 [label="Enter function anonymousFunction"]; - subgraph cluster_21 { - color=blue - 87 [label="Enter block"]; - 88 [label="Jump: ^ Unit"]; - 89 [label="Stub" style="filled" fillcolor=gray]; - 90 [label="Exit block" style="filled" fillcolor=gray]; - } - 91 [label="Exit function anonymousFunction"]; - } - 92 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { + 75 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { ^ Unit } )"]; - 93 [label="Exit safe call"]; - 94 [label="Enter safe call"]; - 95 [label="Access variable R|/x|"]; - 96 [label="Function call: R|/x|.R|/A.bool|()"]; - 97 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { + 76 [label="Exit safe call"]; + 77 [label="Enter safe call"]; + 78 [label="Access variable R|/x|"]; + 79 [label="Function call: R|/x|.R|/A.bool|()"]; + 80 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { ^ Unit } )?.R|/boo|(R|/x|.R|/A.bool|())"]; - 98 [label="Exit safe call"]; - 99 [label="Access variable R|/x|"]; - 100 [label="Function call: R|/x|.#()"]; - 101 [label="Exit block"]; - } - 102 [label="Exit function test_5" style="filled" fillcolor=red]; + 81 [label="Exit safe call"]; + 82 [label="Access variable R|/x|"]; + 83 [label="Function call: R|/x|.#()"]; + 84 [label="Exit function test_5" style="filled" fillcolor=red]; } + 68 -> {69}; + 69 -> {70 76}; + 70 -> {71}; + 71 -> {72}; + 72 -> {74}; + 72 -> {73} [style=dotted]; + 73 -> {74} [style=dotted]; + 74 -> {75}; + 75 -> {76}; + 76 -> {77 81}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; 82 -> {83}; 83 -> {84}; - 84 -> {85 93}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {91}; - 88 -> {89} [style=dotted]; - 89 -> {90} [style=dotted]; - 90 -> {91} [style=dotted]; - 91 -> {92}; - 92 -> {93}; - 93 -> {94 98}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.txt b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.txt index e5405d796f9..62b8f3926b4 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.txt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.txt @@ -32,7 +32,7 @@ FILE: safeCalls.kt } public final fun R|kotlin/Any?|.boo(b: R|kotlin/Boolean|): R|kotlin/Unit| public final fun test_5(x: R|A?|): R|kotlin/Unit| { - R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { + R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Unit| { ^ Unit } )?.R|/boo|(R|/x|.R|/A.bool|()) diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot index fe595816f6b..bbb5bba9ad6 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot @@ -8,34 +8,29 @@ digraph simpleIf_kt { 0 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Access variable R|/x|"]; - 5 [label="Type operator: x is String"]; - 6 [label="Exit when branch condition"]; - } - 7 [label="Synthetic else branch"]; - 8 [label="Enter when branch result"]; - subgraph cluster_4 { - color=blue - 9 [label="Enter block"]; - 10 [label="Access variable R|/x|"]; - 11 [label="Access variable R|kotlin/String.length|"]; - 12 [label="Exit block"]; - } - 13 [label="Exit when branch result"]; - 14 [label="Exit when"]; + 2 [label="Enter when branch condition "]; + 3 [label="Access variable R|/x|"]; + 4 [label="Type operator: x is String"]; + 5 [label="Exit when branch condition"]; } - 15 [label="Access variable R|/x|"]; - 16 [label="Access variable #"]; - 17 [label="Exit block"]; + 6 [label="Synthetic else branch"]; + 7 [label="Enter when branch result"]; + subgraph cluster_3 { + color=blue + 8 [label="Enter block"]; + 9 [label="Access variable R|/x|"]; + 10 [label="Access variable R|kotlin/String.length|"]; + 11 [label="Exit block"]; + } + 12 [label="Exit when branch result"]; + 13 [label="Exit when"]; } - 18 [label="Exit function test_1" style="filled" fillcolor=red]; + 14 [label="Access variable R|/x|"]; + 15 [label="Access variable #"]; + 16 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -43,9 +38,9 @@ digraph simpleIf_kt { 2 -> {3}; 3 -> {4}; 4 -> {5}; - 5 -> {6}; - 6 -> {8 7}; - 7 -> {14}; + 5 -> {7 6}; + 6 -> {13}; + 7 -> {8}; 8 -> {9}; 9 -> {10}; 10 -> {11}; @@ -54,157 +49,141 @@ digraph simpleIf_kt { 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - subgraph cluster_5 { + subgraph cluster_4 { color=red - 19 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_6 { + 17 [label="Enter function test_2" style="filled" fillcolor=red]; + 18 [label="Access variable R|/x|"]; + 19 [label="Type operator: x is String"]; + 20 [label="Variable declaration: lval b: R|kotlin/Boolean|"]; + subgraph cluster_5 { color=blue - 20 [label="Enter block"]; - 21 [label="Access variable R|/x|"]; - 22 [label="Type operator: x is String"]; - 23 [label="Variable declaration: lval b: R|kotlin/Boolean|"]; + 21 [label="Enter when"]; + subgraph cluster_6 { + color=blue + 22 [label="Enter when branch condition "]; + 23 [label="Access variable R|/b|"]; + 24 [label="Exit when branch condition"]; + } + 25 [label="Synthetic else branch"]; + 26 [label="Enter when branch result"]; subgraph cluster_7 { color=blue - 24 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 25 [label="Enter when branch condition "]; - 26 [label="Access variable R|/b|"]; - 27 [label="Exit when branch condition"]; - } - 28 [label="Synthetic else branch"]; - 29 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 30 [label="Enter block"]; - 31 [label="Access variable R|/x|"]; - 32 [label="Access variable R|kotlin/String.length|"]; - 33 [label="Exit block"]; - } - 34 [label="Exit when branch result"]; - 35 [label="Exit when"]; + 27 [label="Enter block"]; + 28 [label="Access variable R|/x|"]; + 29 [label="Access variable R|kotlin/String.length|"]; + 30 [label="Exit block"]; } - 36 [label="Access variable R|/x|"]; - 37 [label="Access variable #"]; - 38 [label="Exit block"]; + 31 [label="Exit when branch result"]; + 32 [label="Exit when"]; } - 39 [label="Exit function test_2" style="filled" fillcolor=red]; + 33 [label="Access variable R|/x|"]; + 34 [label="Access variable #"]; + 35 [label="Exit function test_2" style="filled" fillcolor=red]; } + 17 -> {18}; + 18 -> {19}; 19 -> {20}; 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; - 24 -> {25}; - 25 -> {26}; + 24 -> {26 25}; + 25 -> {32}; 26 -> {27}; - 27 -> {29 28}; - 28 -> {35}; + 27 -> {28}; + 28 -> {29}; 29 -> {30}; 30 -> {31}; 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; - 35 -> {36}; + + subgraph cluster_8 { + color=red + 36 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 37 [label="Enter when"]; + subgraph cluster_10 { + color=blue + 38 [label="Enter when branch condition "]; + 39 [label="Access variable R|/x|"]; + 40 [label="Type operator: x !is String"]; + 41 [label="Exit when branch condition"]; + } + subgraph cluster_11 { + color=blue + 42 [label="Enter when branch condition "]; + 43 [label="Access variable R|/x|"]; + 44 [label="Type operator: x !is Int"]; + 45 [label="Exit when branch condition"]; + } + subgraph cluster_12 { + color=blue + 46 [label="Enter when branch condition else"]; + 47 [label="Exit when branch condition"]; + } + 48 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Access variable R|kotlin/String.length|"]; + 52 [label="Access variable R|/x|"]; + 53 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 54 [label="Exit block"]; + } + 55 [label="Exit when branch result"]; + 56 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 57 [label="Enter block"]; + 58 [label="Exit block"]; + } + 59 [label="Exit when branch result"]; + 60 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 61 [label="Enter block"]; + 62 [label="Exit block"]; + } + 63 [label="Exit when branch result"]; + 64 [label="Exit when"]; + } + 65 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 36 -> {37}; 37 -> {38}; 38 -> {39}; - - subgraph cluster_10 { - color=red - 40 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 41 [label="Enter block"]; - subgraph cluster_12 { - color=blue - 42 [label="Enter when"]; - subgraph cluster_13 { - color=blue - 43 [label="Enter when branch condition "]; - 44 [label="Access variable R|/x|"]; - 45 [label="Type operator: x !is String"]; - 46 [label="Exit when branch condition"]; - } - subgraph cluster_14 { - color=blue - 47 [label="Enter when branch condition "]; - 48 [label="Access variable R|/x|"]; - 49 [label="Type operator: x !is Int"]; - 50 [label="Exit when branch condition"]; - } - subgraph cluster_15 { - color=blue - 51 [label="Enter when branch condition else"]; - 52 [label="Exit when branch condition"]; - } - 53 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 54 [label="Enter block"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Access variable R|kotlin/String.length|"]; - 57 [label="Access variable R|/x|"]; - 58 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 59 [label="Exit block"]; - } - 60 [label="Exit when branch result"]; - 61 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 62 [label="Enter block"]; - 63 [label="Exit block"]; - } - 64 [label="Exit when branch result"]; - 65 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 66 [label="Enter block"]; - 67 [label="Exit block"]; - } - 68 [label="Exit when branch result"]; - 69 [label="Exit when"]; - } - 70 [label="Exit block"]; - } - 71 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 39 -> {40}; 40 -> {41}; - 41 -> {42}; + 41 -> {60 42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; - 45 -> {46}; - 46 -> {65 47}; + 45 -> {56 46}; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {61 51}; + 50 -> {51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; - 55 -> {56}; + 55 -> {64}; 56 -> {57}; 57 -> {58}; 58 -> {59}; - 59 -> {60}; - 60 -> {69}; + 59 -> {64}; + 60 -> {61}; 61 -> {62}; 62 -> {63}; 63 -> {64}; - 64 -> {69}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; + 64 -> {65}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot index 9f1ae3d7f02..5e485c303a8 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot @@ -6,18 +6,13 @@ digraph smartcastAfterReassignment_kt { subgraph cluster_0 { color=red 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter block"]; - 2 [label="Const: Int(1)"]; - 3 [label="Variable declaration: lvar x: R|kotlin/Any|"]; - 4 [label="Const: String()"]; - 5 [label="Assignmenet: R|/x|"]; - 6 [label="Access variable R|/x|"]; - 7 [label="Access variable R|kotlin/String.length|"]; - 8 [label="Exit block"]; - } - 9 [label="Exit function test_1" style="filled" fillcolor=red]; + 1 [label="Const: Int(1)"]; + 2 [label="Variable declaration: lvar x: R|kotlin/Any|"]; + 3 [label="Const: String()"]; + 4 [label="Assignmenet: R|/x|"]; + 5 [label="Access variable R|/x|"]; + 6 [label="Access variable R|kotlin/String.length|"]; + 7 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -27,105 +22,89 @@ digraph smartcastAfterReassignment_kt { 4 -> {5}; 5 -> {6}; 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - subgraph cluster_2 { + subgraph cluster_1 { color=red - 10 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_3 { + 8 [label="Enter function test_2" style="filled" fillcolor=red]; + 9 [label="Const: Null(null)"]; + 10 [label="Variable declaration: lvar x: R|kotlin/String?|"]; + subgraph cluster_2 { color=blue - 11 [label="Enter block"]; - 12 [label="Const: Null(null)"]; - 13 [label="Variable declaration: lvar x: R|kotlin/String?|"]; + 11 [label="Enter when"]; + subgraph cluster_3 { + color=blue + 12 [label="Enter when branch condition "]; + 13 [label="Access variable R|/x|"]; + 14 [label="Const: Null(null)"]; + 15 [label="Operator =="]; + 16 [label="Exit when branch condition"]; + } + 17 [label="Synthetic else branch"]; + 18 [label="Enter when branch result"]; subgraph cluster_4 { color=blue - 14 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 15 [label="Enter when branch condition "]; - 16 [label="Access variable R|/x|"]; - 17 [label="Const: Null(null)"]; - 18 [label="Operator =="]; - 19 [label="Exit when branch condition"]; - } - 20 [label="Synthetic else branch"]; - 21 [label="Enter when branch result"]; - subgraph cluster_6 { - color=blue - 22 [label="Enter block"]; - 23 [label="Const: String()"]; - 24 [label="Assignmenet: R|/x|"]; - 25 [label="Exit block"]; - } - 26 [label="Exit when branch result"]; - 27 [label="Exit when"]; + 19 [label="Enter block"]; + 20 [label="Const: String()"]; + 21 [label="Assignmenet: R|/x|"]; + 22 [label="Exit block"]; } - 28 [label="Access variable R|/x|"]; - 29 [label="Access variable R|kotlin/String.length|"]; - 30 [label="Exit block"]; + 23 [label="Exit when branch result"]; + 24 [label="Exit when"]; } - 31 [label="Exit function test_2" style="filled" fillcolor=red]; + 25 [label="Access variable R|/x|"]; + 26 [label="Access variable R|kotlin/String.length|"]; + 27 [label="Exit function test_2" style="filled" fillcolor=red]; } + 8 -> {9}; + 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; - 16 -> {17}; - 17 -> {18}; + 16 -> {18 17}; + 17 -> {24}; 18 -> {19}; - 19 -> {21 20}; - 20 -> {27}; + 19 -> {20}; + 20 -> {21}; 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; 25 -> {26}; 26 -> {27}; - 27 -> {28}; + + subgraph cluster_5 { + color=red + 28 [label="Enter function test_3" style="filled" fillcolor=red]; + 29 [label="Const: Null(null)"]; + 30 [label="Variable declaration: lvar x: R|kotlin/String?|"]; + 31 [label="Const: String()"]; + 32 [label="Assignmenet: R|/x|"]; + 33 [label="Access variable R|/x|"]; + 34 [label="Access variable R|kotlin/String.length|"]; + 35 [label="Const: Null(null)"]; + 36 [label="Assignmenet: R|/x|"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Stub" style="filled" fillcolor=gray]; + 39 [label="Access variable #" style="filled" fillcolor=gray]; + 40 [label="Exit function test_3" style="filled" fillcolor=red]; + } + 28 -> {29}; 29 -> {30}; 30 -> {31}; - - subgraph cluster_7 { - color=red - 32 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_8 { - color=blue - 33 [label="Enter block"]; - 34 [label="Const: Null(null)"]; - 35 [label="Variable declaration: lvar x: R|kotlin/String?|"]; - 36 [label="Const: String()"]; - 37 [label="Assignmenet: R|/x|"]; - 38 [label="Access variable R|/x|"]; - 39 [label="Access variable R|kotlin/String.length|"]; - 40 [label="Const: Null(null)"]; - 41 [label="Assignmenet: R|/x|"]; - 42 [label="Access variable R|/x|"]; - 43 [label="Stub" style="filled" fillcolor=gray]; - 44 [label="Access variable #" style="filled" fillcolor=gray]; - 45 [label="Exit block" style="filled" fillcolor=gray]; - } - 46 [label="Exit function test_3" style="filled" fillcolor=red]; - } - + 31 -> {32}; 32 -> {33}; 33 -> {34}; 34 -> {35}; 35 -> {36}; 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {46}; - 42 -> {43} [style=dotted]; - 43 -> {44} [style=dotted]; - 44 -> {45} [style=dotted]; - 45 -> {46} [style=dotted]; + 37 -> {40}; + 37 -> {38} [style=dotted]; + 38 -> {39} [style=dotted]; + 39 -> {40} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot index 7da30a8d509..bbeb0eaf35f 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot @@ -8,32 +8,27 @@ digraph smartcastOnLambda_kt { 0 [label="Enter function test" style="filled" fillcolor=red]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; + 1 [label="Enter when"]; subgraph cluster_2 { color=blue - 2 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Access variable R|/func|"]; - 5 [label="Const: Null(null)"]; - 6 [label="Operator !="]; - 7 [label="Exit when branch condition"]; - } - 8 [label="Synthetic else branch"]; - 9 [label="Enter when branch result"]; - subgraph cluster_4 { - color=blue - 10 [label="Enter block"]; - 11 [label="Function call: R|/func|.R|FakeOverride|()"]; - 12 [label="Exit block"]; - } - 13 [label="Exit when branch result"]; - 14 [label="Exit when"]; + 2 [label="Enter when branch condition "]; + 3 [label="Access variable R|/func|"]; + 4 [label="Const: Null(null)"]; + 5 [label="Operator !="]; + 6 [label="Exit when branch condition"]; } - 15 [label="Exit block"]; + 7 [label="Synthetic else branch"]; + 8 [label="Enter when branch result"]; + subgraph cluster_3 { + color=blue + 9 [label="Enter block"]; + 10 [label="Function call: R|/func|.R|FakeOverride|()"]; + 11 [label="Exit block"]; + } + 12 [label="Exit when branch result"]; + 13 [label="Exit when"]; } - 16 [label="Exit function test" style="filled" fillcolor=red]; + 14 [label="Exit function test" style="filled" fillcolor=red]; } 0 -> {1}; @@ -42,15 +37,13 @@ digraph smartcastOnLambda_kt { 3 -> {4}; 4 -> {5}; 5 -> {6}; - 6 -> {7}; - 7 -> {9 8}; - 8 -> {14}; + 6 -> {8 7}; + 7 -> {13}; + 8 -> {9}; 9 -> {10}; 10 -> {11}; 11 -> {12}; 12 -> {13}; 13 -> {14}; - 14 -> {15}; - 15 -> {16}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/when.dot b/compiler/fir/resolve/testData/resolve/smartcasts/when.dot index 1407949ea5c..c10ed9a8a11 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/when.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/when.dot @@ -24,119 +24,114 @@ digraph when_kt { 4 [label="Enter function test_1" style="filled" fillcolor=red]; subgraph cluster_3 { color=blue - 5 [label="Enter block"]; + 5 [label="Enter when"]; subgraph cluster_4 { color=blue - 6 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 7 [label="Enter when branch condition "]; - 8 [label="Access variable R|/x|"]; - 9 [label="Type operator: x is A"]; - 10 [label="Exit when branch condition"]; - } - subgraph cluster_6 { - color=blue - 11 [label="Enter when branch condition "]; - 12 [label="Access variable R|/x|"]; - 13 [label="Type operator: x is B"]; - 14 [label="Exit when branch condition"]; - } - 15 [label="Synthetic else branch"]; - 16 [label="Enter when branch result"]; - subgraph cluster_7 { - color=blue - 17 [label="Enter block"]; - 18 [label="Access variable R|/x|"]; - 19 [label="Function call: R|/x|.R|/B.bar|()"]; - 20 [label="Exit block"]; - } - 21 [label="Exit when branch result"]; - 22 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 23 [label="Enter block"]; - 24 [label="Access variable R|/x|"]; - 25 [label="Function call: R|/x|.R|/A.foo|()"]; - 26 [label="Exit block"]; - } - 27 [label="Exit when branch result"]; - 28 [label="Exit when"]; + 6 [label="Enter when branch condition "]; + 7 [label="Access variable R|/x|"]; + 8 [label="Type operator: x is A"]; + 9 [label="Exit when branch condition"]; } + subgraph cluster_5 { + color=blue + 10 [label="Enter when branch condition "]; + 11 [label="Access variable R|/x|"]; + 12 [label="Type operator: x is B"]; + 13 [label="Exit when branch condition"]; + } + 14 [label="Synthetic else branch"]; + 15 [label="Enter when branch result"]; + subgraph cluster_6 { + color=blue + 16 [label="Enter block"]; + 17 [label="Access variable R|/x|"]; + 18 [label="Function call: R|/x|.R|/B.bar|()"]; + 19 [label="Exit block"]; + } + 20 [label="Exit when branch result"]; + 21 [label="Enter when branch result"]; + subgraph cluster_7 { + color=blue + 22 [label="Enter block"]; + 23 [label="Access variable R|/x|"]; + 24 [label="Function call: R|/x|.R|/A.foo|()"]; + 25 [label="Exit block"]; + } + 26 [label="Exit when branch result"]; + 27 [label="Exit when"]; + } + subgraph cluster_8 { + color=blue + 28 [label="Enter when"]; subgraph cluster_9 { color=blue - 29 [label="Enter when"]; - subgraph cluster_10 { - color=blue - 30 [label="Enter when branch condition "]; - 31 [label="Access variable R|/x|"]; - 32 [label="Type operator: x !is A"]; - 33 [label="Exit when branch condition"]; - } - subgraph cluster_11 { - color=blue - 34 [label="Enter when branch condition "]; - 35 [label="Access variable R|/x|"]; - 36 [label="Type operator: x !is B"]; - 37 [label="Exit when branch condition"]; - } - subgraph cluster_12 { - color=blue - 38 [label="Enter when branch condition "]; - 39 [label="Access variable R|/x|"]; - 40 [label="Type operator: x is Int"]; - 41 [label="Exit when branch condition"]; - } - subgraph cluster_13 { - color=blue - 42 [label="Enter when branch condition else"]; - 43 [label="Exit when branch condition"]; - } - 44 [label="Enter when branch result"]; - subgraph cluster_14 { - color=blue - 45 [label="Enter block"]; - 46 [label="Access variable R|/x|"]; - 47 [label="Function call: R|/x|.R|/A.foo|()"]; - 48 [label="Access variable R|/x|"]; - 49 [label="Function call: R|/x|.R|/B.bar|()"]; - 50 [label="Exit block"]; - } - 51 [label="Exit when branch result"]; - 52 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 53 [label="Enter block"]; - 54 [label="Access variable R|/x|"]; - 55 [label="Function call: R|/x|.R|/A.foo|()"]; - 56 [label="Access variable R|/x|"]; - 57 [label="Function call: R|/x|.R|/B.bar|()"]; - 58 [label="Access variable R|/x|"]; - 59 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 60 [label="Exit block"]; - } - 61 [label="Exit when branch result"]; - 62 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 63 [label="Enter block"]; - 64 [label="Access variable R|/x|"]; - 65 [label="Function call: R|/x|.R|/A.foo|()"]; - 66 [label="Exit block"]; - } - 67 [label="Exit when branch result"]; - 68 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 69 [label="Enter block"]; - 70 [label="Exit block"]; - } - 71 [label="Exit when branch result"]; - 72 [label="Exit when"]; + 29 [label="Enter when branch condition "]; + 30 [label="Access variable R|/x|"]; + 31 [label="Type operator: x !is A"]; + 32 [label="Exit when branch condition"]; } - 73 [label="Exit block"]; + subgraph cluster_10 { + color=blue + 33 [label="Enter when branch condition "]; + 34 [label="Access variable R|/x|"]; + 35 [label="Type operator: x !is B"]; + 36 [label="Exit when branch condition"]; + } + subgraph cluster_11 { + color=blue + 37 [label="Enter when branch condition "]; + 38 [label="Access variable R|/x|"]; + 39 [label="Type operator: x is Int"]; + 40 [label="Exit when branch condition"]; + } + subgraph cluster_12 { + color=blue + 41 [label="Enter when branch condition else"]; + 42 [label="Exit when branch condition"]; + } + 43 [label="Enter when branch result"]; + subgraph cluster_13 { + color=blue + 44 [label="Enter block"]; + 45 [label="Access variable R|/x|"]; + 46 [label="Function call: R|/x|.R|/A.foo|()"]; + 47 [label="Access variable R|/x|"]; + 48 [label="Function call: R|/x|.R|/B.bar|()"]; + 49 [label="Exit block"]; + } + 50 [label="Exit when branch result"]; + 51 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 52 [label="Enter block"]; + 53 [label="Access variable R|/x|"]; + 54 [label="Function call: R|/x|.R|/A.foo|()"]; + 55 [label="Access variable R|/x|"]; + 56 [label="Function call: R|/x|.R|/B.bar|()"]; + 57 [label="Access variable R|/x|"]; + 58 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 59 [label="Exit block"]; + } + 60 [label="Exit when branch result"]; + 61 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 62 [label="Enter block"]; + 63 [label="Access variable R|/x|"]; + 64 [label="Function call: R|/x|.R|/A.foo|()"]; + 65 [label="Exit block"]; + } + 66 [label="Exit when branch result"]; + 67 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 68 [label="Enter block"]; + 69 [label="Exit block"]; + } + 70 [label="Exit when branch result"]; + 71 [label="Exit when"]; } - 74 [label="Exit function test_1" style="filled" fillcolor=red]; + 72 [label="Exit function test_1" style="filled" fillcolor=red]; } 4 -> {5}; @@ -144,19 +139,19 @@ digraph when_kt { 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; - 10 -> {22 11}; + 9 -> {21 10}; + 10 -> {11}; 11 -> {12}; 12 -> {13}; - 13 -> {14}; - 14 -> {16 15}; - 15 -> {28}; + 13 -> {15 14}; + 14 -> {27}; + 15 -> {16}; 16 -> {17}; 17 -> {18}; 18 -> {19}; 19 -> {20}; - 20 -> {21}; - 21 -> {28}; + 20 -> {27}; + 21 -> {22}; 22 -> {23}; 23 -> {24}; 24 -> {25}; @@ -167,16 +162,16 @@ digraph when_kt { 29 -> {30}; 30 -> {31}; 31 -> {32}; - 32 -> {33}; - 33 -> {68 34}; + 32 -> {67 33}; + 33 -> {34}; 34 -> {35}; 35 -> {36}; - 36 -> {37}; - 37 -> {62 38}; + 36 -> {61 37}; + 37 -> {38}; 38 -> {39}; 39 -> {40}; - 40 -> {41}; - 41 -> {52 42}; + 40 -> {51 41}; + 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; @@ -185,8 +180,8 @@ digraph when_kt { 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {51}; - 51 -> {72}; + 50 -> {71}; + 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; @@ -195,155 +190,150 @@ digraph when_kt { 57 -> {58}; 58 -> {59}; 59 -> {60}; - 60 -> {61}; - 61 -> {72}; + 60 -> {71}; + 61 -> {62}; 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; - 66 -> {67}; - 67 -> {72}; + 66 -> {71}; + 67 -> {68}; 68 -> {69}; 69 -> {70}; 70 -> {71}; 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - subgraph cluster_18 { + subgraph cluster_17 { color=red - 75 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_19 { + 73 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_18 { color=blue - 76 [label="Enter block"]; + 74 [label="Enter when"]; + 75 [label="Access variable R|/x|"]; + subgraph cluster_19 { + color=blue + 76 [label="Enter when branch condition "]; + 77 [label="Type operator: A"]; + 78 [label="Exit when branch condition"]; + } subgraph cluster_20 { color=blue - 77 [label="Enter when"]; - 78 [label="Access variable R|/x|"]; - subgraph cluster_21 { - color=blue - 79 [label="Enter when branch condition "]; - 80 [label="Type operator: A"]; - 81 [label="Exit when branch condition"]; - } - subgraph cluster_22 { - color=blue - 82 [label="Enter when branch condition "]; - 83 [label="Type operator: B"]; - 84 [label="Exit when branch condition"]; - } - 85 [label="Synthetic else branch"]; - 86 [label="Enter when branch result"]; - subgraph cluster_23 { - color=blue - 87 [label="Enter block"]; - 88 [label="Access variable R|/x|"]; - 89 [label="Function call: R|/x|.R|/B.bar|()"]; - 90 [label="Exit block"]; - } - 91 [label="Exit when branch result"]; - 92 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 93 [label="Enter block"]; - 94 [label="Access variable R|/x|"]; - 95 [label="Function call: R|/x|.R|/A.foo|()"]; - 96 [label="Exit block"]; - } - 97 [label="Exit when branch result"]; - 98 [label="Exit when"]; + 79 [label="Enter when branch condition "]; + 80 [label="Type operator: B"]; + 81 [label="Exit when branch condition"]; + } + 82 [label="Synthetic else branch"]; + 83 [label="Enter when branch result"]; + subgraph cluster_21 { + color=blue + 84 [label="Enter block"]; + 85 [label="Access variable R|/x|"]; + 86 [label="Function call: R|/x|.R|/B.bar|()"]; + 87 [label="Exit block"]; + } + 88 [label="Exit when branch result"]; + 89 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 90 [label="Enter block"]; + 91 [label="Access variable R|/x|"]; + 92 [label="Function call: R|/x|.R|/A.foo|()"]; + 93 [label="Exit block"]; + } + 94 [label="Exit when branch result"]; + 95 [label="Exit when"]; + } + subgraph cluster_23 { + color=blue + 96 [label="Enter when"]; + 97 [label="Access variable R|/x|"]; + subgraph cluster_24 { + color=blue + 98 [label="Enter when branch condition "]; + 99 [label="Type operator: A"]; + 100 [label="Exit when branch condition"]; } subgraph cluster_25 { color=blue - 99 [label="Enter when"]; - 100 [label="Access variable R|/x|"]; - subgraph cluster_26 { - color=blue - 101 [label="Enter when branch condition "]; - 102 [label="Type operator: A"]; - 103 [label="Exit when branch condition"]; - } - subgraph cluster_27 { - color=blue - 104 [label="Enter when branch condition "]; - 105 [label="Type operator: B"]; - 106 [label="Exit when branch condition"]; - } - subgraph cluster_28 { - color=blue - 107 [label="Enter when branch condition "]; - 108 [label="Type operator: Int"]; - 109 [label="Exit when branch condition"]; - } - subgraph cluster_29 { - color=blue - 110 [label="Enter when branch condition else"]; - 111 [label="Exit when branch condition"]; - } - 112 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 113 [label="Enter block"]; - 114 [label="Access variable R|/x|"]; - 115 [label="Function call: R|/x|.R|/A.foo|()"]; - 116 [label="Access variable R|/x|"]; - 117 [label="Function call: R|/x|.R|/B.bar|()"]; - 118 [label="Exit block"]; - } - 119 [label="Exit when branch result"]; - 120 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 121 [label="Enter block"]; - 122 [label="Access variable R|/x|"]; - 123 [label="Function call: R|/x|.R|/A.foo|()"]; - 124 [label="Access variable R|/x|"]; - 125 [label="Function call: R|/x|.R|/B.bar|()"]; - 126 [label="Access variable R|/x|"]; - 127 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 128 [label="Exit block"]; - } - 129 [label="Exit when branch result"]; - 130 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 131 [label="Enter block"]; - 132 [label="Access variable R|/x|"]; - 133 [label="Function call: R|/x|.R|/A.foo|()"]; - 134 [label="Exit block"]; - } - 135 [label="Exit when branch result"]; - 136 [label="Enter when branch result"]; - subgraph cluster_33 { - color=blue - 137 [label="Enter block"]; - 138 [label="Exit block"]; - } - 139 [label="Exit when branch result"]; - 140 [label="Exit when"]; + 101 [label="Enter when branch condition "]; + 102 [label="Type operator: B"]; + 103 [label="Exit when branch condition"]; } - 141 [label="Exit block"]; + subgraph cluster_26 { + color=blue + 104 [label="Enter when branch condition "]; + 105 [label="Type operator: Int"]; + 106 [label="Exit when branch condition"]; + } + subgraph cluster_27 { + color=blue + 107 [label="Enter when branch condition else"]; + 108 [label="Exit when branch condition"]; + } + 109 [label="Enter when branch result"]; + subgraph cluster_28 { + color=blue + 110 [label="Enter block"]; + 111 [label="Access variable R|/x|"]; + 112 [label="Function call: R|/x|.R|/A.foo|()"]; + 113 [label="Access variable R|/x|"]; + 114 [label="Function call: R|/x|.R|/B.bar|()"]; + 115 [label="Exit block"]; + } + 116 [label="Exit when branch result"]; + 117 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 118 [label="Enter block"]; + 119 [label="Access variable R|/x|"]; + 120 [label="Function call: R|/x|.R|/A.foo|()"]; + 121 [label="Access variable R|/x|"]; + 122 [label="Function call: R|/x|.R|/B.bar|()"]; + 123 [label="Access variable R|/x|"]; + 124 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 125 [label="Exit block"]; + } + 126 [label="Exit when branch result"]; + 127 [label="Enter when branch result"]; + subgraph cluster_30 { + color=blue + 128 [label="Enter block"]; + 129 [label="Access variable R|/x|"]; + 130 [label="Function call: R|/x|.R|/A.foo|()"]; + 131 [label="Exit block"]; + } + 132 [label="Exit when branch result"]; + 133 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 134 [label="Enter block"]; + 135 [label="Exit block"]; + } + 136 [label="Exit when branch result"]; + 137 [label="Exit when"]; } - 142 [label="Exit function test_2" style="filled" fillcolor=red]; + 138 [label="Exit function test_2" style="filled" fillcolor=red]; } + 73 -> {74}; + 74 -> {75}; 75 -> {76}; 76 -> {77}; 77 -> {78}; - 78 -> {79}; + 78 -> {89 79}; 79 -> {80}; 80 -> {81}; - 81 -> {92 82}; - 82 -> {83}; + 81 -> {83 82}; + 82 -> {95}; 83 -> {84}; - 84 -> {86 85}; - 85 -> {98}; + 84 -> {85}; + 85 -> {86}; 86 -> {87}; 87 -> {88}; - 88 -> {89}; + 88 -> {95}; 89 -> {90}; 90 -> {91}; - 91 -> {98}; + 91 -> {92}; 92 -> {93}; 93 -> {94}; 94 -> {95}; @@ -352,204 +342,199 @@ digraph when_kt { 97 -> {98}; 98 -> {99}; 99 -> {100}; - 100 -> {101}; + 100 -> {133 101}; 101 -> {102}; 102 -> {103}; - 103 -> {136 104}; + 103 -> {127 104}; 104 -> {105}; 105 -> {106}; - 106 -> {130 107}; + 106 -> {117 107}; 107 -> {108}; 108 -> {109}; - 109 -> {120 110}; + 109 -> {110}; 110 -> {111}; 111 -> {112}; 112 -> {113}; 113 -> {114}; 114 -> {115}; 115 -> {116}; - 116 -> {117}; + 116 -> {137}; 117 -> {118}; 118 -> {119}; - 119 -> {140}; + 119 -> {120}; 120 -> {121}; 121 -> {122}; 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; - 126 -> {127}; + 126 -> {137}; 127 -> {128}; 128 -> {129}; - 129 -> {140}; + 129 -> {130}; 130 -> {131}; 131 -> {132}; - 132 -> {133}; + 132 -> {137}; 133 -> {134}; 134 -> {135}; - 135 -> {140}; + 135 -> {136}; 136 -> {137}; 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {141}; - 141 -> {142}; - subgraph cluster_34 { + subgraph cluster_32 { color=red - 143 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_35 { + 139 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_33 { color=blue - 144 [label="Enter block"]; + 140 [label="Enter when"]; + 141 [label="Access variable R|/x|"]; + 142 [label="Variable declaration: lval y: R|kotlin/Any?|"]; + subgraph cluster_34 { + color=blue + 143 [label="Enter when branch condition "]; + 144 [label="Type operator: A"]; + 145 [label="Exit when branch condition"]; + } + subgraph cluster_35 { + color=blue + 146 [label="Enter when branch condition "]; + 147 [label="Type operator: B"]; + 148 [label="Exit when branch condition"]; + } + 149 [label="Synthetic else branch"]; + 150 [label="Enter when branch result"]; subgraph cluster_36 { color=blue - 145 [label="Enter when"]; - 146 [label="Access variable R|/x|"]; - 147 [label="Variable declaration: lval y: R|kotlin/Any?|"]; - subgraph cluster_37 { - color=blue - 148 [label="Enter when branch condition "]; - 149 [label="Type operator: A"]; - 150 [label="Exit when branch condition"]; - } - subgraph cluster_38 { - color=blue - 151 [label="Enter when branch condition "]; - 152 [label="Type operator: B"]; - 153 [label="Exit when branch condition"]; - } - 154 [label="Synthetic else branch"]; - 155 [label="Enter when branch result"]; - subgraph cluster_39 { - color=blue - 156 [label="Enter block"]; - 157 [label="Access variable R|/x|"]; - 158 [label="Function call: R|/x|.R|/B.bar|()"]; - 159 [label="Access variable R|/y|"]; - 160 [label="Function call: R|/y|.R|/B.bar|()"]; - 161 [label="Exit block"]; - } - 162 [label="Exit when branch result"]; - 163 [label="Enter when branch result"]; - subgraph cluster_40 { - color=blue - 164 [label="Enter block"]; - 165 [label="Access variable R|/x|"]; - 166 [label="Function call: R|/x|.R|/A.foo|()"]; - 167 [label="Access variable R|/y|"]; - 168 [label="Function call: R|/y|.R|/A.foo|()"]; - 169 [label="Exit block"]; - } - 170 [label="Exit when branch result"]; - 171 [label="Exit when"]; + 151 [label="Enter block"]; + 152 [label="Access variable R|/x|"]; + 153 [label="Function call: R|/x|.R|/B.bar|()"]; + 154 [label="Access variable R|/y|"]; + 155 [label="Function call: R|/y|.R|/B.bar|()"]; + 156 [label="Exit block"]; + } + 157 [label="Exit when branch result"]; + 158 [label="Enter when branch result"]; + subgraph cluster_37 { + color=blue + 159 [label="Enter block"]; + 160 [label="Access variable R|/x|"]; + 161 [label="Function call: R|/x|.R|/A.foo|()"]; + 162 [label="Access variable R|/y|"]; + 163 [label="Function call: R|/y|.R|/A.foo|()"]; + 164 [label="Exit block"]; + } + 165 [label="Exit when branch result"]; + 166 [label="Exit when"]; + } + subgraph cluster_38 { + color=blue + 167 [label="Enter when"]; + 168 [label="Access variable R|/x|"]; + 169 [label="Variable declaration: lval y: R|kotlin/Any?|"]; + subgraph cluster_39 { + color=blue + 170 [label="Enter when branch condition "]; + 171 [label="Type operator: A"]; + 172 [label="Exit when branch condition"]; + } + subgraph cluster_40 { + color=blue + 173 [label="Enter when branch condition "]; + 174 [label="Type operator: B"]; + 175 [label="Exit when branch condition"]; } subgraph cluster_41 { color=blue - 172 [label="Enter when"]; - 173 [label="Access variable R|/x|"]; - 174 [label="Variable declaration: lval y: R|kotlin/Any?|"]; - subgraph cluster_42 { - color=blue - 175 [label="Enter when branch condition "]; - 176 [label="Type operator: A"]; - 177 [label="Exit when branch condition"]; - } - subgraph cluster_43 { - color=blue - 178 [label="Enter when branch condition "]; - 179 [label="Type operator: B"]; - 180 [label="Exit when branch condition"]; - } - subgraph cluster_44 { - color=blue - 181 [label="Enter when branch condition "]; - 182 [label="Type operator: Int"]; - 183 [label="Exit when branch condition"]; - } - subgraph cluster_45 { - color=blue - 184 [label="Enter when branch condition else"]; - 185 [label="Exit when branch condition"]; - } - 186 [label="Enter when branch result"]; - subgraph cluster_46 { - color=blue - 187 [label="Enter block"]; - 188 [label="Access variable R|/x|"]; - 189 [label="Function call: R|/x|.R|/A.foo|()"]; - 190 [label="Access variable R|/x|"]; - 191 [label="Function call: R|/x|.R|/B.bar|()"]; - 192 [label="Access variable R|/y|"]; - 193 [label="Function call: R|/y|.R|/A.foo|()"]; - 194 [label="Access variable R|/y|"]; - 195 [label="Function call: R|/y|.R|/B.bar|()"]; - 196 [label="Exit block"]; - } - 197 [label="Exit when branch result"]; - 198 [label="Enter when branch result"]; - subgraph cluster_47 { - color=blue - 199 [label="Enter block"]; - 200 [label="Access variable R|/x|"]; - 201 [label="Function call: R|/x|.R|/A.foo|()"]; - 202 [label="Access variable R|/x|"]; - 203 [label="Function call: R|/x|.R|/B.bar|()"]; - 204 [label="Access variable R|/x|"]; - 205 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 206 [label="Access variable R|/y|"]; - 207 [label="Function call: R|/y|.R|/A.foo|()"]; - 208 [label="Access variable R|/y|"]; - 209 [label="Function call: R|/y|.R|/B.bar|()"]; - 210 [label="Access variable R|/y|"]; - 211 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; - 212 [label="Exit block"]; - } - 213 [label="Exit when branch result"]; - 214 [label="Enter when branch result"]; - subgraph cluster_48 { - color=blue - 215 [label="Enter block"]; - 216 [label="Access variable R|/x|"]; - 217 [label="Function call: R|/x|.R|/A.foo|()"]; - 218 [label="Access variable R|/y|"]; - 219 [label="Function call: R|/y|.R|/A.foo|()"]; - 220 [label="Exit block"]; - } - 221 [label="Exit when branch result"]; - 222 [label="Enter when branch result"]; - subgraph cluster_49 { - color=blue - 223 [label="Enter block"]; - 224 [label="Exit block"]; - } - 225 [label="Exit when branch result"]; - 226 [label="Exit when"]; + 176 [label="Enter when branch condition "]; + 177 [label="Type operator: Int"]; + 178 [label="Exit when branch condition"]; } - 227 [label="Exit block"]; + subgraph cluster_42 { + color=blue + 179 [label="Enter when branch condition else"]; + 180 [label="Exit when branch condition"]; + } + 181 [label="Enter when branch result"]; + subgraph cluster_43 { + color=blue + 182 [label="Enter block"]; + 183 [label="Access variable R|/x|"]; + 184 [label="Function call: R|/x|.R|/A.foo|()"]; + 185 [label="Access variable R|/x|"]; + 186 [label="Function call: R|/x|.R|/B.bar|()"]; + 187 [label="Access variable R|/y|"]; + 188 [label="Function call: R|/y|.R|/A.foo|()"]; + 189 [label="Access variable R|/y|"]; + 190 [label="Function call: R|/y|.R|/B.bar|()"]; + 191 [label="Exit block"]; + } + 192 [label="Exit when branch result"]; + 193 [label="Enter when branch result"]; + subgraph cluster_44 { + color=blue + 194 [label="Enter block"]; + 195 [label="Access variable R|/x|"]; + 196 [label="Function call: R|/x|.R|/A.foo|()"]; + 197 [label="Access variable R|/x|"]; + 198 [label="Function call: R|/x|.R|/B.bar|()"]; + 199 [label="Access variable R|/x|"]; + 200 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 201 [label="Access variable R|/y|"]; + 202 [label="Function call: R|/y|.R|/A.foo|()"]; + 203 [label="Access variable R|/y|"]; + 204 [label="Function call: R|/y|.R|/B.bar|()"]; + 205 [label="Access variable R|/y|"]; + 206 [label="Function call: R|/y|.R|kotlin/Int.inc|()"]; + 207 [label="Exit block"]; + } + 208 [label="Exit when branch result"]; + 209 [label="Enter when branch result"]; + subgraph cluster_45 { + color=blue + 210 [label="Enter block"]; + 211 [label="Access variable R|/x|"]; + 212 [label="Function call: R|/x|.R|/A.foo|()"]; + 213 [label="Access variable R|/y|"]; + 214 [label="Function call: R|/y|.R|/A.foo|()"]; + 215 [label="Exit block"]; + } + 216 [label="Exit when branch result"]; + 217 [label="Enter when branch result"]; + subgraph cluster_46 { + color=blue + 218 [label="Enter block"]; + 219 [label="Exit block"]; + } + 220 [label="Exit when branch result"]; + 221 [label="Exit when"]; } - 228 [label="Exit function test_3" style="filled" fillcolor=red]; + 222 [label="Exit function test_3" style="filled" fillcolor=red]; } + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; 143 -> {144}; 144 -> {145}; - 145 -> {146}; + 145 -> {158 146}; 146 -> {147}; 147 -> {148}; - 148 -> {149}; - 149 -> {150}; - 150 -> {163 151}; + 148 -> {150 149}; + 149 -> {166}; + 150 -> {151}; 151 -> {152}; 152 -> {153}; - 153 -> {155 154}; - 154 -> {171}; + 153 -> {154}; + 154 -> {155}; 155 -> {156}; 156 -> {157}; - 157 -> {158}; + 157 -> {166}; 158 -> {159}; 159 -> {160}; 160 -> {161}; 161 -> {162}; - 162 -> {171}; + 162 -> {163}; 163 -> {164}; 164 -> {165}; 165 -> {166}; @@ -559,18 +544,18 @@ digraph when_kt { 169 -> {170}; 170 -> {171}; 171 -> {172}; - 172 -> {173}; + 172 -> {217 173}; 173 -> {174}; 174 -> {175}; - 175 -> {176}; + 175 -> {209 176}; 176 -> {177}; - 177 -> {222 178}; - 178 -> {179}; + 177 -> {178}; + 178 -> {193 179}; 179 -> {180}; - 180 -> {214 181}; + 180 -> {181}; 181 -> {182}; 182 -> {183}; - 183 -> {198 184}; + 183 -> {184}; 184 -> {185}; 185 -> {186}; 186 -> {187}; @@ -579,12 +564,12 @@ digraph when_kt { 189 -> {190}; 190 -> {191}; 191 -> {192}; - 192 -> {193}; + 192 -> {221}; 193 -> {194}; 194 -> {195}; 195 -> {196}; 196 -> {197}; - 197 -> {226}; + 197 -> {198}; 198 -> {199}; 199 -> {200}; 200 -> {201}; @@ -595,83 +580,70 @@ digraph when_kt { 205 -> {206}; 206 -> {207}; 207 -> {208}; - 208 -> {209}; + 208 -> {221}; 209 -> {210}; 210 -> {211}; 211 -> {212}; 212 -> {213}; - 213 -> {226}; + 213 -> {214}; 214 -> {215}; 215 -> {216}; - 216 -> {217}; + 216 -> {221}; 217 -> {218}; 218 -> {219}; 219 -> {220}; 220 -> {221}; - 221 -> {226}; - 222 -> {223}; + 221 -> {222}; + + subgraph cluster_47 { + color=red + 223 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_48 { + color=blue + 224 [label="Enter when"]; + 225 [label="Access variable R|/x|"]; + 226 [label="Type operator: x as Int"]; + subgraph cluster_49 { + color=blue + 227 [label="Enter when branch condition "]; + 228 [label="Const: Int(1)"]; + 229 [label="Operator =="]; + 230 [label="Exit when branch condition"]; + } + 231 [label="Synthetic else branch"]; + 232 [label="Enter when branch result"]; + subgraph cluster_50 { + color=blue + 233 [label="Enter block"]; + 234 [label="Access variable R|/x|"]; + 235 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 236 [label="Exit block"]; + } + 237 [label="Exit when branch result"]; + 238 [label="Exit when"]; + } + 239 [label="Access variable R|/x|"]; + 240 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 241 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 223 -> {224}; 224 -> {225}; 225 -> {226}; 226 -> {227}; 227 -> {228}; - - subgraph cluster_50 { - color=red - 229 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_51 { - color=blue - 230 [label="Enter block"]; - subgraph cluster_52 { - color=blue - 231 [label="Enter when"]; - 232 [label="Access variable R|/x|"]; - 233 [label="Type operator: x as Int"]; - subgraph cluster_53 { - color=blue - 234 [label="Enter when branch condition "]; - 235 [label="Const: Int(1)"]; - 236 [label="Operator =="]; - 237 [label="Exit when branch condition"]; - } - 238 [label="Synthetic else branch"]; - 239 [label="Enter when branch result"]; - subgraph cluster_54 { - color=blue - 240 [label="Enter block"]; - 241 [label="Access variable R|/x|"]; - 242 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 243 [label="Exit block"]; - } - 244 [label="Exit when branch result"]; - 245 [label="Exit when"]; - } - 246 [label="Access variable R|/x|"]; - 247 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 248 [label="Exit block"]; - } - 249 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 228 -> {229}; 229 -> {230}; - 230 -> {231}; - 231 -> {232}; + 230 -> {232 231}; + 231 -> {238}; 232 -> {233}; 233 -> {234}; 234 -> {235}; 235 -> {236}; 236 -> {237}; - 237 -> {239 238}; - 238 -> {245}; + 237 -> {238}; + 238 -> {239}; 239 -> {240}; 240 -> {241}; - 241 -> {242}; - 242 -> {243}; - 243 -> {244}; - 244 -> {245}; - 245 -> {246}; - 246 -> {247}; - 247 -> {248}; - 248 -> {249}; } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot b/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot index fc5b602a685..2578435fabc 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot +++ b/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot @@ -6,31 +6,21 @@ digraph callsInPlace_kt { subgraph cluster_0 { color=red 0 [label="Enter function test" style="filled" fillcolor=red]; + 1 [label="Variable declaration: lval x: R|kotlin/Int|"]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; - 2 [label="Variable declaration: lval x: R|kotlin/Int|"]; - subgraph cluster_2 { - color=blue - 3 [label="Enter function anonymousFunction"]; - subgraph cluster_3 { - color=blue - 4 [label="Enter block"]; - 5 [label="Const: Int(1)"]; - 6 [label="Assignmenet: R|/x|"]; - 7 [label="Exit block"]; - } - 8 [label="Exit function anonymousFunction"]; - } - 9 [label="Function call: R|kotlin/run|( = run@fun (): R|kotlin/Unit| { + 2 [label="Enter function anonymousFunction"]; + 3 [label="Const: Int(1)"]; + 4 [label="Assignmenet: R|/x|"]; + 5 [label="Exit function anonymousFunction"]; + } + 6 [label="Function call: R|kotlin/run|( = run@fun (): R|kotlin/Unit| { R|/x| = Int(1) } )"]; - 10 [label="Access variable R|/x|"]; - 11 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 12 [label="Exit block"]; - } - 13 [label="Exit function test" style="filled" fillcolor=red]; + 7 [label="Access variable R|/x|"]; + 8 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 9 [label="Exit function test" style="filled" fillcolor=red]; } 0 -> {1}; @@ -42,118 +32,109 @@ digraph callsInPlace_kt { 6 -> {7}; 7 -> {8}; 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - subgraph cluster_4 { + subgraph cluster_2 { color=red - 14 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_5 { + 10 [label="Enter function test_2" style="filled" fillcolor=red]; + 11 [label="Const: Int(10)"]; + subgraph cluster_3 { color=blue - 15 [label="Enter block"]; - 16 [label="Const: Int(10)"]; - subgraph cluster_6 { - color=blue - 17 [label="Enter function anonymousFunction"]; - subgraph cluster_7 { - color=blue - 18 [label="Enter block"]; - 19 [label="Const: String(test_2)"]; - 20 [label="Exit block"]; - } - 21 [label="Exit function anonymousFunction"]; - } - 22 [label="Function call: R|kotlin/repeat|(Int(10), = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + 12 [label="Enter function anonymousFunction"]; + 13 [label="Const: String(test_2)"]; + 14 [label="Exit function anonymousFunction"]; + } + 15 [label="Function call: R|kotlin/repeat|(Int(10), = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { String(test_2) } )"]; - 23 [label="Exit block"]; - } - 24 [label="Exit function test_2" style="filled" fillcolor=red]; + 16 [label="Exit function test_2" style="filled" fillcolor=red]; } - 14 -> {15}; + 10 -> {11}; + 11 -> {12}; + 12 -> {14 13}; + 13 -> {14}; + 14 -> {12 15}; 15 -> {16}; - 16 -> {17}; - 17 -> {21 18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {17 22}; - 22 -> {23}; - 23 -> {24}; - subgraph cluster_8 { + subgraph cluster_4 { color=red - 25 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_9 { + 17 [label="Enter function test_3" style="filled" fillcolor=red]; + 18 [label="Const: Int(10)"]; + subgraph cluster_5 { color=blue - 26 [label="Enter block"]; - 27 [label="Const: Int(10)"]; - subgraph cluster_10 { - color=blue - 28 [label="Enter function anonymousFunction"]; - subgraph cluster_11 { - color=blue - 29 [label="Enter block"]; - 30 [label="Const: String(test_3)"]; - 31 [label="Exit block"]; - } - 32 [label="Exit function anonymousFunction"]; - } - 33 [label="Function call: R|kotlin/repeat|(action = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + 19 [label="Enter function anonymousFunction"]; + 20 [label="Const: String(test_3)"]; + 21 [label="Exit function anonymousFunction"]; + } + 22 [label="Function call: R|kotlin/repeat|(action = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { String(test_3) } , times = Int(10))"]; - 34 [label="Exit block"]; - } - 35 [label="Exit function test_3" style="filled" fillcolor=red]; + 23 [label="Exit function test_3" style="filled" fillcolor=red]; } - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {32 29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {28 33}; - 33 -> {34}; - 34 -> {35}; + 17 -> {18}; + 18 -> {19}; + 19 -> {21 20}; + 20 -> {21}; + 21 -> {19 22}; + 22 -> {23}; - subgraph cluster_12 { + subgraph cluster_6 { color=red - 36 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_13 { + 24 [label="Enter function test_4" style="filled" fillcolor=red]; + 25 [label="Const: Int(1)"]; + subgraph cluster_7 { color=blue - 37 [label="Enter block"]; - 38 [label="Const: Int(1)"]; - subgraph cluster_14 { - color=blue - 39 [label="Enter function anonymousFunction"]; - subgraph cluster_15 { - color=blue - 40 [label="Enter block"]; - 41 [label="Const: String(test_4)"]; - 42 [label="Access variable R|/it|"]; - 43 [label="Const: Int(0)"]; - 44 [label="Operator >"]; - 45 [label="Exit block"]; - } - 46 [label="Exit function anonymousFunction"]; - } - 47 [label="Function call: Int(1).R|kotlin/takeUnless|( = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { + 26 [label="Enter function anonymousFunction"]; + 27 [label="Const: String(test_4)"]; + 28 [label="Access variable R|/it|"]; + 29 [label="Const: Int(0)"]; + 30 [label="Operator >"]; + 31 [label="Exit function anonymousFunction"]; + } + 32 [label="Function call: Int(1).R|kotlin/takeUnless|( = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { String(test_4) >(R|/it|, Int(0)) } )"]; - 48 [label="Exit block"]; - } - 49 [label="Exit function test_4" style="filled" fillcolor=red]; + 33 [label="Exit function test_4" style="filled" fillcolor=red]; } + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + + subgraph cluster_8 { + color=red + 34 [label="Enter function test_5" style="filled" fillcolor=red]; + 35 [label="Const: Int(1)"]; + subgraph cluster_9 { + color=blue + 36 [label="Enter function anonymousFunction"]; + 37 [label="Const: String(test_5)"]; + 38 [label="Access variable R|/it|"]; + 39 [label="Const: Int(0)"]; + 40 [label="Operator >"]; + 41 [label="Exit function anonymousFunction"]; + } + 42 [label="Function call: Int(1).R|kotlin/takeUnless|(predicate = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { + String(test_5) + >(R|/it|, Int(0)) +} +)"]; + 43 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 34 -> {35}; + 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; @@ -161,239 +142,118 @@ digraph callsInPlace_kt { 40 -> {41}; 41 -> {42}; 42 -> {43}; - 43 -> {44}; + + subgraph cluster_10 { + color=red + 44 [label="Enter function myRun" style="filled" fillcolor=red]; + 45 [label="Function call: R|/block1|.R|FakeOverride|()"]; + 46 [label="Function call: R|/block2|.R|FakeOverride|()"]; + 47 [label="Exit function myRun" style="filled" fillcolor=red]; + } + 44 -> {45}; 45 -> {46}; 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - subgraph cluster_16 { + subgraph cluster_11 { color=red - 50 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_17 { + 48 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_12 { color=blue - 51 [label="Enter block"]; - 52 [label="Const: Int(1)"]; - subgraph cluster_18 { - color=blue - 53 [label="Enter function anonymousFunction"]; - subgraph cluster_19 { - color=blue - 54 [label="Enter block"]; - 55 [label="Const: String(test_5)"]; - 56 [label="Access variable R|/it|"]; - 57 [label="Const: Int(0)"]; - 58 [label="Operator >"]; - 59 [label="Exit block"]; - } - 60 [label="Exit function anonymousFunction"]; - } - 61 [label="Function call: Int(1).R|kotlin/takeUnless|(predicate = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { - String(test_5) - >(R|/it|, Int(0)) -} -)"]; - 62 [label="Exit block"]; + 49 [label="Enter function anonymousFunction"]; + 50 [label="Const: String(test_6_1)"]; + 51 [label="Exit function anonymousFunction"]; } - 63 [label="Exit function test_5" style="filled" fillcolor=red]; - } - - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - - subgraph cluster_20 { - color=red - 64 [label="Enter function myRun" style="filled" fillcolor=red]; - subgraph cluster_21 { + subgraph cluster_13 { color=blue - 65 [label="Enter block"]; - 66 [label="Function call: R|/block1|.R|FakeOverride|()"]; - 67 [label="Function call: R|/block2|.R|FakeOverride|()"]; - 68 [label="Exit block"]; + 52 [label="Enter function anonymousFunction"]; + 53 [label="Const: String(test_6_2)"]; + 54 [label="Exit function anonymousFunction"]; } - 69 [label="Exit function myRun" style="filled" fillcolor=red]; - } - - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - - subgraph cluster_22 { - color=red - 70 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_23 { - color=blue - 71 [label="Enter block"]; - subgraph cluster_24 { - color=blue - 72 [label="Enter function anonymousFunction"]; - subgraph cluster_25 { - color=blue - 73 [label="Enter block"]; - 74 [label="Const: String(test_6_1)"]; - 75 [label="Exit block"]; - } - 76 [label="Exit function anonymousFunction"]; - } - subgraph cluster_26 { - color=blue - 77 [label="Enter function anonymousFunction"]; - subgraph cluster_27 { - color=blue - 78 [label="Enter block"]; - 79 [label="Const: String(test_6_2)"]; - 80 [label="Exit block"]; - } - 81 [label="Exit function anonymousFunction"]; - } - 82 [label="Function call: R|/myRun|(myRun@fun (): R|kotlin/Unit| { + 55 [label="Function call: R|/myRun|(myRun@fun (): R|kotlin/Unit| { String(test_6_1) } , = myRun@fun (): R|kotlin/Unit| { String(test_6_2) } )"]; - 83 [label="Exit block"]; - } - 84 [label="Exit function test_6" style="filled" fillcolor=red]; + 56 [label="Exit function test_6" style="filled" fillcolor=red]; } - 70 -> {71}; - 71 -> {72}; - 72 -> {76 73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {72 77}; - 77 -> {81 78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {77 82}; - 82 -> {83}; - 83 -> {84}; + 48 -> {49}; + 49 -> {51 50}; + 50 -> {51}; + 51 -> {49 52}; + 52 -> {54 53}; + 53 -> {54}; + 54 -> {52 55}; + 55 -> {56}; - subgraph cluster_28 { + subgraph cluster_14 { color=red - 85 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_29 { + 57 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_15 { color=blue - 86 [label="Enter block"]; - subgraph cluster_30 { - color=blue - 87 [label="Enter function anonymousFunction"]; - subgraph cluster_31 { - color=blue - 88 [label="Enter block"]; - 89 [label="Const: String(test_7_2)"]; - 90 [label="Exit block"]; - } - 91 [label="Exit function anonymousFunction"]; - } - subgraph cluster_32 { - color=blue - 92 [label="Enter function anonymousFunction"]; - subgraph cluster_33 { - color=blue - 93 [label="Enter block"]; - 94 [label="Const: String(test_7_1)"]; - 95 [label="Exit block"]; - } - 96 [label="Exit function anonymousFunction"]; - } - 97 [label="Function call: R|/myRun|(block2 = myRun@fun (): R|kotlin/Unit| { + 58 [label="Enter function anonymousFunction"]; + 59 [label="Const: String(test_7_2)"]; + 60 [label="Exit function anonymousFunction"]; + } + subgraph cluster_16 { + color=blue + 61 [label="Enter function anonymousFunction"]; + 62 [label="Const: String(test_7_1)"]; + 63 [label="Exit function anonymousFunction"]; + } + 64 [label="Function call: R|/myRun|(block2 = myRun@fun (): R|kotlin/Unit| { String(test_7_2) } , block1 = myRun@fun (): R|kotlin/Unit| { String(test_7_1) } )"]; - 98 [label="Exit block"]; - } - 99 [label="Exit function test_7" style="filled" fillcolor=red]; + 65 [label="Exit function test_7" style="filled" fillcolor=red]; } - 85 -> {86}; - 86 -> {87}; - 87 -> {91 88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {87 92}; - 92 -> {96 93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {92 97}; - 97 -> {98}; - 98 -> {99}; + 57 -> {58}; + 58 -> {60 59}; + 59 -> {60}; + 60 -> {58 61}; + 61 -> {63 62}; + 62 -> {63}; + 63 -> {61 64}; + 64 -> {65}; - subgraph cluster_34 { + subgraph cluster_17 { color=red - 100 [label="Enter function myDummyRun" style="filled" fillcolor=red]; - subgraph cluster_35 { - color=blue - 101 [label="Enter block"]; - 102 [label="Function call: R|/block|.R|FakeOverride|()"]; - 103 [label="Exit block"]; - } - 104 [label="Exit function myDummyRun" style="filled" fillcolor=red]; + 66 [label="Enter function myDummyRun" style="filled" fillcolor=red]; + 67 [label="Function call: R|/block|.R|FakeOverride|()"]; + 68 [label="Exit function myDummyRun" style="filled" fillcolor=red]; } - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; + 66 -> {67}; + 67 -> {68}; - subgraph cluster_36 { + subgraph cluster_18 { color=red - 105 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_37 { - color=blue - 106 [label="Enter block"]; - 107 [label="Function call: R|/myDummyRun|( = myDummyRun@fun (): R|kotlin/Unit| { + 69 [label="Enter function test_8" style="filled" fillcolor=red]; + 70 [label="Function call: R|/myDummyRun|( = myDummyRun@fun (): R|kotlin/Unit| { String(test_8) } )"]; - 108 [label="Exit block"]; - } - 109 [label="Exit function test_8" style="filled" fillcolor=red]; + 71 [label="Exit function test_8" style="filled" fillcolor=red]; } - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; + 69 -> {70}; + 70 -> {71}; - subgraph cluster_38 { + subgraph cluster_19 { color=red - 110 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - subgraph cluster_39 { - color=blue - 111 [label="Enter block"]; - 112 [label="Const: String(test_8)"]; - 113 [label="Exit block"]; - } - 114 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + 72 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 73 [label="Const: String(test_8)"]; + 74 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; } - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; + 72 -> {73}; + 73 -> {74}; } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot b/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot index d2232e7d9d7..762870503ce 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot +++ b/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot @@ -6,24 +6,19 @@ digraph conditionalEffects_kt { subgraph cluster_0 { color=red 0 [label="Enter function test_1" style="filled" fillcolor=red]; + 1 [label="Access variable R|/x|"]; + 2 [label="Type operator: x is Int"]; + 3 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/Int|))"]; subgraph cluster_1 { color=blue - 1 [label="Enter block"]; - 2 [label="Access variable R|/x|"]; - 3 [label="Type operator: x is Int"]; - 4 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/Int|))"]; - subgraph cluster_2 { - color=blue - 5 [label="Enter contract"]; - 6 [label="Access variable R|/x|"]; - 7 [label="Type operator: x is Int"]; - 8 [label="Exit contract"]; - } - 9 [label="Access variable R|/x|"]; - 10 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 11 [label="Exit block"]; + 4 [label="Enter contract"]; + 5 [label="Access variable R|/x|"]; + 6 [label="Type operator: x is Int"]; + 7 [label="Exit contract"]; } - 12 [label="Exit function test_1" style="filled" fillcolor=red]; + 8 [label="Access variable R|/x|"]; + 9 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 10 [label="Exit function test_1" style="filled" fillcolor=red]; } 0 -> {1}; @@ -36,32 +31,27 @@ digraph conditionalEffects_kt { 7 -> {8}; 8 -> {9}; 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - subgraph cluster_3 { + subgraph cluster_2 { color=red - 13 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_4 { + 11 [label="Enter function test_2" style="filled" fillcolor=red]; + 12 [label="Access variable R|/x|"]; + 13 [label="Function call: R|kotlin/requireNotNull|(R|/x|)"]; + subgraph cluster_3 { color=blue - 14 [label="Enter block"]; + 14 [label="Enter contract"]; 15 [label="Access variable R|/x|"]; - 16 [label="Function call: R|kotlin/requireNotNull|(R|/x|)"]; - subgraph cluster_5 { - color=blue - 17 [label="Enter contract"]; - 18 [label="Access variable R|/x|"]; - 19 [label="Const: Null(null)"]; - 20 [label="Operator !="]; - 21 [label="Exit contract"]; - } - 22 [label="Access variable R|/x|"]; - 23 [label="Access variable R|kotlin/String.length|"]; - 24 [label="Exit block"]; + 16 [label="Const: Null(null)"]; + 17 [label="Operator !="]; + 18 [label="Exit contract"]; } - 25 [label="Exit function test_2" style="filled" fillcolor=red]; + 19 [label="Access variable R|/x|"]; + 20 [label="Access variable R|kotlin/String.length|"]; + 21 [label="Exit function test_2" style="filled" fillcolor=red]; } + 11 -> {12}; + 12 -> {13}; 13 -> {14}; 14 -> {15}; 15 -> {16}; @@ -70,36 +60,31 @@ digraph conditionalEffects_kt { 18 -> {19}; 19 -> {20}; 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - subgraph cluster_6 { + subgraph cluster_4 { color=red - 26 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_7 { + 22 [label="Enter function test_3" style="filled" fillcolor=red]; + 23 [label="Access variable R|/x|"]; + 24 [label="Const: Null(null)"]; + 25 [label="Operator !="]; + 26 [label="Function call: R|kotlin/require|(!=(R|/x|, Null(null)))"]; + subgraph cluster_5 { color=blue - 27 [label="Enter block"]; + 27 [label="Enter contract"]; 28 [label="Access variable R|/x|"]; 29 [label="Const: Null(null)"]; 30 [label="Operator !="]; - 31 [label="Function call: R|kotlin/require|(!=(R|/x|, Null(null)))"]; - subgraph cluster_8 { - color=blue - 32 [label="Enter contract"]; - 33 [label="Access variable R|/x|"]; - 34 [label="Const: Null(null)"]; - 35 [label="Operator !="]; - 36 [label="Exit contract"]; - } - 37 [label="Access variable R|/x|"]; - 38 [label="Access variable R|kotlin/String.length|"]; - 39 [label="Exit block"]; + 31 [label="Exit contract"]; } - 40 [label="Exit function test_3" style="filled" fillcolor=red]; + 32 [label="Access variable R|/x|"]; + 33 [label="Access variable R|kotlin/String.length|"]; + 34 [label="Exit function test_3" style="filled" fillcolor=red]; } + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; 26 -> {27}; 27 -> {28}; 28 -> {29}; @@ -108,150 +93,140 @@ digraph conditionalEffects_kt { 31 -> {32}; 32 -> {33}; 33 -> {34}; - 34 -> {35}; + + subgraph cluster_6 { + color=red + 35 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 36 [label="Enter &&"]; + 37 [label="Access variable R|/x|"]; + 38 [label="Type operator: x is String"]; + 39 [label="Exit left part of &&"]; + 40 [label="Enter right part of &&"]; + 41 [label="Access variable R|/y|"]; + 42 [label="Const: Null(null)"]; + 43 [label="Operator !="]; + 44 [label="Exit &&"]; + } + 45 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|) && !=(R|/y|, Null(null)))"]; + subgraph cluster_8 { + color=blue + 46 [label="Enter contract"]; + subgraph cluster_9 { + color=blue + 47 [label="Enter &&"]; + 48 [label="Access variable R|/x|"]; + 49 [label="Type operator: x is String"]; + 50 [label="Exit left part of &&"]; + 51 [label="Enter right part of &&"]; + 52 [label="Access variable R|/y|"]; + 53 [label="Const: Null(null)"]; + 54 [label="Operator !="]; + 55 [label="Exit &&"]; + } + 56 [label="Exit contract"]; + } + 57 [label="Access variable R|/x|"]; + 58 [label="Access variable R|kotlin/String.length|"]; + 59 [label="Access variable R|/y|"]; + 60 [label="Access variable R|kotlin/String.length|"]; + 61 [label="Exit function test_4" style="filled" fillcolor=red]; + } + 35 -> {36}; 36 -> {37}; 37 -> {38}; 38 -> {39}; - 39 -> {40}; - - subgraph cluster_9 { - color=red - 41 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_10 { - color=blue - 42 [label="Enter block"]; - subgraph cluster_11 { - color=blue - 43 [label="Enter &&"]; - 44 [label="Access variable R|/x|"]; - 45 [label="Type operator: x is String"]; - 46 [label="Exit left part of &&"]; - 47 [label="Enter right part of &&"]; - 48 [label="Access variable R|/y|"]; - 49 [label="Const: Null(null)"]; - 50 [label="Operator !="]; - 51 [label="Exit &&"]; - } - 52 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|) && !=(R|/y|, Null(null)))"]; - subgraph cluster_12 { - color=blue - 53 [label="Enter contract"]; - subgraph cluster_13 { - color=blue - 54 [label="Enter &&"]; - 55 [label="Access variable R|/x|"]; - 56 [label="Type operator: x is String"]; - 57 [label="Exit left part of &&"]; - 58 [label="Enter right part of &&"]; - 59 [label="Access variable R|/y|"]; - 60 [label="Const: Null(null)"]; - 61 [label="Operator !="]; - 62 [label="Exit &&"]; - } - 63 [label="Exit contract"]; - } - 64 [label="Access variable R|/x|"]; - 65 [label="Access variable R|kotlin/String.length|"]; - 66 [label="Access variable R|/y|"]; - 67 [label="Access variable R|kotlin/String.length|"]; - 68 [label="Exit block"]; - } - 69 [label="Exit function test_4" style="filled" fillcolor=red]; - } - + 39 -> {44 40}; + 40 -> {41}; 41 -> {42}; 42 -> {43}; 43 -> {44}; 44 -> {45}; 45 -> {46}; - 46 -> {51 47}; + 46 -> {47}; 47 -> {48}; 48 -> {49}; 49 -> {50}; - 50 -> {51}; + 50 -> {55 51}; 51 -> {52}; 52 -> {53}; 53 -> {54}; 54 -> {55}; 55 -> {56}; 56 -> {57}; - 57 -> {62 58}; + 57 -> {58}; 58 -> {59}; 59 -> {60}; 60 -> {61}; - 61 -> {62}; + + subgraph cluster_10 { + color=red + 62 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 63 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 64 [label="Enter when branch condition "]; + 65 [label="Access variable R|/b|"]; + 66 [label="Exit when branch condition"]; + } + subgraph cluster_13 { + color=blue + 67 [label="Enter when branch condition else"]; + 68 [label="Exit when branch condition"]; + } + 69 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 70 [label="Enter block"]; + 71 [label="Access variable R|/x|"]; + 72 [label="Access variable #"]; + 73 [label="Exit block"]; + } + 74 [label="Exit when branch result"]; + 75 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 76 [label="Enter block"]; + 77 [label="Access variable R|/x|"]; + 78 [label="Type operator: x is String"]; + 79 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; + subgraph cluster_16 { + color=blue + 80 [label="Enter contract"]; + 81 [label="Access variable R|/x|"]; + 82 [label="Type operator: x is String"]; + 83 [label="Exit contract"]; + } + 84 [label="Access variable R|/x|"]; + 85 [label="Access variable R|kotlin/String.length|"]; + 86 [label="Exit block"]; + } + 87 [label="Exit when branch result"]; + 88 [label="Exit when"]; + } + 89 [label="Access variable R|/x|"]; + 90 [label="Access variable #"]; + 91 [label="Exit function test_5" style="filled" fillcolor=red]; + } + 62 -> {63}; 63 -> {64}; 64 -> {65}; 65 -> {66}; - 66 -> {67}; + 66 -> {75 67}; 67 -> {68}; 68 -> {69}; - - subgraph cluster_14 { - color=red - 70 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 71 [label="Enter block"]; - subgraph cluster_16 { - color=blue - 72 [label="Enter when"]; - subgraph cluster_17 { - color=blue - 73 [label="Enter when branch condition "]; - 74 [label="Access variable R|/b|"]; - 75 [label="Exit when branch condition"]; - } - subgraph cluster_18 { - color=blue - 76 [label="Enter when branch condition else"]; - 77 [label="Exit when branch condition"]; - } - 78 [label="Enter when branch result"]; - subgraph cluster_19 { - color=blue - 79 [label="Enter block"]; - 80 [label="Access variable R|/x|"]; - 81 [label="Access variable #"]; - 82 [label="Exit block"]; - } - 83 [label="Exit when branch result"]; - 84 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 85 [label="Enter block"]; - 86 [label="Access variable R|/x|"]; - 87 [label="Type operator: x is String"]; - 88 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; - subgraph cluster_21 { - color=blue - 89 [label="Enter contract"]; - 90 [label="Access variable R|/x|"]; - 91 [label="Type operator: x is String"]; - 92 [label="Exit contract"]; - } - 93 [label="Access variable R|/x|"]; - 94 [label="Access variable R|kotlin/String.length|"]; - 95 [label="Exit block"]; - } - 96 [label="Exit when branch result"]; - 97 [label="Exit when"]; - } - 98 [label="Access variable R|/x|"]; - 99 [label="Access variable #"]; - 100 [label="Exit block"]; - } - 101 [label="Exit function test_5" style="filled" fillcolor=red]; - } - + 69 -> {70}; 70 -> {71}; 71 -> {72}; 72 -> {73}; 73 -> {74}; - 74 -> {75}; - 75 -> {84 76}; + 74 -> {88}; + 75 -> {76}; 76 -> {77}; 77 -> {78}; 78 -> {79}; @@ -259,7 +234,7 @@ digraph conditionalEffects_kt { 80 -> {81}; 81 -> {82}; 82 -> {83}; - 83 -> {97}; + 83 -> {84}; 84 -> {85}; 85 -> {86}; 86 -> {87}; @@ -267,94 +242,89 @@ digraph conditionalEffects_kt { 88 -> {89}; 89 -> {90}; 90 -> {91}; - 91 -> {92}; + + subgraph cluster_17 { + color=red + 92 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 93 [label="Enter when"]; + subgraph cluster_19 { + color=blue + 94 [label="Enter when branch condition "]; + 95 [label="Access variable R|/b|"]; + 96 [label="Exit when branch condition"]; + } + subgraph cluster_20 { + color=blue + 97 [label="Enter when branch condition else"]; + 98 [label="Exit when branch condition"]; + } + 99 [label="Enter when branch result"]; + subgraph cluster_21 { + color=blue + 100 [label="Enter block"]; + 101 [label="Access variable R|/x|"]; + 102 [label="Type operator: x is String"]; + 103 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; + subgraph cluster_22 { + color=blue + 104 [label="Enter contract"]; + 105 [label="Access variable R|/x|"]; + 106 [label="Type operator: x is String"]; + 107 [label="Exit contract"]; + } + 108 [label="Access variable R|/x|"]; + 109 [label="Access variable R|kotlin/String.length|"]; + 110 [label="Exit block"]; + } + 111 [label="Exit when branch result"]; + 112 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 113 [label="Enter block"]; + 114 [label="Access variable R|/x|"]; + 115 [label="Type operator: x is String"]; + 116 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; + subgraph cluster_24 { + color=blue + 117 [label="Enter contract"]; + 118 [label="Access variable R|/x|"]; + 119 [label="Type operator: x is String"]; + 120 [label="Exit contract"]; + } + 121 [label="Access variable R|/x|"]; + 122 [label="Access variable R|kotlin/String.length|"]; + 123 [label="Exit block"]; + } + 124 [label="Exit when branch result"]; + 125 [label="Exit when"]; + } + 126 [label="Access variable R|/x|"]; + 127 [label="Access variable R|kotlin/String.length|"]; + 128 [label="Exit function test_6" style="filled" fillcolor=red]; + } + 92 -> {93}; 93 -> {94}; 94 -> {95}; 95 -> {96}; - 96 -> {97}; + 96 -> {112 97}; 97 -> {98}; 98 -> {99}; 99 -> {100}; 100 -> {101}; - - subgraph cluster_22 { - color=red - 102 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_23 { - color=blue - 103 [label="Enter block"]; - subgraph cluster_24 { - color=blue - 104 [label="Enter when"]; - subgraph cluster_25 { - color=blue - 105 [label="Enter when branch condition "]; - 106 [label="Access variable R|/b|"]; - 107 [label="Exit when branch condition"]; - } - subgraph cluster_26 { - color=blue - 108 [label="Enter when branch condition else"]; - 109 [label="Exit when branch condition"]; - } - 110 [label="Enter when branch result"]; - subgraph cluster_27 { - color=blue - 111 [label="Enter block"]; - 112 [label="Access variable R|/x|"]; - 113 [label="Type operator: x is String"]; - 114 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; - subgraph cluster_28 { - color=blue - 115 [label="Enter contract"]; - 116 [label="Access variable R|/x|"]; - 117 [label="Type operator: x is String"]; - 118 [label="Exit contract"]; - } - 119 [label="Access variable R|/x|"]; - 120 [label="Access variable R|kotlin/String.length|"]; - 121 [label="Exit block"]; - } - 122 [label="Exit when branch result"]; - 123 [label="Enter when branch result"]; - subgraph cluster_29 { - color=blue - 124 [label="Enter block"]; - 125 [label="Access variable R|/x|"]; - 126 [label="Type operator: x is String"]; - 127 [label="Function call: R|kotlin/require|((R|/x| is R|kotlin/String|))"]; - subgraph cluster_30 { - color=blue - 128 [label="Enter contract"]; - 129 [label="Access variable R|/x|"]; - 130 [label="Type operator: x is String"]; - 131 [label="Exit contract"]; - } - 132 [label="Access variable R|/x|"]; - 133 [label="Access variable R|kotlin/String.length|"]; - 134 [label="Exit block"]; - } - 135 [label="Exit when branch result"]; - 136 [label="Exit when"]; - } - 137 [label="Access variable R|/x|"]; - 138 [label="Access variable R|kotlin/String.length|"]; - 139 [label="Exit block"]; - } - 140 [label="Exit function test_6" style="filled" fillcolor=red]; - } - + 101 -> {102}; 102 -> {103}; 103 -> {104}; 104 -> {105}; 105 -> {106}; 106 -> {107}; - 107 -> {123 108}; + 107 -> {108}; 108 -> {109}; 109 -> {110}; 110 -> {111}; - 111 -> {112}; + 111 -> {125}; 112 -> {113}; 113 -> {114}; 114 -> {115}; @@ -365,23 +335,11 @@ digraph conditionalEffects_kt { 119 -> {120}; 120 -> {121}; 121 -> {122}; - 122 -> {136}; + 122 -> {123}; 123 -> {124}; 124 -> {125}; 125 -> {126}; 126 -> {127}; 127 -> {128}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {135}; - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index c69a8d4fd95..33410f5f0e1 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -260,6 +260,16 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/arguments/lambda.kt"); } + @TestMetadata("lambdaInLambda.kt") + public void testLambdaInLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda.kt"); + } + + @TestMetadata("lambdaInLambda2.kt") + public void testLambdaInLambda2() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/lambdaInLambda2.kt"); + } + @TestMetadata("overloadByReceiver.kt") public void testOverloadByReceiver() throws Exception { runTest("compiler/fir/resolve/testData/resolve/arguments/overloadByReceiver.kt"); @@ -275,6 +285,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/resolve/testData/resolve/arguments/simple.kt"); } + @TestMetadata("tryInLambda.kt") + public void testTryInLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/arguments/tryInLambda.kt"); + } + @TestMetadata("vararg.kt") public void testVararg() throws Exception { runTest("compiler/fir/resolve/testData/resolve/arguments/vararg.kt"); diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithCfgTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithCfgTestGenerated.java index c9fd940ed50..72e606a7efe 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithCfgTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithCfgTestGenerated.java @@ -80,6 +80,11 @@ public class FirDiagnosticsWithCfgTestGenerated extends AbstractFirDiagnosticsWi runTest("compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.kt"); } + @TestMetadata("returnValuesFromLambda.kt") + public void testReturnValuesFromLambda() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.kt"); + } + @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { runTest("compiler/fir/resolve/testData/resolve/cfg/safeCalls.kt");