From 6716cb0bf3c831d9a7ef5c02d41e107d2a1b5cdd Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 29 Jan 2020 12:45:43 +0300 Subject: [PATCH] [FIR] Add edge kinds to control flow graph Another changes: - Remove useless CFG plain text renderer - Refactor CFG .dot renderer - Add checking of consistency control flow graph --- .../fir/resolve/dfa/FirDataFlowAnalyzer.kt | 7 +- .../fir/resolve/dfa/cfg/ControlFlowGraph.kt | 26 +- .../dfa/cfg/ControlFlowGraphBuilder.kt | 26 +- .../dfa/cfg/ControlFlowGraphRenderer.kt | 180 +- .../testData/resolve/cfg/binaryOperations.dot | 454 +-- .../cfg/booleanOperatorsWithConsts.dot | 790 +++-- .../resolve/testData/resolve/cfg/complex.dot | 776 ++--- .../testData/resolve/cfg/emptyWhen.dot | 102 +- .../testData/resolve/cfg/initBlock.dot | 30 +- .../resolve/cfg/initBlockAndInPlaceLambda.dot | 42 +- .../resolve/testData/resolve/cfg/jumps.dot | 690 +++-- .../resolve/testData/resolve/cfg/jumps_0.dot | 363 +++ .../resolve/testData/resolve/cfg/jumps_1.dot | 358 +++ .../resolve/testData/resolve/cfg/lambdas.dot | 362 +-- .../resolve/testData/resolve/cfg/loops.dot | 958 +++--- .../resolve/cfg/propertiesAndInitBlocks.dot | 412 +-- .../resolve/cfg/returnValuesFromLambda.dot | 246 +- .../testData/resolve/cfg/safeCalls.dot | 158 +- .../resolve/testData/resolve/cfg/simple.dot | 58 +- .../resolve/testData/resolve/cfg/tryCatch.dot | 578 ++-- .../fir/resolve/testData/resolve/cfg/when.dot | 366 +-- .../smartcasts/anotherBoundSmartcasts.dot | 884 +++--- .../testData/resolve/smartcasts/bangbang.dot | 662 ++-- .../resolve/smartcasts/booleanOperators.dot | 1263 +++++--- .../resolve/smartcasts/booleanOperators.kt | 72 +- .../resolve/smartcasts/booleanOperators.txt | 84 +- .../resolve/smartcasts/booleanOperators_0.dot | 503 +++ .../resolve/smartcasts/boundSmartcasts.dot | 530 ++-- .../testData/resolve/smartcasts/casts.dot | 710 ++--- .../dataFlowInfoFromWhileCondition.dot | 142 +- .../resolve/smartcasts/delayedAssignment.dot | 174 +- .../testData/resolve/smartcasts/elvis.dot | 522 ++-- .../resolve/smartcasts/endlessLoops.dot | 1090 ++++--- .../resolve/smartcasts/equalsAndIdentity.dot | 620 ++-- .../resolve/smartcasts/equalsToBoolean.dot | 1110 +++---- .../implicitReceiverAsWhenSubject.dot | 372 +-- .../resolve/smartcasts/implicitReceivers.dot | 972 +++--- .../resolve/smartcasts/inPlaceLambdas.dot | 304 +- .../resolve/smartcasts/notBoundSmartcasts.dot | 634 ++-- .../resolve/smartcasts/nullability.dot | 2738 ++++++++--------- .../testData/resolve/smartcasts/returns.dot | 658 ++-- .../testData/resolve/smartcasts/safeCalls.dot | 421 ++- .../testData/resolve/smartcasts/simpleIf.dot | 354 +-- .../smartcasts/smartcastAfterReassignment.dot | 198 +- .../smartcasts/smartcastFromArgument.dot | 238 +- .../resolve/smartcasts/smartcastOnLambda.dot | 86 +- .../testData/resolve/smartcasts/when.dot | 1268 ++++---- .../resolve/stdlib/contracts/callsInPlace.dot | 418 +-- .../stdlib/contracts/conditionalEffects.dot | 668 ++-- .../fir/AbstractFirDiagnosticsWithCfgTest.kt | 137 +- 50 files changed, 13215 insertions(+), 11599 deletions(-) create mode 100644 compiler/fir/resolve/testData/resolve/cfg/jumps_0.dot create mode 100644 compiler/fir/resolve/testData/resolve/cfg/jumps_1.dot create mode 100644 compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators_0.dot 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 47770b5654f..2efcc163113 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 @@ -709,6 +709,11 @@ abstract class FirDataFlowAnalyzer( val flow = node.mergeIncomingFlow().flow + /* + * TODO: Here we should handle case when one of arguments is dead (e.g. in cases `false && expr` or `true || expr`) + * But since conditions with const are rare it can be delayed + */ + val leftVariable = variableStorage.getOrCreateVariable(binaryLogicExpression.leftOperand) val rightVariable = variableStorage.getOrCreateVariable(binaryLogicExpression.rightOperand) val operatorVariable = variableStorage.getOrCreateVariable(binaryLogicExpression) @@ -795,7 +800,7 @@ abstract class FirDataFlowAnalyzer( val previousFlows = if (node.isDead) node.previousNodes.map { it.flow } else - node.previousNodes.mapNotNull { prev -> prev.takeIf { !it.isDead }?.flow } + node.previousNodes.mapNotNull { prev -> prev.takeIf { node.incomingEdges[it] != EdgeKind.Dead }?.flow } val flow = logicSystem.joinFlow(previousFlows) if (updateReceivers) { logicSystem.updateAllReceivers(flow) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt index 1d512b3a78b..1cc2639f81e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraph.kt @@ -24,13 +24,34 @@ class ControlFlowGraph(val name: String, val kind: Kind) { } } +enum class EdgeKind { + Simple, Dead +} + sealed class CFGNode(val owner: ControlFlowGraph, val level: Int, private val id: Int) { + companion object { + fun addEdge(from: CFGNode<*>, to: CFGNode<*>, kind: EdgeKind, propagateDeadness: Boolean) { + from.followingNodes += to + to.previousNodes += from + if (kind != EdgeKind.Simple) { + from.outgoingEdges[to] = kind + to.incomingEdges[from] = kind + } + if (propagateDeadness && kind == EdgeKind.Dead) { + to.isDead = true + } + } + } + init { owner.nodes += this } - val previousNodes = mutableListOf>() - val followingNodes = mutableListOf>() + val previousNodes: MutableList> = mutableListOf() + val followingNodes: MutableList> = mutableListOf() + + val incomingEdges = mutableMapOf, EdgeKind>().withDefault { EdgeKind.Simple } + val outgoingEdges = mutableMapOf, EdgeKind>().withDefault { EdgeKind.Simple } val firstPreviousNode: CFGNode<*> get() = previousNodes.first() @@ -47,7 +68,6 @@ sealed class CFGNode(val owner: ControlFlowGraph, val level: } } - interface EnterNode interface ExitNode 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 a4f2e421d85..c4e04559bdc 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 @@ -314,7 +314,7 @@ class ControlFlowGraphBuilder { val conditionExitNode = createLoopConditionExitNode(loop.condition) addNewSimpleNode(conditionExitNode) val conditionConstBooleanValue = conditionExitNode.booleanConstValue - addEdge(conditionExitNode, loopExitNodes.top(), isDead = conditionConstBooleanValue == true) + addEdge(conditionExitNode, loopExitNodes.top(), propagateDeadness = false, isDead = conditionConstBooleanValue == true) val loopBlockEnterNode = createLoopBlockEnterNode(loop) addNewSimpleNode(loopBlockEnterNode, conditionConstBooleanValue == false) levelCounter++ @@ -431,11 +431,11 @@ class ControlFlowGraphBuilder { val leftExitNode = createBinaryOrExitLeftOperandNode(binaryLogicExpression).also { addEdge(previousNode, it) - addEdge(it, binaryOrExitNodes.top(), isDead = leftBooleanValue == false) + addEdge(it, binaryOrExitNodes.top(), propagateDeadness = false, isDead = leftBooleanValue == false) } val rightExitNode = createBinaryOrEnterRightOperandNode(binaryLogicExpression).also { - addEdge(leftExitNode, it, isDead = leftBooleanValue == true) + addEdge(leftExitNode, it, propagateDeadness = true, isDead = leftBooleanValue == true) lastNodes.push(it) levelCounter++ } @@ -639,13 +639,14 @@ class ControlFlowGraphBuilder { fun exitSafeCall(qualifiedAccess: FirQualifiedAccess): ExitSafeCallNode { return exitSafeCallNodes.pop().also { addNewSimpleNode(it) + it.markAsDeadIfNecessary() } } // ------------------------------------------------------------------------------------------------------------------------- private fun CFGNode<*>.markAsDeadIfNecessary() { - isDead = previousNodes.all { it.isDead } + isDead = incomingEdges.size == previousNodes.size && incomingEdges.values.all { it == EdgeKind.Dead } } private fun addNodeThatReturnsNothing(node: CFGNode<*>) { @@ -674,22 +675,9 @@ class ControlFlowGraphBuilder { return oldNode } - private fun addDeadEdge(from: CFGNode<*>, to: CFGNode<*>, propagateDeadness: Boolean) { - val stub = createStubNode() - addEdge(from, stub) - addEdge(stub, to, propagateDeadness = propagateDeadness) - } - private fun addEdge(from: CFGNode<*>, to: CFGNode<*>, propagateDeadness: Boolean = true, isDead: Boolean = false) { - if (isDead) { - addDeadEdge(from, to, propagateDeadness) - return - } - if (propagateDeadness && from.isDead) { - to.isDead = true - } - from.followingNodes += to - to.previousNodes += from + val kind = if (isDead || from.isDead || to.isDead) EdgeKind.Dead else EdgeKind.Simple + CFGNode.addEdge(from, to, kind, propagateDeadness) } private val FirFunction<*>.invocationKind: InvocationKind? diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt index d6f2a13838f..d4544f20175 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/cfg/ControlFlowGraphRenderer.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.resolve.dfa.cfg +import org.jetbrains.kotlin.fir.FirElement import org.jetbrains.kotlin.fir.FirRenderer import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.expressions.FirDoWhileLoop @@ -12,75 +13,125 @@ import org.jetbrains.kotlin.fir.expressions.FirLoop import org.jetbrains.kotlin.fir.expressions.FirWhileLoop import org.jetbrains.kotlin.fir.expressions.impl.FirElseIfTrueCondition import org.jetbrains.kotlin.fir.psi +import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference import org.jetbrains.kotlin.fir.render +import org.jetbrains.kotlin.fir.resolve.dfa.FirControlFlowGraphReferenceImpl +import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid import org.jetbrains.kotlin.utils.DFS +import org.jetbrains.kotlin.utils.Printer +import java.util.* -private const val INDENT = " " -private const val DEAD = "[DEAD]" +class FirControlFlowGraphRenderVisitor( + builder: StringBuilder, +) : FirVisitorVoid() { + companion object { + private const val EDGE = " -> " + private const val RED = "red" + private const val BLUE = "blue" - -fun List>.indicesMap(): Map, Int> = mapIndexed { i, node -> node to i }.toMap() - -fun ControlFlowGraph.sortNodes(): List> { - return DFS.topologicalOrder( - nodes - ) { - val result = if (it !is WhenBranchConditionExitNode || it.followingNodes.size < 2) { - it.followingNodes - } else { - it.followingNodes.sortedBy { node -> if (node is BlockEnterNode) 1 else 0 } - } - result - } -} - -fun ControlFlowGraph.renderToStringBuilder(builder: StringBuilder) { - val sortedNodes = sortNodes() - - val indices = sortedNodes.indicesMap() - val notVisited = sortedNodes.toMutableSet() - val maxLineNumberSize = sortedNodes.size.toString().length - - fun List>.renderEdges(nodeIsDead: Boolean): String = map { - indices.getValue(it) to it.isDead - }.sortedBy { it.first }.joinToString(", ") { (index, isDead) -> - index.toString() + if (isDead && !nodeIsDead) DEAD else "" + private val EDGE_STYLE = EnumMap( + mapOf( + EdgeKind.Simple to "", + EdgeKind.Dead to "[style=dotted]", + ) + ) } - fun StringBuilder.renderNode(node: CFGNode<*>, index: Int) { - append(index.toString().padStart(maxLineNumberSize)) - append(": ") - append(INDENT.repeat(node.level)) - append(node.render()) - append(" -> ") - append(node.followingNodes.renderEdges(node.isDead)) - if (node.previousNodes.isNotEmpty()) { - append(" | <- ") - append(node.previousNodes.renderEdges(node.isDead)) - } - appendln() + private val printer = Printer(builder) + + private var indexOffset = 0 + private var clusterCounter = 0 + + override fun visitFile(file: FirFile) { + printer + .println("digraph ${file.name.replace(".", "_")} {") + .pushIndent() + .println("graph [splines=ortho nodesep=3]") + .println("node [shape=box penwidth=2]") + .println("edge [penwidth=2]") + .println() + visitElement(file) + printer + .popIndent() + .println("}") } - with(builder) { - sortedNodes.forEachIndexed { i, node -> - notVisited.remove(node) - renderNode(node, i) - } + override fun visitElement(element: FirElement) { + element.acceptChildren(this) + } - if (notVisited.isNotEmpty()) { - appendln("Not visited nodes:") - notVisited.forEach { node -> - renderNode(node, indices.getValue(node)) + override fun visitControlFlowGraphReference(controlFlowGraphReference: FirControlFlowGraphReference) { + val controlFlowGraph = (controlFlowGraphReference as? FirControlFlowGraphReferenceImpl)?.controlFlowGraph ?: return + indexOffset = controlFlowGraph.dotRenderToStringBuilder(printer) + printer.println() + } + + private fun Printer.enterCluster(color: String) { + println("subgraph cluster_${clusterCounter++} {") + pushIndent() + println("color=$color") + } + + private fun Printer.exitCluster() { + popIndent() + println("}") + } + + private fun ControlFlowGraph.dotRenderToStringBuilder(printer: Printer): Int { + with(printer) { + val graph = this@dotRenderToStringBuilder + val sortedNodes = graph.sortNodes() + val indices = sortedNodes.indicesMap().mapValues { (_, index) -> index + indexOffset } + + var color = RED + sortedNodes.forEach { + if (it is EnterNode) { + enterCluster(color) + color = BLUE + } + val attributes = mutableListOf() + attributes += "label=\"${it.render().replace("\"", "")}\"" + if (it == enterNode || it == exitNode) { + attributes += "style=\"filled\"" + attributes += "fillcolor=red" + } + if (it.isDead) { + attributes += "style=\"filled\"" + attributes += "fillcolor=gray" + } + println(indices.getValue(it), attributes.joinToString(separator = " ", prefix = " [", postfix = "];")) + if (it is ExitNode) { + exitCluster() + } } - } + println() - appendln() + sortedNodes.forEachIndexed { i, node -> + if (node.followingNodes.isEmpty()) return@forEachIndexed + + fun renderEdges(kind: EdgeKind) { + val edges = node.followingNodes.filter { node.outgoingEdges.getValue(it) == kind } + if (edges.isEmpty()) return + print( + i + indexOffset, + EDGE, + edges.joinToString(prefix = "{", postfix = "}", separator = " ") { indices.getValue(it).toString() } + ) + EDGE_STYLE.getValue(kind).takeIf { it.isNotBlank() }?.let { printWithNoIndent(" $it") } + printlnWithNoIndent(";") + } + + for (kind in EdgeKind.values()) { + renderEdges(kind) + } + } + + return indexOffset + sortedNodes.size + } } } -fun ControlFlowGraph.render(): String = buildString { renderToStringBuilder(this) } - -fun CFGNode<*>.render(): String = +private fun CFGNode<*>.render(): String = buildString { append( when (this@render) { @@ -114,7 +165,7 @@ fun CFGNode<*>.render(): String = is ConstExpressionNode -> "Const: ${fir.render()}" is VariableDeclarationNode -> - "Variable declaration: ${buildString { FirRenderer(this).visitCallableDeclaration(fir)} }" + "Variable declaration: ${buildString { FirRenderer(this).visitCallableDeclaration(fir) }}" is VariableAssignmentNode -> "Assignmenet: ${fir.lValue.render()}" is FunctionCallNode -> "Function call: ${fir.render()}" @@ -154,7 +205,7 @@ fun CFGNode<*>.render(): String = is ExitSafeCallNode -> "Exit safe call" else -> TODO(this@render.toString()) - } + }, ) } @@ -171,4 +222,17 @@ private fun FirLoop.type(): String = when (this) { is FirWhileLoop -> "while" is FirDoWhileLoop -> "do-while" else -> throw IllegalArgumentException() -} \ No newline at end of file +} + +private fun ControlFlowGraph.sortNodes(): List> { + return DFS.topologicalOrder(nodes) { + val result = if (it !is WhenBranchConditionExitNode || it.followingNodes.size < 2) { + it.followingNodes + } else { + it.followingNodes.sortedBy { node -> if (node is BlockEnterNode) 1 else 0 } + } + result + } +} + +private fun List>.indicesMap(): Map, Int> = mapIndexed { i, node -> node to i }.toMap() \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot index ba61f8f1289..e8be9c237ce 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/binaryOperations.dot @@ -1,240 +1,240 @@ digraph binaryOperations_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 2 [label="Enter when branch condition "]; - subgraph cluster_3 { - color=blue - 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 ||"]; - } - 9 [label="Exit when branch condition"]; - } - 10 [label="Synthetic else branch"]; - 11 [label="Enter when branch result"]; - subgraph cluster_4 { - color=blue - 12 [label="Enter block"]; - 13 [label="Const: IntegerLiteral(1)"]; - 14 [label="Exit block"]; - } - 15 [label="Exit when branch result"]; - 16 [label="Exit when"]; - } - 17 [label="Exit function test_1" style="filled" fillcolor=red]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {8 6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {11 10}; - 10 -> {16}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - - subgraph cluster_5 { - color=red - 18 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 19 [label="Enter when"]; - subgraph cluster_7 { - color=blue - 20 [label="Enter when branch condition "]; - subgraph cluster_8 { - color=blue - 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 &&"]; - } - 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="Const: IntegerLiteral(1)"]; - 32 [label="Exit block"]; - } - 33 [label="Exit when branch result"]; - 34 [label="Exit when"]; - } - 35 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {26 24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {29 28}; - 28 -> {34}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - - 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 { + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { 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 ||"]; + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 2 [label="Enter when branch condition "]; + subgraph cluster_3 { + color=blue + 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 ||"]; + } + 9 [label="Exit when branch condition"]; + } + 10 [label="Synthetic else branch"]; + 11 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 12 [label="Enter block"]; + 13 [label="Const: IntegerLiteral(1)"]; + 14 [label="Exit block"]; + } + 15 [label="Exit when branch result"]; + 16 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 55 [label="Exit block"]; - } - 56 [label="Exit when branch result"]; - 57 [label="Exit when"]; + 17 [label="Exit function test_1" style="filled" fillcolor=red]; } - 58 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {45 43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {49 47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {52 51}; - 51 -> {57}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {8 6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {11 10}; + 10 -> {16}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; - 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 { + subgraph cluster_5 { + color=red + 18 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_6 { 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 ||"]; + 19 [label="Enter when"]; + subgraph cluster_7 { + color=blue + 20 [label="Enter when branch condition "]; + subgraph cluster_8 { + color=blue + 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 &&"]; + } + 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="Const: IntegerLiteral(1)"]; + 32 [label="Exit block"]; + } + 33 [label="Exit when branch result"]; + 34 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 78 [label="Exit block"]; - } - 79 [label="Exit when branch result"]; - 80 [label="Exit when"]; + 35 [label="Exit function test_2" style="filled" fillcolor=red]; } - 81 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {72 65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {71 69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {75 74}; - 74 -> {80}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {26 24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {29 28}; + 28 -> {34}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + + 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: IntegerLiteral(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}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {45 43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {49 47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {52 51}; + 51 -> {57}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + + 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: IntegerLiteral(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}; + 64 -> {72 65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {71 69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {75 74}; + 74 -> {80}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot b/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot index 80a8ff1c1f4..ece191a2c1a 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/booleanOperatorsWithConsts.dot @@ -1,434 +1,426 @@ digraph booleanOperatorsWithConsts_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 2 [label="Enter when branch condition "]; - subgraph cluster_3 { - color=blue - 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 ||"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 2 [label="Enter when branch condition "]; + subgraph cluster_3 { + color=blue + 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 ||"]; + } + 9 [label="Exit when branch condition"]; + } + 10 [label="Synthetic else branch"]; + 11 [label="Enter when branch result"]; + subgraph cluster_4 { + color=blue + 12 [label="Enter block"]; + 13 [label="Const: IntegerLiteral(1)"]; + 14 [label="Exit block"]; + } + 15 [label="Exit when branch result"]; + 16 [label="Exit when"]; } - 9 [label="Exit when branch condition"]; - } - 10 [label="Synthetic else branch"]; - 11 [label="Enter when branch result"]; - subgraph cluster_4 { - color=blue - 12 [label="Enter block"]; - 13 [label="Const: IntegerLiteral(1)"]; - 14 [label="Exit block"]; - } - 15 [label="Exit when branch result"]; - 16 [label="Exit when"]; + 17 [label="Exit function test_1" style="filled" fillcolor=red]; } - 17 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {8 6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {11 10}; - 10 -> {16}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {8 6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {11 10}; + 10 -> {16}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; - subgraph cluster_5 { - color=red - 18 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 19 [label="Enter when"]; - subgraph cluster_7 { - color=blue - 20 [label="Enter when branch condition "]; - subgraph cluster_8 { - color=blue - 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 ||"]; + subgraph cluster_5 { + color=red + 18 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_6 { + color=blue + 19 [label="Enter when"]; + subgraph cluster_7 { + color=blue + 20 [label="Enter when branch condition "]; + subgraph cluster_8 { + color=blue + 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="Exit ||"]; + } + 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="Const: IntegerLiteral(1)"]; + 32 [label="Exit block"]; + } + 33 [label="Exit when branch result"]; + 34 [label="Exit when"]; } - 28 [label="Exit when branch condition"]; - } - 29 [label="Synthetic else branch"]; - 30 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 31 [label="Enter block"]; - 32 [label="Const: IntegerLiteral(1)"]; - 33 [label="Exit block"]; - } - 34 [label="Exit when branch result"]; - 35 [label="Exit when"]; + 35 [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 -> {27}; - 26 -> {27} [style=dotted]; - 27 -> {28}; - 28 -> {30 29}; - 29 -> {35}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 23 -> {26} [style=dotted]; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {29 28}; + 28 -> {34}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; - 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 ||"]; + 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 ||"]; + 40 [label="Access variable R|/b|"]; + 41 [label="Exit left part of ||"]; + 42 [label="Enter right part of ||"]; + 43 [label="Const: Boolean(true)"]; + 44 [label="Exit ||"]; + } + 45 [label="Exit when branch condition"]; + } + 46 [label="Synthetic else branch"]; + 47 [label="Enter when branch result"]; + subgraph cluster_14 { + color=blue + 48 [label="Enter block"]; + 49 [label="Const: IntegerLiteral(1)"]; + 50 [label="Exit block"]; + } + 51 [label="Exit when branch result"]; + 52 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 51 [label="Exit block"]; - } - 52 [label="Exit when branch result"]; - 53 [label="Exit when"]; + 53 [label="Exit function test_3" style="filled" fillcolor=red]; } - 54 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {45 43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {48 47}; - 47 -> {53}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {44 42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {47 46}; + 46 -> {52}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; - 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 ||"]; + subgraph cluster_15 { + color=red + 54 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_16 { + color=blue + 55 [label="Enter when"]; + subgraph cluster_17 { + color=blue + 56 [label="Enter when branch condition "]; + subgraph cluster_18 { + color=blue + 57 [label="Enter ||"]; + 58 [label="Const: Boolean(true)"]; + 59 [label="Exit left part of ||"]; + 60 [label="Enter right part of ||" style="filled" fillcolor=gray]; + 61 [label="Access variable R|/b|" style="filled" fillcolor=gray]; + 62 [label="Exit ||"]; + } + 63 [label="Exit when branch condition"]; + } + 64 [label="Synthetic else branch"]; + 65 [label="Enter when branch result"]; + subgraph cluster_19 { + color=blue + 66 [label="Enter block"]; + 67 [label="Const: IntegerLiteral(1)"]; + 68 [label="Exit block"]; + } + 69 [label="Exit when branch result"]; + 70 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 70 [label="Exit block"]; - } - 71 [label="Exit when branch result"]; - 72 [label="Exit when"]; + 71 [label="Exit function test_4" style="filled" fillcolor=red]; } - 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}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {62}; + 59 -> {60} [style=dotted]; + 60 -> {61} [style=dotted]; + 61 -> {62} [style=dotted]; + 62 -> {63}; + 63 -> {65 64}; + 64 -> {70}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; - subgraph cluster_20 { - color=red - 74 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_21 { - color=blue - 75 [label="Enter when"]; - subgraph cluster_22 { - color=blue - 76 [label="Enter when branch condition "]; - subgraph cluster_23 { - color=blue - 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 &&"]; + subgraph cluster_20 { + color=red + 72 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_21 { + color=blue + 73 [label="Enter when"]; + subgraph cluster_22 { + color=blue + 74 [label="Enter when branch condition "]; + subgraph cluster_23 { + color=blue + 75 [label="Enter &&"]; + 76 [label="Access variable R|/b|"]; + 77 [label="Exit left part of &&"]; + 78 [label="Enter right part of &&"]; + 79 [label="Const: Boolean(false)"]; + 80 [label="Exit &&"]; + } + 81 [label="Exit when branch condition"]; + } + 82 [label="Synthetic else branch"]; + 83 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 84 [label="Enter block"]; + 85 [label="Const: IntegerLiteral(1)"]; + 86 [label="Exit block"]; + } + 87 [label="Exit when branch result"]; + 88 [label="Exit when"]; } - 83 [label="Exit when branch condition"]; - } - 84 [label="Synthetic else branch"]; - 85 [label="Enter when branch result"]; - subgraph cluster_24 { - color=blue - 86 [label="Enter block"]; - 87 [label="Const: IntegerLiteral(1)"]; - 88 [label="Exit block"]; - } - 89 [label="Exit when branch result"]; - 90 [label="Exit when"]; + 89 [label="Exit function test_5" style="filled" fillcolor=red]; } - 91 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {82 80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {85 84}; - 84 -> {90}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {80 78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {83 82}; + 82 -> {88}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; - 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 &&"]; + subgraph cluster_25 { + color=red + 90 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_26 { + color=blue + 91 [label="Enter when"]; + subgraph cluster_27 { + color=blue + 92 [label="Enter when branch condition "]; + subgraph cluster_28 { + color=blue + 93 [label="Enter &&"]; + 94 [label="Const: Boolean(false)"]; + 95 [label="Exit left part of &&"]; + 96 [label="Enter right part of &&" style="filled" fillcolor=gray]; + 97 [label="Access variable R|/b|" style="filled" fillcolor=gray]; + 98 [label="Exit &&"]; + } + 99 [label="Exit when branch condition"]; + } + 100 [label="Synthetic else branch"]; + 101 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 102 [label="Enter block"]; + 103 [label="Const: IntegerLiteral(1)"]; + 104 [label="Exit block"]; + } + 105 [label="Exit when branch result"]; + 106 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 107 [label="Exit block"]; - } - 108 [label="Exit when branch result"]; - 109 [label="Exit when"]; + 107 [label="Exit function test_6" style="filled" fillcolor=red]; } - 110 [label="Exit function test_6" style="filled" fillcolor=red]; - } - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 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 -> {109}; - 109 -> {110}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {98}; + 95 -> {96} [style=dotted]; + 96 -> {97} [style=dotted]; + 97 -> {98} [style=dotted]; + 98 -> {99}; + 99 -> {101 100}; + 100 -> {106}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; - 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 &&"]; + subgraph cluster_30 { + color=red + 108 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_31 { + color=blue + 109 [label="Enter when"]; + subgraph cluster_32 { + color=blue + 110 [label="Enter when branch condition "]; + subgraph cluster_33 { + color=blue + 111 [label="Enter &&"]; + 112 [label="Access variable R|/b|"]; + 113 [label="Exit left part of &&"]; + 114 [label="Enter right part of &&"]; + 115 [label="Const: Boolean(true)"]; + 116 [label="Exit &&"]; + } + 117 [label="Exit when branch condition"]; + } + 118 [label="Synthetic else branch"]; + 119 [label="Enter when branch result"]; + subgraph cluster_34 { + color=blue + 120 [label="Enter block"]; + 121 [label="Const: IntegerLiteral(1)"]; + 122 [label="Exit block"]; + } + 123 [label="Exit when branch result"]; + 124 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 125 [label="Exit block"]; - } - 126 [label="Exit when branch result"]; - 127 [label="Exit when"]; + 125 [label="Exit function test_7" style="filled" fillcolor=red]; } - 128 [label="Exit function test_7" style="filled" fillcolor=red]; - } - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {119 117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {122 121}; - 121 -> {127}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; - 127 -> {128}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {116 114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {119 118}; + 118 -> {124}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; - 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 &&"]; + subgraph cluster_35 { + color=red + 126 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_36 { + color=blue + 127 [label="Enter when"]; + subgraph cluster_37 { + color=blue + 128 [label="Enter when branch condition "]; + subgraph cluster_38 { + color=blue + 129 [label="Enter &&"]; + 130 [label="Const: Boolean(true)"]; + 131 [label="Exit left part of &&"]; + 132 [label="Enter right part of &&"]; + 133 [label="Access variable R|/b|"]; + 134 [label="Exit &&"]; + } + 135 [label="Exit when branch condition"]; + } + 136 [label="Synthetic else branch"]; + 137 [label="Enter when branch result"]; + subgraph cluster_39 { + color=blue + 138 [label="Enter block"]; + 139 [label="Const: IntegerLiteral(1)"]; + 140 [label="Exit block"]; + } + 141 [label="Exit when branch result"]; + 142 [label="Exit when"]; } - 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: IntegerLiteral(1)"]; - 144 [label="Exit block"]; - } - 145 [label="Exit when branch result"]; - 146 [label="Exit when"]; + 143 [label="Exit function test_8" style="filled" fillcolor=red]; } - 147 [label="Exit function test_8" style="filled" fillcolor=red]; - } - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {135}; - 134 -> {137} [style=dotted]; - 135 -> {136}; - 136 -> {138}; - 137 -> {138} [style=dotted]; - 138 -> {139}; - 139 -> {141 140}; - 140 -> {146}; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; + 126 -> {127}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {132}; + 131 -> {134} [style=dotted]; + 132 -> {133}; + 133 -> {134}; + 134 -> {135}; + 135 -> {137 136}; + 136 -> {142}; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/complex.dot b/compiler/fir/resolve/testData/resolve/cfg/complex.dot index 1c41d30d3f5..d49ee038bb1 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/complex.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/complex.dot @@ -1,252 +1,252 @@ digraph complex_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - 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="Function call: R|/pluginId|.#.R|kotlin/toString|()"]; - 5 [label="Const: String(/updates?version=)"]; - 6 [label="Access variable R|/version|"]; - 7 [label="Function call: R|/version|.R|kotlin/Any.toString|()"]; - 8 [label="Variable declaration: lval url: R|kotlin/String|"]; - subgraph cluster_1 { - color=blue - 9 [label="Try expression enter"]; - subgraph cluster_2 { - color=blue - 10 [label="Try main block enter"]; - subgraph cluster_3 { - color=blue - 11 [label="Enter block"]; - 12 [label="Access variable #"]; - 13 [label="Access variable R|/url|"]; - 14 [label="Access variable R|/url|"]; - 15 [label="Access variable R|/url|"]; - 16 [label="Function call: #.#(R|/url|)"]; - 17 [label="Function call: #.#(R|/url|).#( = connect@fun (): R|ERROR CLASS: Unresolved name: fromJson| { + 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="Function call: R|/pluginId|.#.R|kotlin/toString|()"]; + 5 [label="Const: String(/updates?version=)"]; + 6 [label="Access variable R|/version|"]; + 7 [label="Function call: R|/version|.R|kotlin/Any.toString|()"]; + 8 [label="Variable declaration: lval url: R|kotlin/String|"]; + subgraph cluster_1 { + color=blue + 9 [label="Try expression enter"]; + subgraph cluster_2 { + color=blue + 10 [label="Try main block enter"]; + subgraph cluster_3 { + color=blue + 11 [label="Enter block"]; + 12 [label="Access variable #"]; + 13 [label="Access variable R|/url|"]; + 14 [label="Access variable R|/url|"]; + 15 [label="Access variable R|/url|"]; + 16 [label="Function call: #.#(R|/url|)"]; + 17 [label="Function call: #.#(R|/url|).#( = connect@fun (): R|ERROR CLASS: Unresolved name: fromJson| { #().#().#(#.#.#(), (Q|kotlin/Array|).R|kotlin/jvm/java|) } )"]; - 18 [label="Exit block"]; - } - 19 [label="Try main block exit"]; - } - subgraph cluster_4 { - color=blue - 20 [label="Catch enter"]; - subgraph cluster_5 { - color=blue - 21 [label="Enter block"]; - 22 [label="Const: String(Can't parse json response)"]; - 23 [label="Access variable R|/syntaxException|"]; - 24 [label="Access variable R|/syntaxException|"]; - 25 [label="Access variable R|/syntaxException|"]; - 26 [label="Function call: #(String(Can't parse json response), R|/syntaxException|)"]; - 27 [label="Throw: throw #(String(Can't parse json response), R|/syntaxException|)"]; - 28 [label="Stub" style="filled" fillcolor=gray]; - 29 [label="Exit block" style="filled" fillcolor=gray]; - } - 30 [label="Catch exit" style="filled" fillcolor=gray]; - } - subgraph cluster_6 { - color=blue - 31 [label="Catch enter"]; - subgraph cluster_7 { - color=blue - 32 [label="Enter block"]; - 33 [label="Access variable R|/ioException|"]; - 34 [label="Access variable R|/ioException|"]; - 35 [label="Access variable R|/ioException|"]; - 36 [label="Function call: #(R|/ioException|)"]; - 37 [label="Throw: throw #(R|/ioException|)"]; - 38 [label="Stub" style="filled" fillcolor=gray]; - 39 [label="Exit block" style="filled" fillcolor=gray]; - } - 40 [label="Catch exit" style="filled" fillcolor=gray]; - } - 41 [label="Try expression exit"]; - } - 42 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array|"]; - 43 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red]; - } - subgraph cluster_8 { - color=blue - 44 [label="Enter annotation"]; - 45 [label="Access variable #"]; - 46 [label="Access variable #"]; - 47 [label="Exit annotation"]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {43 31 20 11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {41}; - 20 -> {43 21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {43}; - 27 -> {28} [style=dotted]; - 28 -> {29} [style=dotted]; - 29 -> {30} [style=dotted]; - 30 -> {41} [style=dotted]; - 31 -> {43 32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {43}; - 37 -> {38} [style=dotted]; - 38 -> {39} [style=dotted]; - 39 -> {40} [style=dotted]; - 40 -> {41} [style=dotted]; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - - subgraph cluster_9 { - color=red - 48 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; - 49 [label="Function call: #()"]; - 50 [label="Function call: #().#()"]; - 51 [label="Access variable #"]; - 52 [label="Access variable #"]; - 53 [label="Function call: #.#.#()"]; - 54 [label="Access variable R|kotlin/jvm/java|"]; - 55 [label="Access variable R|kotlin/jvm/java|"]; - 56 [label="Access variable R|kotlin/jvm/java|"]; - 57 [label="Function call: #().#().#(#.#.#(), (Q|kotlin/Array|).R|kotlin/jvm/java|)"]; - 58 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; - } - - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - - subgraph cluster_10 { - color=red - 59 [label="Enter function close" style="filled" fillcolor=red]; - 60 [label="Exit function close" style="filled" fillcolor=red]; - } - - 59 -> {60}; - - subgraph cluster_11 { - color=red - 61 [label="Enter function closeFinally" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 62 [label="Enter when"]; - subgraph cluster_13 { - color=blue - 63 [label="Enter when branch condition "]; - 64 [label="Access variable this@R|/closeFinally|"]; - 65 [label="Const: Null(null)"]; - 66 [label="Operator =="]; - 67 [label="Exit when branch condition"]; - } - subgraph cluster_14 { - color=blue - 68 [label="Enter when branch condition "]; - 69 [label="Access variable R|/cause|"]; - 70 [label="Const: Null(null)"]; - 71 [label="Operator =="]; - 72 [label="Exit when branch condition"]; - } - subgraph cluster_15 { - color=blue - 73 [label="Enter when branch condition else"]; - 74 [label="Exit when branch condition"]; - } - 75 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 76 [label="Enter block"]; - subgraph cluster_17 { - color=blue - 77 [label="Try expression enter"]; - subgraph cluster_18 { - color=blue - 78 [label="Try main block enter"]; - subgraph cluster_19 { - color=blue - 79 [label="Enter block"]; - 80 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; - 81 [label="Exit block"]; + 18 [label="Exit block"]; + } + 19 [label="Try main block exit"]; } - 82 [label="Try main block exit"]; - } - subgraph cluster_20 { - color=blue - 83 [label="Catch enter"]; - subgraph cluster_21 { - color=blue - 84 [label="Enter block"]; - 85 [label="Access variable R|/cause|"]; - 86 [label="Access variable R|/closeException|"]; - 87 [label="Function call: R|/cause|.R|kotlin/addSuppressed|(R|/closeException|)"]; - 88 [label="Exit block"]; + subgraph cluster_4 { + color=blue + 20 [label="Catch enter"]; + subgraph cluster_5 { + color=blue + 21 [label="Enter block"]; + 22 [label="Const: String(Can't parse json response)"]; + 23 [label="Access variable R|/syntaxException|"]; + 24 [label="Access variable R|/syntaxException|"]; + 25 [label="Access variable R|/syntaxException|"]; + 26 [label="Function call: #(String(Can't parse json response), R|/syntaxException|)"]; + 27 [label="Throw: throw #(String(Can't parse json response), R|/syntaxException|)"]; + 28 [label="Stub" style="filled" fillcolor=gray]; + 29 [label="Exit block" style="filled" fillcolor=gray]; + } + 30 [label="Catch exit" style="filled" fillcolor=gray]; } - 89 [label="Catch exit"]; - } - 90 [label="Try expression exit"]; + subgraph cluster_6 { + color=blue + 31 [label="Catch enter"]; + subgraph cluster_7 { + color=blue + 32 [label="Enter block"]; + 33 [label="Access variable R|/ioException|"]; + 34 [label="Access variable R|/ioException|"]; + 35 [label="Access variable R|/ioException|"]; + 36 [label="Function call: #(R|/ioException|)"]; + 37 [label="Throw: throw #(R|/ioException|)"]; + 38 [label="Stub" style="filled" fillcolor=gray]; + 39 [label="Exit block" style="filled" fillcolor=gray]; + } + 40 [label="Catch exit" style="filled" fillcolor=gray]; + } + 41 [label="Try expression exit"]; } - 91 [label="Exit block"]; - } - 92 [label="Exit when branch result"]; - 93 [label="Enter when branch result"]; - subgraph cluster_22 { - color=blue - 94 [label="Enter block"]; - 95 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; - 96 [label="Exit block"]; - } - 97 [label="Exit when branch result"]; - 98 [label="Enter when branch result"]; - subgraph cluster_23 { - color=blue - 99 [label="Enter block"]; - 100 [label="Exit block"]; - } - 101 [label="Exit when branch result"]; - 102 [label="Exit when"]; + 42 [label="Variable declaration: lval pluginDTOs: R|kotlin/Array|"]; + 43 [label="Exit function fetchPluginReleaseDate" style="filled" fillcolor=red]; } - 103 [label="Jump: ^closeFinally when () { + subgraph cluster_8 { + color=blue + 44 [label="Enter annotation"]; + 45 [label="Access variable #"]; + 46 [label="Access variable #"]; + 47 [label="Exit annotation"]; + } + + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {43 31 20 11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {41}; + 20 -> {43 21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {43}; + 27 -> {28} [style=dotted]; + 28 -> {29} [style=dotted]; + 29 -> {30} [style=dotted]; + 30 -> {41} [style=dotted]; + 31 -> {43 32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {43}; + 37 -> {38} [style=dotted]; + 38 -> {39} [style=dotted]; + 39 -> {40} [style=dotted]; + 40 -> {41} [style=dotted]; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + + subgraph cluster_9 { + color=red + 48 [label="Enter function anonymousFunction" style="filled" fillcolor=red]; + 49 [label="Function call: #()"]; + 50 [label="Function call: #().#()"]; + 51 [label="Access variable #"]; + 52 [label="Access variable #"]; + 53 [label="Function call: #.#.#()"]; + 54 [label="Access variable R|kotlin/jvm/java|"]; + 55 [label="Access variable R|kotlin/jvm/java|"]; + 56 [label="Access variable R|kotlin/jvm/java|"]; + 57 [label="Function call: #().#().#(#.#.#(), (Q|kotlin/Array|).R|kotlin/jvm/java|)"]; + 58 [label="Exit function anonymousFunction" style="filled" fillcolor=red]; + } + + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + + subgraph cluster_10 { + color=red + 59 [label="Enter function close" style="filled" fillcolor=red]; + 60 [label="Exit function close" style="filled" fillcolor=red]; + } + + 59 -> {60}; + + subgraph cluster_11 { + color=red + 61 [label="Enter function closeFinally" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 62 [label="Enter when"]; + subgraph cluster_13 { + color=blue + 63 [label="Enter when branch condition "]; + 64 [label="Access variable this@R|/closeFinally|"]; + 65 [label="Const: Null(null)"]; + 66 [label="Operator =="]; + 67 [label="Exit when branch condition"]; + } + subgraph cluster_14 { + color=blue + 68 [label="Enter when branch condition "]; + 69 [label="Access variable R|/cause|"]; + 70 [label="Const: Null(null)"]; + 71 [label="Operator =="]; + 72 [label="Exit when branch condition"]; + } + subgraph cluster_15 { + color=blue + 73 [label="Enter when branch condition else"]; + 74 [label="Exit when branch condition"]; + } + 75 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 76 [label="Enter block"]; + subgraph cluster_17 { + color=blue + 77 [label="Try expression enter"]; + subgraph cluster_18 { + color=blue + 78 [label="Try main block enter"]; + subgraph cluster_19 { + color=blue + 79 [label="Enter block"]; + 80 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; + 81 [label="Exit block"]; + } + 82 [label="Try main block exit"]; + } + subgraph cluster_20 { + color=blue + 83 [label="Catch enter"]; + subgraph cluster_21 { + color=blue + 84 [label="Enter block"]; + 85 [label="Access variable R|/cause|"]; + 86 [label="Access variable R|/closeException|"]; + 87 [label="Function call: R|/cause|.R|kotlin/addSuppressed|(R|/closeException|)"]; + 88 [label="Exit block"]; + } + 89 [label="Catch exit"]; + } + 90 [label="Try expression exit"]; + } + 91 [label="Exit block"]; + } + 92 [label="Exit when branch result"]; + 93 [label="Enter when branch result"]; + subgraph cluster_22 { + color=blue + 94 [label="Enter block"]; + 95 [label="Function call: this@R|/closeFinally|.R|/AutoCloseable.close|()"]; + 96 [label="Exit block"]; + } + 97 [label="Exit when branch result"]; + 98 [label="Enter when branch result"]; + subgraph cluster_23 { + color=blue + 99 [label="Enter block"]; + 100 [label="Exit block"]; + } + 101 [label="Exit when branch result"]; + 102 [label="Exit when"]; + } + 103 [label="Jump: ^closeFinally when () { ==(this@R|/closeFinally|, Null(null)) -> { } ==(R|/cause|, Null(null)) -> { @@ -263,155 +263,155 @@ digraph complex_kt { } } "]; - 104 [label="Stub" style="filled" fillcolor=gray]; - 105 [label="Exit function closeFinally" style="filled" fillcolor=red]; - } - - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {98 68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {93 73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {105 83 79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {90}; - 83 -> {105 84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {102}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {102}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {105}; - 103 -> {104} [style=dotted]; - 104 -> {105} [style=dotted]; - - subgraph cluster_24 { - color=red - 106 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red]; - 107 [label="Access variable this@R|/firstIsInstanceOrNull|"]; - 108 [label="Variable declaration: lval : R|kotlin/sequences/Sequence<*>|"]; - 109 [label="Access variable R|/|"]; - 110 [label="Function call: R|/|.R|FakeOverride|>|()"]; - 111 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; - subgraph cluster_25 { - color=blue - 112 [label="Enter while loop"]; - subgraph cluster_26 { - color=blue - 113 [label="Enter loop condition"]; - 114 [label="Access variable R|/|"]; - 115 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; - 116 [label="Exit loop condition"]; - } - subgraph cluster_27 { - color=blue - 117 [label="Enter loop block"]; - subgraph cluster_28 { - color=blue - 118 [label="Enter block"]; - 119 [label="Access variable R|/|"]; - 120 [label="Function call: R|/|.R|FakeOverride|()"]; - 121 [label="Variable declaration: lval element: R|kotlin/Any?|"]; - subgraph cluster_29 { - color=blue - 122 [label="Enter when"]; - subgraph cluster_30 { - color=blue - 123 [label="Enter when branch condition "]; - 124 [label="Access variable R|/element|"]; - 125 [label="Type operator: element is T"]; - 126 [label="Exit when branch condition"]; - } - 127 [label="Synthetic else branch"]; - 128 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 129 [label="Enter block"]; - 130 [label="Access variable R|/element|"]; - 131 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; - 132 [label="Stub" style="filled" fillcolor=gray]; - 133 [label="Exit block" style="filled" fillcolor=gray]; - } - 134 [label="Exit when branch result" style="filled" fillcolor=gray]; - 135 [label="Exit when"]; - } - 136 [label="Exit block"]; - } - 137 [label="Exit loop block"]; - } - 138 [label="Exit whileloop"]; + 104 [label="Stub" style="filled" fillcolor=gray]; + 105 [label="Exit function closeFinally" style="filled" fillcolor=red]; } - 139 [label="Const: Null(null)"]; - 140 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; - 141 [label="Stub" style="filled" fillcolor=gray]; - 142 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; - } - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {138 117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {128 127}; - 127 -> {135}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {142}; - 131 -> {132} [style=dotted]; - 132 -> {133} [style=dotted]; - 133 -> {134} [style=dotted]; - 134 -> {135} [style=dotted]; - 135 -> {136}; - 136 -> {137}; - 137 -> {113}; - 138 -> {139}; - 139 -> {140}; - 140 -> {142}; - 140 -> {141} [style=dotted]; - 141 -> {142} [style=dotted]; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {98 68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {93 73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {105 83 79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {90}; + 83 -> {105 84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {102}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {102}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {105}; + 103 -> {104} [style=dotted]; + 104 -> {105} [style=dotted]; + + subgraph cluster_24 { + color=red + 106 [label="Enter function firstIsInstanceOrNull" style="filled" fillcolor=red]; + 107 [label="Access variable this@R|/firstIsInstanceOrNull|"]; + 108 [label="Variable declaration: lval : R|kotlin/sequences/Sequence<*>|"]; + 109 [label="Access variable R|/|"]; + 110 [label="Function call: R|/|.R|FakeOverride|>|()"]; + 111 [label="Variable declaration: lval : R|kotlin/collections/Iterator|"]; + subgraph cluster_25 { + color=blue + 112 [label="Enter while loop"]; + subgraph cluster_26 { + color=blue + 113 [label="Enter loop condition"]; + 114 [label="Access variable R|/|"]; + 115 [label="Function call: R|/|.R|kotlin/collections/Iterator.hasNext|()"]; + 116 [label="Exit loop condition"]; + } + subgraph cluster_27 { + color=blue + 117 [label="Enter loop block"]; + subgraph cluster_28 { + color=blue + 118 [label="Enter block"]; + 119 [label="Access variable R|/|"]; + 120 [label="Function call: R|/|.R|FakeOverride|()"]; + 121 [label="Variable declaration: lval element: R|kotlin/Any?|"]; + subgraph cluster_29 { + color=blue + 122 [label="Enter when"]; + subgraph cluster_30 { + color=blue + 123 [label="Enter when branch condition "]; + 124 [label="Access variable R|/element|"]; + 125 [label="Type operator: element is T"]; + 126 [label="Exit when branch condition"]; + } + 127 [label="Synthetic else branch"]; + 128 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 129 [label="Enter block"]; + 130 [label="Access variable R|/element|"]; + 131 [label="Jump: ^firstIsInstanceOrNull R|/element|"]; + 132 [label="Stub" style="filled" fillcolor=gray]; + 133 [label="Exit block" style="filled" fillcolor=gray]; + } + 134 [label="Exit when branch result" style="filled" fillcolor=gray]; + 135 [label="Exit when"]; + } + 136 [label="Exit block"]; + } + 137 [label="Exit loop block"]; + } + 138 [label="Exit whileloop"]; + } + 139 [label="Const: Null(null)"]; + 140 [label="Jump: ^firstIsInstanceOrNull Null(null)"]; + 141 [label="Stub" style="filled" fillcolor=gray]; + 142 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red]; + } + + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {138 117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {128 127}; + 127 -> {135}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {142}; + 131 -> {132} [style=dotted]; + 132 -> {133} [style=dotted]; + 133 -> {134} [style=dotted]; + 134 -> {135} [style=dotted]; + 135 -> {136}; + 136 -> {137}; + 137 -> {113}; + 138 -> {139}; + 139 -> {140}; + 140 -> {142}; + 140 -> {141} [style=dotted]; + 141 -> {142} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot b/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot index b5b84bc976f..e8599c2cf39 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/emptyWhen.dot @@ -1,63 +1,63 @@ digraph emptyWhen_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - 2 [label="Synthetic else branch"]; - 3 [label="Exit when"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + 2 [label="Synthetic else branch"]; + 3 [label="Exit when"]; + } + 4 [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}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; - subgraph cluster_2 { - color=red - 5 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 6 [label="Enter when"]; - 7 [label="Access variable R|/x|"]; - 8 [label="Synthetic else branch"]; - 9 [label="Exit when"]; + subgraph cluster_2 { + color=red + 5 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 6 [label="Enter when"]; + 7 [label="Access variable R|/x|"]; + 8 [label="Synthetic else branch"]; + 9 [label="Exit when"]; + } + 10 [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}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; - 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"]; + 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]; } - 17 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/initBlock.dot b/compiler/fir/resolve/testData/resolve/cfg/initBlock.dot index f973aeb1fcd..6dcaa4ca9ce 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/initBlock.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/initBlock.dot @@ -1,22 +1,22 @@ digraph initBlock_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + 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]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function " style="filled" fillcolor=red]; - 3 [label="Exit function " style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function " style="filled" fillcolor=red]; + 3 [label="Exit function " style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/initBlockAndInPlaceLambda.dot b/compiler/fir/resolve/testData/resolve/cfg/initBlockAndInPlaceLambda.dot index 6711d7aae85..8acc243d53f 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/initBlockAndInPlaceLambda.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/initBlockAndInPlaceLambda.dot @@ -1,30 +1,30 @@ digraph initBlockAndInPlaceLambda_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function getter" style="filled" fillcolor=red]; - 1 [label="Exit function getter" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function getter" style="filled" fillcolor=red]; + 1 [label="Exit function getter" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter property" style="filled" fillcolor=red]; - 3 [label="Exit property" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter property" style="filled" fillcolor=red]; + 3 [label="Exit property" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter function " style="filled" fillcolor=red]; - 5 [label="Exit function " style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter function " style="filled" fillcolor=red]; + 5 [label="Exit function " style="filled" fillcolor=red]; + } - 4 -> {5}; + 4 -> {5}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/jumps.dot b/compiler/fir/resolve/testData/resolve/cfg/jumps.dot index 1607c2c3b4e..80f79fac468 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/jumps.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/jumps.dot @@ -1,363 +1,359 @@ digraph jumps_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 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"]; - } - 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"]; - } - 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="Access variable R|/x|"]; - 26 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 27 [label="Exit function test_1" style="filled" fillcolor=red]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {14 7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {21}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {27}; - 17 -> {18} [style=dotted]; - 18 -> {19} [style=dotted]; - 19 -> {20} [style=dotted]; - 20 -> {21} [style=dotted]; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - - subgraph cluster_6 { - color=red - 28 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 29 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 30 [label="Enter when branch condition "]; - 31 [label="Access variable R|/x|"]; - 32 [label="Const: Null(null)"]; - 33 [label="Operator =="]; - 34 [label="Exit when branch condition"]; - } - subgraph cluster_9 { - color=blue - 35 [label="Enter when branch condition else"]; - 36 [label="Exit when branch condition"]; - } - 37 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 38 [label="Enter block"]; - 39 [label="Access variable R|/x|"]; - 40 [label="Exit block"]; - } - 41 [label="Exit when branch result"]; - 42 [label="Enter when branch result"]; - subgraph cluster_11 { - color=blue - 43 [label="Enter block"]; - 44 [label="Access variable R|/x|"]; - 45 [label="Exit block"]; - } - 46 [label="Exit when branch result"]; - 47 [label="Exit when"]; - } - 48 [label="Variable declaration: lval y: R|kotlin/Int?|"]; - 49 [label="Access variable R|/y|"]; - 50 [label="Function call: R|/y|.#()"]; - 51 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {42 35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {47}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - - subgraph cluster_12 { - color=red - 52 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 53 [label="Enter while loop"]; - subgraph cluster_14 { - color=blue - 54 [label="Enter loop condition"]; - 55 [label="Const: Boolean(true)"]; - 56 [label="Exit loop condition"]; - } - subgraph cluster_15 { - color=blue - 57 [label="Enter loop block"]; - subgraph cluster_16 { - color=blue - 58 [label="Enter block"]; - 59 [label="Access variable R|/x|"]; - 60 [label="Type operator: x as Int"]; - 61 [label="Jump: break@@@[Boolean(true)] "]; - 62 [label="Stub" style="filled" fillcolor=gray]; - 63 [label="Exit block" style="filled" fillcolor=gray]; - } - 64 [label="Exit loop block" style="filled" fillcolor=gray]; - } - 65 [label="Stub" style="filled" fillcolor=gray]; - 66 [label="Exit whileloop"]; - } - 67 [label="Access variable R|/x|"]; - 68 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 69 [label="Exit function test_3" style="filled" fillcolor=red]; - } - - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 56 -> {65} [style=dotted]; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {66}; - 61 -> {62} [style=dotted]; - 62 -> {63} [style=dotted]; - 63 -> {64} [style=dotted]; - 64 -> {54} [style=dotted]; - 65 -> {66} [style=dotted]; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - - subgraph cluster_17 { - color=red - 70 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_18 { - color=blue - 71 [label="Enter do-while loop"]; - subgraph cluster_19 { - color=blue - 72 [label="Enter loop block"]; - subgraph cluster_20 { - color=blue - 73 [label="Enter block"]; - 74 [label="Access variable R|/x|"]; - 75 [label="Type operator: x as Int"]; - 76 [label="Jump: break@@@[Boolean(true)] "]; - 77 [label="Stub" style="filled" fillcolor=gray]; - 78 [label="Exit block" style="filled" fillcolor=gray]; - } - 79 [label="Exit loop block" style="filled" fillcolor=gray]; - } - subgraph cluster_21 { - color=blue - 80 [label="Enter loop condition" style="filled" fillcolor=gray]; - 81 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; - 82 [label="Exit loop condition" style="filled" fillcolor=gray]; - } - 83 [label="Stub" style="filled" fillcolor=gray]; - 84 [label="Exit do-whileloop"]; - } - 85 [label="Access variable R|/x|"]; - 86 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 87 [label="Exit function test_4" style="filled" fillcolor=red]; - } - - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {84}; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {80} [style=dotted]; - 80 -> {81} [style=dotted]; - 81 -> {82} [style=dotted]; - 82 -> {72 83} [style=dotted]; - 83 -> {84} [style=dotted]; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - - subgraph cluster_22 { - color=red - 88 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_23 { - color=blue - 89 [label="Enter while loop"]; - subgraph cluster_24 { - color=blue - 90 [label="Enter loop condition"]; - 91 [label="Access variable R|/b|"]; - 92 [label="Exit loop condition"]; - } - subgraph cluster_25 { - color=blue - 93 [label="Enter loop block"]; - subgraph cluster_26 { - color=blue - 94 [label="Enter block"]; - subgraph cluster_27 { + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { color=blue - 95 [label="Enter when"]; - subgraph cluster_28 { - color=blue - 96 [label="Enter when branch condition "]; - 97 [label="Access variable R|/b|"]; - 98 [label="Exit when branch condition"]; + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; } - 99 [label="Synthetic else branch"]; - 100 [label="Enter when branch result"]; - subgraph cluster_29 { - color=blue - 101 [label="Enter block"]; - 102 [label="Jump: continue@@@[R|/b|] "]; - 103 [label="Stub" style="filled" fillcolor=gray]; - 104 [label="Exit block" style="filled" fillcolor=gray]; + subgraph cluster_3 { + color=blue + 7 [label="Enter when branch condition else"]; + 8 [label="Exit when branch condition"]; } - 105 [label="Exit when branch result" style="filled" fillcolor=gray]; - 106 [label="Exit when"]; - } - 107 [label="Exit block"]; + 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"]; } - 108 [label="Exit loop block"]; - } - 109 [label="Exit whileloop"]; + 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="Access variable R|/x|"]; + 26 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 27 [label="Exit function test_1" style="filled" fillcolor=red]; } - 110 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {109 93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {100 99}; - 99 -> {106}; - 100 -> {101}; - 101 -> {102}; - 102 -> {89}; - 102 -> {103} [style=dotted]; - 103 -> {104} [style=dotted]; - 104 -> {105} [style=dotted]; - 105 -> {106} [style=dotted]; - 106 -> {107}; - 107 -> {108}; - 108 -> {90}; - 109 -> {110}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {14 7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {21}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {27}; + 17 -> {18} [style=dotted]; + 18 -> {19} [style=dotted]; + 19 -> {20} [style=dotted]; + 20 -> {21} [style=dotted]; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; - subgraph cluster_30 { - color=red - 111 [label="Enter function run" style="filled" fillcolor=red]; - 112 [label="Function call: R|/block|.R|FakeOverride|()"]; - 113 [label="Exit function run" style="filled" fillcolor=red]; - } - - 111 -> {112}; - 112 -> {113}; - - subgraph cluster_31 { - color=red - 114 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_32 { - color=blue - 115 [label="Enter function anonymousFunction"]; - 116 [label="Jump: ^@run Unit"]; - 117 [label="Stub" style="filled" fillcolor=gray]; - 118 [label="Exit function anonymousFunction"]; + subgraph cluster_6 { + color=red + 28 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 29 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 30 [label="Enter when branch condition "]; + 31 [label="Access variable R|/x|"]; + 32 [label="Const: Null(null)"]; + 33 [label="Operator =="]; + 34 [label="Exit when branch condition"]; + } + subgraph cluster_9 { + color=blue + 35 [label="Enter when branch condition else"]; + 36 [label="Exit when branch condition"]; + } + 37 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 38 [label="Enter block"]; + 39 [label="Access variable R|/x|"]; + 40 [label="Exit block"]; + } + 41 [label="Exit when branch result"]; + 42 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 43 [label="Enter block"]; + 44 [label="Access variable R|/x|"]; + 45 [label="Exit block"]; + } + 46 [label="Exit when branch result"]; + 47 [label="Exit when"]; + } + 48 [label="Variable declaration: lval y: R|kotlin/Int?|"]; + 49 [label="Access variable R|/y|"]; + 50 [label="Function call: R|/y|.#()"]; + 51 [label="Exit function test_2" style="filled" fillcolor=red]; } - 119 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {42 35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {47}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + + subgraph cluster_12 { + color=red + 52 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 53 [label="Enter while loop"]; + subgraph cluster_14 { + color=blue + 54 [label="Enter loop condition"]; + 55 [label="Const: Boolean(true)"]; + 56 [label="Exit loop condition"]; + } + subgraph cluster_15 { + color=blue + 57 [label="Enter loop block"]; + subgraph cluster_16 { + color=blue + 58 [label="Enter block"]; + 59 [label="Access variable R|/x|"]; + 60 [label="Type operator: x as Int"]; + 61 [label="Jump: break@@@[Boolean(true)] "]; + 62 [label="Stub" style="filled" fillcolor=gray]; + 63 [label="Exit block" style="filled" fillcolor=gray]; + } + 64 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 65 [label="Exit whileloop"]; + } + 66 [label="Access variable R|/x|"]; + 67 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 68 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 56 -> {65} [style=dotted]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {65}; + 61 -> {62} [style=dotted]; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {54} [style=dotted]; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + + subgraph cluster_17 { + color=red + 69 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 70 [label="Enter do-while loop"]; + subgraph cluster_19 { + color=blue + 71 [label="Enter loop block"]; + subgraph cluster_20 { + color=blue + 72 [label="Enter block"]; + 73 [label="Access variable R|/x|"]; + 74 [label="Type operator: x as Int"]; + 75 [label="Jump: break@@@[Boolean(true)] "]; + 76 [label="Stub" style="filled" fillcolor=gray]; + 77 [label="Exit block" style="filled" fillcolor=gray]; + } + 78 [label="Exit loop block" style="filled" fillcolor=gray]; + } + subgraph cluster_21 { + color=blue + 79 [label="Enter loop condition" style="filled" fillcolor=gray]; + 80 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; + 81 [label="Exit loop condition" 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]; + } + + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {82}; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {71 82} [style=dotted]; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + + subgraph cluster_22 { + color=red + 86 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_23 { + color=blue + 87 [label="Enter while loop"]; + subgraph cluster_24 { + color=blue + 88 [label="Enter loop condition"]; + 89 [label="Access variable R|/b|"]; + 90 [label="Exit loop condition"]; + } + 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"]; + } + 108 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {107 91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {98 97}; + 97 -> {104}; + 98 -> {99}; + 99 -> {100}; + 100 -> {87}; + 100 -> {101} [style=dotted]; + 101 -> {102} [style=dotted]; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; + 104 -> {105}; + 105 -> {106}; + 106 -> {88}; + 107 -> {108}; + + subgraph cluster_30 { + color=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]; + } + + 109 -> {110}; + 110 -> {111}; + + subgraph cluster_31 { + color=red + 112 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 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 } )"]; - 120 [label="Exit function test_6" style="filled" fillcolor=red]; - } + 118 [label="Exit function test_6" style="filled" fillcolor=red]; + } - 114 -> {115}; - 115 -> {118 116}; - 116 -> {118}; - 116 -> {117} [style=dotted]; - 117 -> {118} [style=dotted]; - 118 -> {115 119}; - 119 -> {120}; + 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/jumps_0.dot b/compiler/fir/resolve/testData/resolve/cfg/jumps_0.dot new file mode 100644 index 00000000000..1607c2c3b4e --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cfg/jumps_0.dot @@ -0,0 +1,363 @@ +digraph jumps_kt { + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; + } + 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="Access variable R|/x|"]; + 26 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 27 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {14 7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {21}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {27}; + 17 -> {18} [style=dotted]; + 18 -> {19} [style=dotted]; + 19 -> {20} [style=dotted]; + 20 -> {21} [style=dotted]; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + + subgraph cluster_6 { + color=red + 28 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 29 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 30 [label="Enter when branch condition "]; + 31 [label="Access variable R|/x|"]; + 32 [label="Const: Null(null)"]; + 33 [label="Operator =="]; + 34 [label="Exit when branch condition"]; + } + subgraph cluster_9 { + color=blue + 35 [label="Enter when branch condition else"]; + 36 [label="Exit when branch condition"]; + } + 37 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 38 [label="Enter block"]; + 39 [label="Access variable R|/x|"]; + 40 [label="Exit block"]; + } + 41 [label="Exit when branch result"]; + 42 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 43 [label="Enter block"]; + 44 [label="Access variable R|/x|"]; + 45 [label="Exit block"]; + } + 46 [label="Exit when branch result"]; + 47 [label="Exit when"]; + } + 48 [label="Variable declaration: lval y: R|kotlin/Int?|"]; + 49 [label="Access variable R|/y|"]; + 50 [label="Function call: R|/y|.#()"]; + 51 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {42 35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {47}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + + subgraph cluster_12 { + color=red + 52 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 53 [label="Enter while loop"]; + subgraph cluster_14 { + color=blue + 54 [label="Enter loop condition"]; + 55 [label="Const: Boolean(true)"]; + 56 [label="Exit loop condition"]; + } + subgraph cluster_15 { + color=blue + 57 [label="Enter loop block"]; + subgraph cluster_16 { + color=blue + 58 [label="Enter block"]; + 59 [label="Access variable R|/x|"]; + 60 [label="Type operator: x as Int"]; + 61 [label="Jump: break@@@[Boolean(true)] "]; + 62 [label="Stub" style="filled" fillcolor=gray]; + 63 [label="Exit block" style="filled" fillcolor=gray]; + } + 64 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 65 [label="Stub" style="filled" fillcolor=gray]; + 66 [label="Exit whileloop"]; + } + 67 [label="Access variable R|/x|"]; + 68 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 69 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 56 -> {65} [style=dotted]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {66}; + 61 -> {62} [style=dotted]; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {54} [style=dotted]; + 65 -> {66} [style=dotted]; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + + subgraph cluster_17 { + color=red + 70 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 71 [label="Enter do-while loop"]; + subgraph cluster_19 { + color=blue + 72 [label="Enter loop block"]; + subgraph cluster_20 { + color=blue + 73 [label="Enter block"]; + 74 [label="Access variable R|/x|"]; + 75 [label="Type operator: x as Int"]; + 76 [label="Jump: break@@@[Boolean(true)] "]; + 77 [label="Stub" style="filled" fillcolor=gray]; + 78 [label="Exit block" style="filled" fillcolor=gray]; + } + 79 [label="Exit loop block" style="filled" fillcolor=gray]; + } + subgraph cluster_21 { + color=blue + 80 [label="Enter loop condition" style="filled" fillcolor=gray]; + 81 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; + 82 [label="Exit loop condition" style="filled" fillcolor=gray]; + } + 83 [label="Stub" style="filled" fillcolor=gray]; + 84 [label="Exit do-whileloop"]; + } + 85 [label="Access variable R|/x|"]; + 86 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 87 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {84}; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {82} [style=dotted]; + 82 -> {72 83} [style=dotted]; + 83 -> {84} [style=dotted]; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + + subgraph cluster_22 { + color=red + 88 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_23 { + color=blue + 89 [label="Enter while loop"]; + subgraph cluster_24 { + color=blue + 90 [label="Enter loop condition"]; + 91 [label="Access variable R|/b|"]; + 92 [label="Exit loop condition"]; + } + subgraph cluster_25 { + color=blue + 93 [label="Enter loop block"]; + subgraph cluster_26 { + color=blue + 94 [label="Enter block"]; + subgraph cluster_27 { + color=blue + 95 [label="Enter when"]; + subgraph cluster_28 { + color=blue + 96 [label="Enter when branch condition "]; + 97 [label="Access variable R|/b|"]; + 98 [label="Exit when branch condition"]; + } + 99 [label="Synthetic else branch"]; + 100 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 101 [label="Enter block"]; + 102 [label="Jump: continue@@@[R|/b|] "]; + 103 [label="Stub" style="filled" fillcolor=gray]; + 104 [label="Exit block" style="filled" fillcolor=gray]; + } + 105 [label="Exit when branch result" style="filled" fillcolor=gray]; + 106 [label="Exit when"]; + } + 107 [label="Exit block"]; + } + 108 [label="Exit loop block"]; + } + 109 [label="Exit whileloop"]; + } + 110 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {109 93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {100 99}; + 99 -> {106}; + 100 -> {101}; + 101 -> {102}; + 102 -> {89}; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; + 104 -> {105} [style=dotted]; + 105 -> {106} [style=dotted]; + 106 -> {107}; + 107 -> {108}; + 108 -> {90}; + 109 -> {110}; + + subgraph cluster_30 { + color=red + 111 [label="Enter function run" style="filled" fillcolor=red]; + 112 [label="Function call: R|/block|.R|FakeOverride|()"]; + 113 [label="Exit function run" style="filled" fillcolor=red]; + } + + 111 -> {112}; + 112 -> {113}; + + subgraph cluster_31 { + color=red + 114 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 115 [label="Enter function anonymousFunction"]; + 116 [label="Jump: ^@run Unit"]; + 117 [label="Stub" style="filled" fillcolor=gray]; + 118 [label="Exit function anonymousFunction"]; + } + 119 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + ^@run Unit +} +)"]; + 120 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 114 -> {115}; + 115 -> {118 116}; + 116 -> {118}; + 116 -> {117} [style=dotted]; + 117 -> {118} [style=dotted]; + 118 -> {115 119}; + 119 -> {120}; + +} diff --git a/compiler/fir/resolve/testData/resolve/cfg/jumps_1.dot b/compiler/fir/resolve/testData/resolve/cfg/jumps_1.dot new file mode 100644 index 00000000000..f38b67659e3 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cfg/jumps_1.dot @@ -0,0 +1,358 @@ +digraph jumps_kt { + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; + } + 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="Access variable R|/x|"]; + 26 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 27 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {14 7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {21}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {27}; + 17 -> {18} [style=dotted]; + 18 -> {19} [style=dotted]; + 19 -> {20} [style=dotted]; + 20 -> {21} [style=dotted]; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + + subgraph cluster_6 { + color=red + 28 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 29 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 30 [label="Enter when branch condition "]; + 31 [label="Access variable R|/x|"]; + 32 [label="Const: Null(null)"]; + 33 [label="Operator =="]; + 34 [label="Exit when branch condition"]; + } + subgraph cluster_9 { + color=blue + 35 [label="Enter when branch condition else"]; + 36 [label="Exit when branch condition"]; + } + 37 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 38 [label="Enter block"]; + 39 [label="Access variable R|/x|"]; + 40 [label="Exit block"]; + } + 41 [label="Exit when branch result"]; + 42 [label="Enter when branch result"]; + subgraph cluster_11 { + color=blue + 43 [label="Enter block"]; + 44 [label="Access variable R|/x|"]; + 45 [label="Exit block"]; + } + 46 [label="Exit when branch result"]; + 47 [label="Exit when"]; + } + 48 [label="Variable declaration: lval y: R|kotlin/Int?|"]; + 49 [label="Access variable R|/y|"]; + 50 [label="Function call: R|/y|.#()"]; + 51 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {42 35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {47}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + + subgraph cluster_12 { + color=red + 52 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 53 [label="Enter while loop"]; + subgraph cluster_14 { + color=blue + 54 [label="Enter loop condition"]; + 55 [label="Const: Boolean(true)"]; + 56 [label="Exit loop condition"]; + } + subgraph cluster_15 { + color=blue + 57 [label="Enter loop block"]; + subgraph cluster_16 { + color=blue + 58 [label="Enter block"]; + 59 [label="Access variable R|/x|"]; + 60 [label="Type operator: x as Int"]; + 61 [label="Jump: break@@@[Boolean(true)] "]; + 62 [label="Stub" style="filled" fillcolor=gray]; + 63 [label="Exit block" style="filled" fillcolor=gray]; + } + 64 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 65 [label="Exit whileloop"]; + } + 66 [label="Access variable R|/x|"]; + 67 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 68 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {65 57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {65}; + 61 -> {62} [style=dotted]; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; + 64 -> {54} [style=dotted]; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + + subgraph cluster_17 { + color=red + 69 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 70 [label="Enter do-while loop"]; + subgraph cluster_19 { + color=blue + 71 [label="Enter loop block"]; + subgraph cluster_20 { + color=blue + 72 [label="Enter block"]; + 73 [label="Access variable R|/x|"]; + 74 [label="Type operator: x as Int"]; + 75 [label="Jump: break@@@[Boolean(true)] "]; + 76 [label="Stub" style="filled" fillcolor=gray]; + 77 [label="Exit block" style="filled" fillcolor=gray]; + } + 78 [label="Exit loop block" style="filled" fillcolor=gray]; + } + subgraph cluster_21 { + color=blue + 79 [label="Enter loop condition" style="filled" fillcolor=gray]; + 80 [label="Const: Boolean(true)" style="filled" fillcolor=gray]; + 81 [label="Exit loop condition" 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]; + } + + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {82}; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {71 82} [style=dotted]; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + + subgraph cluster_22 { + color=red + 86 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_23 { + color=blue + 87 [label="Enter while loop"]; + subgraph cluster_24 { + color=blue + 88 [label="Enter loop condition"]; + 89 [label="Access variable R|/b|"]; + 90 [label="Exit loop condition"]; + } + 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"]; + } + 108 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {107 91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {98 97}; + 97 -> {104}; + 98 -> {99}; + 99 -> {100}; + 100 -> {87}; + 100 -> {101} [style=dotted]; + 101 -> {102} [style=dotted]; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; + 104 -> {105}; + 105 -> {106}; + 106 -> {88}; + 107 -> {108}; + + subgraph cluster_30 { + color=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]; + } + + 109 -> {110}; + 110 -> {111}; + + subgraph cluster_31 { + color=red + 112 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 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 +} +)"]; + 118 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 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 98b9fd47c41..086720ebfff 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/lambdas.dot @@ -1,211 +1,211 @@ digraph lambdas_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function run" style="filled" fillcolor=red]; - 1 [label="Function call: R|/block|.R|FakeOverride|()"]; - 2 [label="Exit function run" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter 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}; + 0 -> {1}; + 1 -> {2}; - subgraph cluster_1 { - color=red - 3 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 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 - 11 [label="Enter block"]; - subgraph cluster_5 { - color=blue - 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"]; - } - 16 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + subgraph cluster_1 { + color=red + 3 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 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 + 11 [label="Enter block"]; + subgraph cluster_5 { + color=blue + 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"]; + } + 16 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|kotlin/Int.inc|() } )"]; - 17 [label="Exit block"]; - } - 18 [label="Exit when branch result"]; - 19 [label="Exit when"]; + 17 [label="Exit block"]; + } + 18 [label="Exit when branch result"]; + 19 [label="Exit when"]; + } + 20 [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 -> {10 9}; - 9 -> {19}; - 10 -> {11}; - 11 -> {12}; - 12 -> {15 13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {12 16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {10 9}; + 9 -> {19}; + 10 -> {11}; + 11 -> {12}; + 12 -> {15 13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {12 16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; - 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"]; + 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]; } - 34 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {28 27}; - 27 -> {33}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {28 27}; + 27 -> {33}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 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}; - - 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"]; + 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]; } - 51 [label="Function call: R|/getInt|( = getInt@fun (): R|kotlin/Unit| { + + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + + 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| { + 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 - 55 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 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"]; + 53 [label="Stub" style="filled" fillcolor=gray]; + 54 [label="Exit function test_3" style="filled" fillcolor=red]; } - 61 [label="Function call: R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { + + 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 + 55 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_15 { + color=blue + 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"]; + } + 61 [label="Function call: R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { ^test_4 Int(1) } )"]; - 62 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { + 62 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun (): R|kotlin/Unit| { ^test_4 Int(1) } )"]; - 63 [label="Stub" style="filled" fillcolor=gray]; - 64 [label="Exit function test_4" 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 -> {64}; - 58 -> {59} [style=dotted]; - 59 -> {60} [style=dotted]; - 60 -> {56 61}; - 61 -> {62}; - 62 -> {64}; - 62 -> {63} [style=dotted]; - 63 -> {64} [style=dotted]; + 55 -> {56}; + 56 -> {60 57}; + 57 -> {58}; + 58 -> {64}; + 58 -> {59} [style=dotted]; + 59 -> {60} [style=dotted]; + 60 -> {56 61}; + 61 -> {62}; + 62 -> {64}; + 62 -> {63} [style=dotted]; + 63 -> {64} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/loops.dot b/compiler/fir/resolve/testData/resolve/cfg/loops.dot index 57776ffa7cf..9e7fec885d4 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/loops.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/loops.dot @@ -1,506 +1,494 @@ digraph loops_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function testWhile" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter while loop"]; - subgraph cluster_2 { - color=blue - 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 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"]; - } - 11 [label="Exit loop block"]; - } - 12 [label="Exit whileloop"]; - } - 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 -> {12 5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {2}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - - subgraph cluster_5 { - color=red - 16 [label="Enter function testDoWhile" style="filled" fillcolor=red]; - subgraph cluster_6 { - color=blue - 17 [label="Enter do-while loop"]; - subgraph cluster_7 { - color=blue - 18 [label="Enter loop block"]; - subgraph cluster_8 { - color=blue - 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"]; - } - 24 [label="Exit loop 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"]; - } - 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}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {18 28}; - 28 -> {29}; - 29 -> {30}; - 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}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {55 45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {41}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - - 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}; - 63 -> {69} [style=dotted]; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {61}; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; - 71 -> {72} [style=dotted]; - - subgraph cluster_20 { - color=red - 73 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; - subgraph cluster_21 { - color=blue - 74 [label="Enter while loop"]; - subgraph cluster_22 { - color=blue - 75 [label="Enter loop condition"]; - 76 [label="Const: Boolean(true)"]; - 77 [label="Exit loop condition"]; - } - subgraph cluster_23 { - color=blue - 78 [label="Enter loop block"]; - subgraph cluster_24 { - color=blue - 79 [label="Enter block"]; - subgraph cluster_25 { + subgraph cluster_0 { + color=red + 0 [label="Enter function testWhile" style="filled" fillcolor=red]; + subgraph cluster_1 { 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"]; + 1 [label="Enter while loop"]; + subgraph cluster_2 { + color=blue + 2 [label="Enter loop condition"]; + 3 [label="Access variable R|/b|"]; + 4 [label="Exit loop 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]; + subgraph cluster_3 { + color=blue + 5 [label="Enter loop block"]; + subgraph cluster_4 { + color=blue + 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"]; + } + 11 [label="Exit loop block"]; } - 90 [label="Exit when branch result" style="filled" fillcolor=gray]; - 91 [label="Exit when"]; - } - 92 [label="Exit block"]; + 12 [label="Exit whileloop"]; } - 93 [label="Exit loop block"]; - } - 94 [label="Stub" style="filled" fillcolor=gray]; - 95 [label="Exit whileloop"]; + 13 [label="Access variable R|/x|"]; + 14 [label="Type operator: x is String"]; + 15 [label="Exit function testWhile" 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 -> {85 84}; - 84 -> {91}; - 85 -> {86}; - 86 -> {87}; - 87 -> {95}; - 87 -> {88} [style=dotted]; - 88 -> {89} [style=dotted]; - 89 -> {90} [style=dotted]; - 90 -> {91} [style=dotted]; - 91 -> {92}; - 92 -> {93}; - 93 -> {75}; - 94 -> {95} [style=dotted]; - 95 -> {96}; - 96 -> {97}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {12 5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {2}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; - 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 -> {109}; - 102 -> {103} [style=dotted]; - 103 -> {104} [style=dotted]; - 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 - 112 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; - subgraph cluster_34 { - color=blue - 113 [label="Enter do-while loop"]; - subgraph cluster_35 { - color=blue - 114 [label="Enter loop block"]; - subgraph cluster_36 { - color=blue - 115 [label="Enter block"]; - 116 [label="Const: Int(1)"]; - 117 [label="Exit block"]; - } - 118 [label="Exit loop block"]; - } - subgraph cluster_37 { - color=blue - 119 [label="Enter loop condition"]; - 120 [label="Const: Boolean(true)"]; - 121 [label="Exit loop condition"]; - } - 122 [label="Stub" style="filled" fillcolor=gray]; - 123 [label="Exit do-whileloop" 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 { + subgraph cluster_5 { + color=red + 16 [label="Enter function testDoWhile" style="filled" fillcolor=red]; + subgraph cluster_6 { 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"]; + 17 [label="Enter do-while loop"]; + subgraph cluster_7 { + color=blue + 18 [label="Enter loop block"]; + subgraph cluster_8 { + color=blue + 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"]; + } + 24 [label="Exit loop block"]; } - 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]; + subgraph cluster_9 { + color=blue + 25 [label="Enter loop condition"]; + 26 [label="Access variable R|/b|"]; + 27 [label="Exit loop condition"]; } - 140 [label="Exit when branch result" style="filled" fillcolor=gray]; - 141 [label="Exit when"]; - } - 142 [label="Exit block"]; + 28 [label="Exit do-whileloop"]; } - 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"]; + 29 [label="Access variable R|/x|"]; + 30 [label="Type operator: x is String"]; + 31 [label="Exit function testDoWhile" style="filled" fillcolor=red]; } - 149 [label="Const: Int(1)"]; - 150 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; - } - 126 -> {127}; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {135 134}; - 134 -> {141}; - 135 -> {136}; - 136 -> {137}; - 137 -> {148}; - 137 -> {138} [style=dotted]; - 138 -> {139} [style=dotted]; - 139 -> {140} [style=dotted]; - 140 -> {141} [style=dotted]; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {128}; - 146 -> {147} [style=dotted]; - 147 -> {148} [style=dotted]; - 148 -> {149}; - 149 -> {150}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {18 28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; - 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"]; + 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"]; } - 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"]; + 56 [label="Access variable R|/x|"]; + 57 [label="Type operator: x is String"]; + 58 [label="Exit function testFor" style="filled" fillcolor=red]; } - 162 [label="Const: Int(1)"]; - 163 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; - } - 164 [label="Stub" style="filled" fillcolor=gray]; - 151 -> {152}; - 152 -> {153}; - 153 -> {154}; - 154 -> {155}; - 155 -> {156}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 160 -> {164} [style=dotted]; - 161 -> {162}; - 162 -> {163}; - 164 -> {153} [style=dotted]; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {55 45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {41}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + + 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="Exit whileloop" style="filled" fillcolor=gray]; + } + 70 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 71 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 63 -> {69} [style=dotted]; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {61}; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + + subgraph cluster_20 { + color=red + 72 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_21 { + color=blue + 73 [label="Enter while loop"]; + subgraph cluster_22 { + color=blue + 74 [label="Enter loop condition"]; + 75 [label="Const: Boolean(true)"]; + 76 [label="Exit loop condition"]; + } + subgraph cluster_23 { + color=blue + 77 [label="Enter loop block"]; + subgraph cluster_24 { + color=blue + 78 [label="Enter block"]; + 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="Exit whileloop"]; + } + 94 [label="Const: Int(1)"]; + 95 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red]; + } + + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 76 -> {93} [style=dotted]; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {84 83}; + 83 -> {90}; + 84 -> {85}; + 85 -> {86}; + 86 -> {93}; + 86 -> {87} [style=dotted]; + 87 -> {88} [style=dotted]; + 88 -> {89} [style=dotted]; + 89 -> {90} [style=dotted]; + 90 -> {91}; + 91 -> {92}; + 92 -> {74}; + 93 -> {94}; + 94 -> {95}; + + subgraph cluster_28 { + color=red + 96 [label="Enter function testWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_29 { + color=blue + 97 [label="Enter while loop"]; + subgraph cluster_30 { + color=blue + 98 [label="Enter loop condition"]; + 99 [label="Const: Boolean(false)"]; + 100 [label="Exit loop condition"]; + } + subgraph cluster_31 { + color=blue + 101 [label="Enter loop block" style="filled" fillcolor=gray]; + subgraph cluster_32 { + color=blue + 102 [label="Enter block" style="filled" fillcolor=gray]; + 103 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 104 [label="Exit block" style="filled" fillcolor=gray]; + } + 105 [label="Exit loop block" style="filled" fillcolor=gray]; + } + 106 [label="Exit whileloop"]; + } + 107 [label="Const: Int(1)"]; + 108 [label="Exit function testWhileFalse" style="filled" fillcolor=red]; + } + + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {106}; + 100 -> {101} [style=dotted]; + 101 -> {102} [style=dotted]; + 102 -> {103} [style=dotted]; + 103 -> {104} [style=dotted]; + 104 -> {105} [style=dotted]; + 105 -> {98} [style=dotted]; + 106 -> {107}; + 107 -> {108}; + + subgraph cluster_33 { + color=red + 109 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red]; + subgraph cluster_34 { + color=blue + 110 [label="Enter do-while loop"]; + subgraph cluster_35 { + color=blue + 111 [label="Enter loop block"]; + subgraph cluster_36 { + color=blue + 112 [label="Enter block"]; + 113 [label="Const: Int(1)"]; + 114 [label="Exit block"]; + } + 115 [label="Exit loop block"]; + } + subgraph cluster_37 { + color=blue + 116 [label="Enter loop condition"]; + 117 [label="Const: Boolean(true)"]; + 118 [label="Exit loop condition"]; + } + 119 [label="Exit do-whileloop" style="filled" fillcolor=gray]; + } + 120 [label="Const: Int(1)" style="filled" fillcolor=gray]; + 121 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray]; + } + + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {111}; + 118 -> {119} [style=dotted]; + 119 -> {120} [style=dotted]; + 120 -> {121} [style=dotted]; + + subgraph cluster_38 { + color=red + 122 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + subgraph cluster_39 { + color=blue + 123 [label="Enter do-while loop"]; + subgraph cluster_40 { + color=blue + 124 [label="Enter loop block"]; + subgraph cluster_41 { + color=blue + 125 [label="Enter block"]; + subgraph cluster_42 { + color=blue + 126 [label="Enter when"]; + subgraph cluster_43 { + color=blue + 127 [label="Enter when branch condition "]; + 128 [label="Access variable R|/b|"]; + 129 [label="Exit when branch condition"]; + } + 130 [label="Synthetic else branch"]; + 131 [label="Enter when branch result"]; + subgraph cluster_44 { + color=blue + 132 [label="Enter block"]; + 133 [label="Jump: break@@@[Boolean(true)] "]; + 134 [label="Stub" style="filled" fillcolor=gray]; + 135 [label="Exit block" style="filled" fillcolor=gray]; + } + 136 [label="Exit when branch result" style="filled" fillcolor=gray]; + 137 [label="Exit when"]; + } + 138 [label="Exit block"]; + } + 139 [label="Exit loop block"]; + } + subgraph cluster_45 { + color=blue + 140 [label="Enter loop condition"]; + 141 [label="Const: Boolean(true)"]; + 142 [label="Exit loop condition"]; + } + 143 [label="Exit do-whileloop"]; + } + 144 [label="Const: Int(1)"]; + 145 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red]; + } + + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; + 127 -> {128}; + 128 -> {129}; + 129 -> {131 130}; + 130 -> {137}; + 131 -> {132}; + 132 -> {133}; + 133 -> {143}; + 133 -> {134} [style=dotted]; + 134 -> {135} [style=dotted]; + 135 -> {136} [style=dotted]; + 136 -> {137} [style=dotted]; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {124}; + 142 -> {143} [style=dotted]; + 143 -> {144}; + 144 -> {145}; + + subgraph cluster_46 { + color=red + 146 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red]; + subgraph cluster_47 { + color=blue + 147 [label="Enter do-while loop"]; + subgraph cluster_48 { + color=blue + 148 [label="Enter loop block"]; + subgraph cluster_49 { + color=blue + 149 [label="Enter block"]; + 150 [label="Const: Int(1)"]; + 151 [label="Exit block"]; + } + 152 [label="Exit loop block"]; + } + subgraph cluster_50 { + color=blue + 153 [label="Enter loop condition"]; + 154 [label="Const: Boolean(false)"]; + 155 [label="Exit loop condition"]; + } + 156 [label="Exit do-whileloop"]; + } + 157 [label="Const: Int(1)"]; + 158 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red]; + } + + 146 -> {147}; + 147 -> {148}; + 148 -> {149}; + 149 -> {150}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + 155 -> {156}; + 155 -> {148} [style=dotted]; + 156 -> {157}; + 157 -> {158}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot b/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot index 43f5e0cc975..9c80ab0d4b1 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/propertiesAndInitBlocks.dot @@ -1,132 +1,132 @@ digraph propertiesAndInitBlocks_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter 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}; - - 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 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 - 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]; - } - - 8 -> {9}; - 9 -> {10}; - 10 -> {12}; - 10 -> {11} [style=dotted]; - 11 -> {12} [style=dotted]; - - subgraph cluster_4 { - color=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]; - } - - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - - subgraph cluster_5 { - color=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}; - - 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 - 31 [label="Enter function getter" style="filled" fillcolor=red]; - 32 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 31 -> {32}; - - subgraph cluster_9 { - color=red - 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 - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function run" style="filled" fillcolor=red]; + 1 [label="Function call: R|/block|.R|FakeOverride|()"]; + 2 [label="Exit function run" style="filled" fillcolor=red]; } - 41 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + + 0 -> {1}; + 1 -> {2}; + + subgraph cluster_1 { + color=red + 3 [label="Enter function getter" style="filled" fillcolor=red]; + 4 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 3 -> {4}; + + subgraph cluster_2 { + color=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 + 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]; + } + + 8 -> {9}; + 9 -> {10}; + 10 -> {12}; + 10 -> {11} [style=dotted]; + 11 -> {12} [style=dotted]; + + subgraph cluster_4 { + color=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]; + } + + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + + subgraph cluster_5 { + color=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}; + + 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 + 31 [label="Enter function getter" style="filled" fillcolor=red]; + 32 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 31 -> {32}; + + subgraph cluster_9 { + color=red + 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 + 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"]; + } + 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|() @@ -147,87 +147,87 @@ digraph propertiesAndInitBlocks_kt { throw R|java/lang/Exception.Exception|() } )"]; - 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: IntegerLiteral(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"]; + 42 [label="Exit property" style="filled" fillcolor=red]; } - 63 [label="Exit property" style="filled" fillcolor=red]; - } - 45 -> {46}; - 46 -> {47}; - 47 -> {63 57 52 48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {62}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {62}; - 57 -> {63 58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; + 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: IntegerLiteral(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 -> {47}; + 47 -> {63 57 52 48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {62}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {62}; + 57 -> {63 58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot index dd463f567ef..47b4b16de62 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/returnValuesFromLambda.dot @@ -1,56 +1,56 @@ digraph returnValuesFromLambda_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " style="filled" fillcolor=red]; } - 21 [label="Function call: R|kotlin/run|( = run@fun (): R|A| { + + 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|A| { when () { R|/b| -> { ^@run R|/B.B|() @@ -60,87 +60,87 @@ digraph returnValuesFromLambda_kt { 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"]; + 22 [label="Variable declaration: lval x: R|A|"]; + 23 [label="Exit function test_1" style="filled" fillcolor=red]; } - 30 [label="Function call: R|kotlin/run|( = run@fun (): R|C| { + + 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: ^test_3 Unit"]; - 36 [label="Stub" style="filled" fillcolor=gray]; - 37 [label="Exit function anonymousFunction" style="filled" fillcolor=gray]; + 31 [label="Variable declaration: lval x: R|C|"]; + 32 [label="Exit function test_2" style="filled" fillcolor=red]; } - 38 [label="Function call: R|kotlin/run|( = run@fun (): R|kotlin/Nothing| { + + 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: ^test_3 Unit"]; + 36 [label="Stub" style="filled" fillcolor=gray]; + 37 [label="Exit function anonymousFunction" style="filled" fillcolor=gray]; + } + 38 [label="Function call: R|kotlin/run|( = run@fun (): R|kotlin/Nothing| { ^test_3 Unit } )" style="filled" fillcolor=gray]; - 39 [label="Stub" style="filled" fillcolor=gray]; - 40 [label="Variable declaration: lval x: R|kotlin/Nothing|" style="filled" fillcolor=gray]; - 41 [label="Exit function test_3" style="filled" fillcolor=red]; - } + 39 [label="Stub" style="filled" fillcolor=gray]; + 40 [label="Variable declaration: lval x: R|kotlin/Nothing|" style="filled" fillcolor=gray]; + 41 [label="Exit function test_3" style="filled" fillcolor=red]; + } - 33 -> {34}; - 34 -> {35}; - 35 -> {41}; - 35 -> {36} [style=dotted]; - 36 -> {37} [style=dotted]; - 37 -> {38} [style=dotted]; - 38 -> {41 39} [style=dotted]; - 39 -> {40} [style=dotted]; - 40 -> {41} [style=dotted]; + 33 -> {34}; + 34 -> {35}; + 35 -> {41}; + 35 -> {36} [style=dotted]; + 36 -> {37} [style=dotted]; + 37 -> {38} [style=dotted]; + 38 -> {41 39} [style=dotted]; + 39 -> {40} [style=dotted]; + 40 -> {41} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot b/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot index 1691270772e..71b42b3c4f5 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/safeCalls.dot @@ -1,98 +1,98 @@ digraph safeCalls_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function bar" style="filled" fillcolor=red]; - 3 [label="Exit function bar" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function bar" style="filled" fillcolor=red]; + 3 [label="Exit function bar" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter function getter" style="filled" fillcolor=red]; - 5 [label="Exit function getter" style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; + } - 4 -> {5}; + 4 -> {5}; - subgraph cluster_3 { - color=red - 6 [label="Enter property" style="filled" fillcolor=red]; - 7 [label="Exit property" style="filled" fillcolor=red]; - } + subgraph cluster_3 { + color=red + 6 [label="Enter property" style="filled" fillcolor=red]; + 7 [label="Exit property" style="filled" fillcolor=red]; + } - 6 -> {7}; + 6 -> {7}; - subgraph cluster_4 { - color=red - 8 [label="Enter function getter" style="filled" fillcolor=red]; - 9 [label="Exit function getter" style="filled" fillcolor=red]; - } + subgraph cluster_4 { + color=red + 8 [label="Enter function getter" style="filled" fillcolor=red]; + 9 [label="Exit function getter" style="filled" fillcolor=red]; + } - 8 -> {9}; + 8 -> {9}; - subgraph cluster_5 { - color=red - 10 [label="Enter property" style="filled" fillcolor=red]; - 11 [label="Exit property" style="filled" fillcolor=red]; - } + subgraph cluster_5 { + color=red + 10 [label="Enter property" style="filled" fillcolor=red]; + 11 [label="Exit property" style="filled" fillcolor=red]; + } - 10 -> {11}; + 10 -> {11}; - subgraph cluster_6 { - color=red - 12 [label="Enter 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]; - } + subgraph cluster_6 { + color=red + 12 [label="Enter 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 16}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17 19}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; + 12 -> {13}; + 13 -> {14 16}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17 19}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; - subgraph cluster_7 { - color=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]; - } + subgraph cluster_7 { + color=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}; + 21 -> {22}; + 22 -> {23 25}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26 28}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/simple.dot b/compiler/fir/resolve/testData/resolve/cfg/simple.dot index f7fb7b5b0ae..96fcdc6904e 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/simple.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/simple.dot @@ -1,36 +1,36 @@ digraph simple_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=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]; - } + subgraph cluster_1 { + color=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}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot b/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot index 435ca36b5bc..98f767edc5a 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/tryCatch.dot @@ -1,306 +1,304 @@ digraph tryCatch_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Try expression enter"]; - subgraph cluster_2 { - color=blue - 2 [label="Try main block enter"]; - subgraph cluster_3 { - color=blue - 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="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="Enter block"]; - 16 [label="Const: Int(2)"]; - 17 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 18 [label="Exit block"]; - } - 19 [label="Catch exit"]; - } - 20 [label="Try expression exit"]; - } - 21 [label="Exit function test_1" style="filled" fillcolor=red]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {21 14 8 3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {20}; - 8 -> {21 9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {20}; - 14 -> {21 15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - - subgraph cluster_8 { - color=red - 22 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 23 [label="Try expression enter"]; - subgraph cluster_10 { - color=blue - 24 [label="Try main block enter"]; - subgraph cluster_11 { - color=blue - 25 [label="Enter block"]; - 26 [label="Const: Int(1)"]; - 27 [label="Exit block"]; - } - 28 [label="Try main block exit"]; - } - 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"]; - } - 35 [label="Variable declaration: lval x: R|kotlin/Int|"]; - 36 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 22 -> {23}; - 23 -> {24}; - 24 -> {36 29 25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {34}; - 29 -> {36 30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - - 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 { + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { color=blue - 44 [label="Try expression enter"]; - subgraph cluster_20 { - color=blue - 45 [label="Try main block enter"]; - subgraph cluster_21 { + 1 [label="Try expression enter"]; + subgraph cluster_2 { color=blue - 46 [label="Enter block"]; - subgraph cluster_22 { - color=blue - 47 [label="Enter when"]; - subgraph cluster_23 { + 2 [label="Try main block enter"]; + subgraph cluster_3 { 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"]; + 3 [label="Enter block"]; + 4 [label="Const: Int(1)"]; + 5 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 6 [label="Exit block"]; } - 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 { + 7 [label="Try main block exit"]; + } + subgraph cluster_4 { + color=blue + 8 [label="Catch enter"]; + subgraph cluster_5 { 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"]; + 9 [label="Enter block"]; + 10 [label="Const: Int(3)"]; + 11 [label="Variable declaration: lval z: R|kotlin/Int|"]; + 12 [label="Exit block"]; } - 74 [label="Exit block"]; - } - 75 [label="Try main block exit"]; + 13 [label="Catch exit"]; } - subgraph cluster_28 { - color=blue - 76 [label="Catch enter"]; - subgraph cluster_29 { + subgraph cluster_6 { 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]; + 14 [label="Catch enter"]; + subgraph cluster_7 { + color=blue + 15 [label="Enter block"]; + 16 [label="Const: Int(2)"]; + 17 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 18 [label="Exit block"]; + } + 19 [label="Catch exit"]; } - 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"]; + 20 [label="Try expression exit"]; } - 92 [label="Exit loop block"]; - } - 93 [label="Stub" style="filled" fillcolor=gray]; - 94 [label="Exit whileloop"]; + 21 [label="Exit function test_1" style="filled" fillcolor=red]; } - 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}; - 40 -> {41}; - 41 -> {42}; - 41 -> {93} [style=dotted]; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {97 82 76 46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {52 51}; - 51 -> {58}; - 52 -> {53}; - 53 -> {54}; - 54 -> {97}; - 54 -> {55} [style=dotted]; - 55 -> {56} [style=dotted]; - 56 -> {57} [style=dotted]; - 57 -> {58} [style=dotted]; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {67 66}; - 66 -> {73}; - 67 -> {68}; - 68 -> {69}; - 69 -> {94}; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; - 71 -> {72} [style=dotted]; - 72 -> {73} [style=dotted]; - 73 -> {74}; - 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 -> {87} [style=dotted]; - 87 -> {88} [style=dotted]; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {39}; - 93 -> {94} [style=dotted]; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; + 0 -> {1}; + 1 -> {2}; + 2 -> {21 14 8 3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {20}; + 8 -> {21 9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {20}; + 14 -> {21 15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + + subgraph cluster_8 { + color=red + 22 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 23 [label="Try expression enter"]; + subgraph cluster_10 { + color=blue + 24 [label="Try main block enter"]; + subgraph cluster_11 { + color=blue + 25 [label="Enter block"]; + 26 [label="Const: Int(1)"]; + 27 [label="Exit block"]; + } + 28 [label="Try main block exit"]; + } + 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"]; + } + 35 [label="Variable declaration: lval x: R|kotlin/Int|"]; + 36 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 22 -> {23}; + 23 -> {24}; + 24 -> {36 29 25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {34}; + 29 -> {36 30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + + 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="Exit whileloop"]; + } + 94 [label="Const: Int(3)"]; + 95 [label="Variable declaration: lval z: R|kotlin/Int|"]; + 96 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 41 -> {93} [style=dotted]; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {96 82 76 46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {52 51}; + 51 -> {58}; + 52 -> {53}; + 53 -> {54}; + 54 -> {96}; + 54 -> {55} [style=dotted]; + 55 -> {56} [style=dotted]; + 56 -> {57} [style=dotted]; + 57 -> {58} [style=dotted]; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {67 66}; + 66 -> {73}; + 67 -> {68}; + 68 -> {69}; + 69 -> {93}; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + 71 -> {72} [style=dotted]; + 72 -> {73} [style=dotted]; + 73 -> {74}; + 74 -> {75}; + 75 -> {88}; + 76 -> {96 77}; + 77 -> {78}; + 78 -> {93}; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {88} [style=dotted]; + 82 -> {96 83}; + 83 -> {84}; + 84 -> {38}; + 84 -> {85} [style=dotted]; + 85 -> {86} [style=dotted]; + 86 -> {87} [style=dotted]; + 87 -> {88} [style=dotted]; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {39}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; } diff --git a/compiler/fir/resolve/testData/resolve/cfg/when.dot b/compiler/fir/resolve/testData/resolve/cfg/when.dot index f789778ad5d..115780ab7cd 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/when.dot +++ b/compiler/fir/resolve/testData/resolve/cfg/when.dot @@ -1,190 +1,190 @@ digraph when_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 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"]; - } - 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"]; - } - 45 [label="Variable declaration: lval y: R|kotlin/Int|"]; - 46 [label="Exit function test_1" style="filled" fillcolor=red]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {39 7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {34 14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {28 21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {44}; - 28 -> {29}; - 29 -> {30}; - 30 -> {46}; - 30 -> {31} [style=dotted]; - 31 -> {32} [style=dotted]; - 32 -> {33} [style=dotted]; - 33 -> {44} [style=dotted]; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {44}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - - subgraph cluster_10 { - color=red - 47 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 48 [label="Enter when"]; - subgraph cluster_12 { - color=blue - 49 [label="Enter when branch condition "]; - subgraph cluster_13 { - color=blue - 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 &&"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; } - 58 [label="Exit when branch condition"]; - } - 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"]; + 45 [label="Variable declaration: lval y: R|kotlin/Int|"]; + 46 [label="Exit function test_1" 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 -> {57 54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {60 59}; - 59 -> {66}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {39 7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {34 14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {28 21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {44}; + 28 -> {29}; + 29 -> {30}; + 30 -> {46}; + 30 -> {31} [style=dotted]; + 31 -> {32} [style=dotted]; + 32 -> {33} [style=dotted]; + 33 -> {44} [style=dotted]; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {44}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + + subgraph cluster_10 { + color=red + 47 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 48 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 49 [label="Enter when branch condition "]; + subgraph cluster_13 { + color=blue + 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 &&"]; + } + 58 [label="Exit when branch condition"]; + } + 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"]; + } + 67 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {57 54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {60 59}; + 59 -> {66}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/anotherBoundSmartcasts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/anotherBoundSmartcasts.dot index d99d613c9b2..a1952a3cfbb 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/anotherBoundSmartcasts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/anotherBoundSmartcasts.dot @@ -1,463 +1,463 @@ digraph anotherBoundSmartcasts_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + 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 foo" style="filled" fillcolor=red]; - 3 [label="Const: Int(1)"]; - 4 [label="Jump: ^foo Int(1)"]; - 5 [label="Stub" style="filled" fillcolor=gray]; - 6 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 2 -> {3}; - 3 -> {4}; - 4 -> {6}; - 4 -> {5} [style=dotted]; - 5 -> {6} [style=dotted]; - - subgraph cluster_2 { - color=red - 7 [label="Enter function getter" style="filled" fillcolor=red]; - 8 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 7 -> {8}; - - subgraph cluster_3 { - color=red - 9 [label="Enter property" style="filled" fillcolor=red]; - 10 [label="Const: Int(1)"]; - 11 [label="Exit property" style="filled" fillcolor=red]; - } - - 9 -> {10}; - 10 -> {11}; - - subgraph cluster_4 { - color=red - 12 [label="Enter function bar" style="filled" fillcolor=red]; - 13 [label="Exit function bar" style="filled" fillcolor=red]; - } - - 12 -> {13}; - - subgraph cluster_5 { - color=red - 14 [label="Enter function test_1" style="filled" fillcolor=red]; - 15 [label="Access variable R|/a|"]; - 16 [label="Enter safe call"]; - 17 [label="Access variable R|/A.x|"]; - 18 [label="Exit safe call"]; - 19 [label="Variable declaration: lval x: R|kotlin/Int?|"]; - 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="Const: Null(null)"]; - 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|/a|"]; - 30 [label="Function call: R|/a|.R|/A.bar|()"]; - 31 [label="Exit block"]; - } - 32 [label="Exit when branch result"]; - 33 [label="Exit when"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " style="filled" fillcolor=red]; } - 34 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 14 -> {15}; - 15 -> {16 18}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {27 26}; - 26 -> {33}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; + 0 -> {1}; - subgraph cluster_9 { - color=red - 35 [label="Enter function test_2" style="filled" fillcolor=red]; - 36 [label="Access variable R|/a|"]; - 37 [label="Enter safe call"]; - 38 [label="Function call: R|/a|?.R|/A.foo|()"]; - 39 [label="Exit safe call"]; - 40 [label="Variable declaration: lval x: R|kotlin/Int?|"]; - subgraph cluster_10 { - color=blue - 41 [label="Enter when"]; - subgraph cluster_11 { - color=blue - 42 [label="Enter when branch condition "]; - 43 [label="Access variable R|/x|"]; - 44 [label="Const: Null(null)"]; - 45 [label="Operator !="]; - 46 [label="Exit when branch condition"]; - } - 47 [label="Synthetic else branch"]; - 48 [label="Enter when branch result"]; - subgraph cluster_12 { - color=blue - 49 [label="Enter block"]; - 50 [label="Access variable R|/a|"]; - 51 [label="Function call: R|/a|.R|/A.bar|()"]; - 52 [label="Exit block"]; - } - 53 [label="Exit when branch result"]; - 54 [label="Exit when"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Const: Int(1)"]; + 4 [label="Jump: ^foo Int(1)"]; + 5 [label="Stub" style="filled" fillcolor=gray]; + 6 [label="Exit function foo" style="filled" fillcolor=red]; } - 55 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 35 -> {36}; - 36 -> {37 39}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {48 47}; - 47 -> {54}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; + 2 -> {3}; + 3 -> {4}; + 4 -> {6}; + 4 -> {5} [style=dotted]; + 5 -> {6} [style=dotted]; - subgraph cluster_13 { - color=red - 56 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_14 { - color=blue - 57 [label="Enter when"]; - 58 [label="Access variable R|/x|"]; - 59 [label="Type operator: x as? A"]; - 60 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_15 { - color=blue - 61 [label="Enter when branch condition "]; - 62 [label="Const: Null(null)"]; - 63 [label="Operator =="]; - 64 [label="Exit when branch condition"]; - } - subgraph cluster_16 { - color=blue - 65 [label="Enter when branch condition else"]; - 66 [label="Exit when branch condition"]; - } - 67 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 68 [label="Enter block"]; - 69 [label="Access variable R|/|"]; - 70 [label="Exit block"]; - } - 71 [label="Exit when branch result"]; - 72 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 73 [label="Enter block"]; - 74 [label="Jump: ^test_3 Unit"]; - 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_2 { + color=red + 7 [label="Enter function getter" style="filled" fillcolor=red]; + 8 [label="Exit function getter" style="filled" fillcolor=red]; } - 79 [label="Variable declaration: lval a: R|A|"]; - 80 [label="Access variable R|/a|"]; - 81 [label="Function call: R|/a|.R|/A.foo|()"]; - 82 [label="Access variable R|/x|"]; - 83 [label="Function call: R|/x|.R|/A.foo|()"]; - 84 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {72 65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {78}; - 72 -> {73}; - 73 -> {74}; - 74 -> {84}; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; + 7 -> {8}; - subgraph cluster_19 { - color=red - 85 [label="Enter function foo" style="filled" fillcolor=red]; - 86 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 85 -> {86}; - - subgraph cluster_20 { - color=red - 87 [label="Enter function getter" style="filled" fillcolor=red]; - 88 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 87 -> {88}; - - subgraph cluster_21 { - color=red - 89 [label="Enter property" style="filled" fillcolor=red]; - 90 [label="Exit property" style="filled" fillcolor=red]; - } - - 89 -> {90}; - - subgraph cluster_22 { - color=red - 91 [label="Enter function bar" style="filled" fillcolor=red]; - 92 [label="Exit function bar" style="filled" fillcolor=red]; - } - - 91 -> {92}; - - subgraph cluster_23 { - color=red - 93 [label="Enter function test_1" style="filled" fillcolor=red]; - 94 [label="Access variable R|/a|"]; - 95 [label="Enter safe call"]; - 96 [label="Access variable R|/B.x|"]; - 97 [label="Exit safe call"]; - 98 [label="Variable declaration: lval x: R|kotlin/Int?|"]; - subgraph cluster_24 { - color=blue - 99 [label="Enter when"]; - subgraph cluster_25 { - color=blue - 100 [label="Enter when branch condition "]; - 101 [label="Access variable R|/x|"]; - 102 [label="Const: Null(null)"]; - 103 [label="Operator !="]; - 104 [label="Exit when branch condition"]; - } - 105 [label="Synthetic else branch"]; - 106 [label="Enter when branch result"]; - subgraph cluster_26 { - color=blue - 107 [label="Enter block"]; - 108 [label="Access variable R|/a|"]; - 109 [label="Function call: R|/a|.R|/B.bar|()"]; - 110 [label="Exit block"]; - } - 111 [label="Exit when branch result"]; - 112 [label="Exit when"]; + subgraph cluster_3 { + color=red + 9 [label="Enter property" style="filled" fillcolor=red]; + 10 [label="Const: Int(1)"]; + 11 [label="Exit property" style="filled" fillcolor=red]; } - 113 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 93 -> {94}; - 94 -> {95 97}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {106 105}; - 105 -> {112}; - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; + 9 -> {10}; + 10 -> {11}; - subgraph cluster_27 { - color=red - 114 [label="Enter function test_2" style="filled" fillcolor=red]; - 115 [label="Access variable R|/a|"]; - 116 [label="Enter safe call"]; - 117 [label="Function call: R|/a|?.R|/B.foo|()"]; - 118 [label="Exit safe call"]; - 119 [label="Variable declaration: lval x: R|kotlin/Int?|"]; - subgraph cluster_28 { - color=blue - 120 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 121 [label="Enter when branch condition "]; - 122 [label="Access variable R|/x|"]; - 123 [label="Const: Null(null)"]; - 124 [label="Operator !="]; - 125 [label="Exit when branch condition"]; - } - 126 [label="Synthetic else branch"]; - 127 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 128 [label="Enter block"]; - 129 [label="Access variable R|/a|"]; - 130 [label="Function call: R|/a|.R|/B.bar|()"]; - 131 [label="Exit block"]; - } - 132 [label="Exit when branch result"]; - 133 [label="Exit when"]; + subgraph cluster_4 { + color=red + 12 [label="Enter function bar" style="filled" fillcolor=red]; + 13 [label="Exit function bar" style="filled" fillcolor=red]; } - 134 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 114 -> {115}; - 115 -> {116 118}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {127 126}; - 126 -> {133}; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; + 12 -> {13}; - subgraph cluster_31 { - color=red - 135 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_32 { - color=blue - 136 [label="Enter when"]; - 137 [label="Access variable R|/x|"]; - 138 [label="Type operator: x as? B"]; - 139 [label="Variable declaration: lval : R|B?|"]; - subgraph cluster_33 { - color=blue - 140 [label="Enter when branch condition "]; - 141 [label="Const: Null(null)"]; - 142 [label="Operator =="]; - 143 [label="Exit when branch condition"]; - } - subgraph cluster_34 { - color=blue - 144 [label="Enter when branch condition else"]; - 145 [label="Exit when branch condition"]; - } - 146 [label="Enter when branch result"]; - subgraph cluster_35 { - color=blue - 147 [label="Enter block"]; - 148 [label="Access variable R|/|"]; - 149 [label="Exit block"]; - } - 150 [label="Exit when branch result"]; - 151 [label="Enter when branch result"]; - subgraph cluster_36 { - color=blue - 152 [label="Enter block"]; - 153 [label="Jump: ^test_3 Unit"]; - 154 [label="Stub" style="filled" fillcolor=gray]; - 155 [label="Exit block" style="filled" fillcolor=gray]; - } - 156 [label="Exit when branch result" style="filled" fillcolor=gray]; - 157 [label="Exit when"]; + subgraph cluster_5 { + color=red + 14 [label="Enter function test_1" style="filled" fillcolor=red]; + 15 [label="Access variable R|/a|"]; + 16 [label="Enter safe call"]; + 17 [label="Access variable R|/A.x|"]; + 18 [label="Exit safe call"]; + 19 [label="Variable declaration: lval x: R|kotlin/Int?|"]; + 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="Const: Null(null)"]; + 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|/a|"]; + 30 [label="Function call: R|/a|.R|/A.bar|()"]; + 31 [label="Exit block"]; + } + 32 [label="Exit when branch result"]; + 33 [label="Exit when"]; + } + 34 [label="Exit function test_1" style="filled" fillcolor=red]; } - 158 [label="Variable declaration: lval a: R|B|"]; - 159 [label="Access variable R|/a|"]; - 160 [label="Function call: R|/a|.R|/B.foo|()"]; - 161 [label="Access variable R|/x|"]; - 162 [label="Function call: R|/x|.R|/B.foo|()"]; - 163 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {141}; - 141 -> {142}; - 142 -> {143}; - 143 -> {151 144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {149}; - 149 -> {150}; - 150 -> {157}; - 151 -> {152}; - 152 -> {153}; - 153 -> {163}; - 153 -> {154} [style=dotted]; - 154 -> {155} [style=dotted]; - 155 -> {156} [style=dotted]; - 156 -> {157} [style=dotted]; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162}; - 162 -> {163}; + 14 -> {15}; + 15 -> {16 18}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {27 26}; + 26 -> {33}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + + subgraph cluster_9 { + color=red + 35 [label="Enter function test_2" style="filled" fillcolor=red]; + 36 [label="Access variable R|/a|"]; + 37 [label="Enter safe call"]; + 38 [label="Function call: R|/a|?.R|/A.foo|()"]; + 39 [label="Exit safe call"]; + 40 [label="Variable declaration: lval x: R|kotlin/Int?|"]; + subgraph cluster_10 { + color=blue + 41 [label="Enter when"]; + subgraph cluster_11 { + color=blue + 42 [label="Enter when branch condition "]; + 43 [label="Access variable R|/x|"]; + 44 [label="Const: Null(null)"]; + 45 [label="Operator !="]; + 46 [label="Exit when branch condition"]; + } + 47 [label="Synthetic else branch"]; + 48 [label="Enter when branch result"]; + subgraph cluster_12 { + color=blue + 49 [label="Enter block"]; + 50 [label="Access variable R|/a|"]; + 51 [label="Function call: R|/a|.R|/A.bar|()"]; + 52 [label="Exit block"]; + } + 53 [label="Exit when branch result"]; + 54 [label="Exit when"]; + } + 55 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 35 -> {36}; + 36 -> {37 39}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {48 47}; + 47 -> {54}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + + subgraph cluster_13 { + color=red + 56 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 57 [label="Enter when"]; + 58 [label="Access variable R|/x|"]; + 59 [label="Type operator: x as? A"]; + 60 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_15 { + color=blue + 61 [label="Enter when branch condition "]; + 62 [label="Const: Null(null)"]; + 63 [label="Operator =="]; + 64 [label="Exit when branch condition"]; + } + subgraph cluster_16 { + color=blue + 65 [label="Enter when branch condition else"]; + 66 [label="Exit when branch condition"]; + } + 67 [label="Enter when branch result"]; + subgraph cluster_17 { + color=blue + 68 [label="Enter block"]; + 69 [label="Access variable R|/|"]; + 70 [label="Exit block"]; + } + 71 [label="Exit when branch result"]; + 72 [label="Enter when branch result"]; + subgraph cluster_18 { + color=blue + 73 [label="Enter block"]; + 74 [label="Jump: ^test_3 Unit"]; + 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="Variable declaration: lval a: R|A|"]; + 80 [label="Access variable R|/a|"]; + 81 [label="Function call: R|/a|.R|/A.foo|()"]; + 82 [label="Access variable R|/x|"]; + 83 [label="Function call: R|/x|.R|/A.foo|()"]; + 84 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {72 65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {78}; + 72 -> {73}; + 73 -> {74}; + 74 -> {84}; + 74 -> {75} [style=dotted]; + 75 -> {76} [style=dotted]; + 76 -> {77} [style=dotted]; + 77 -> {78} [style=dotted]; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + + subgraph cluster_19 { + color=red + 85 [label="Enter function foo" style="filled" fillcolor=red]; + 86 [label="Exit function foo" style="filled" fillcolor=red]; + } + + 85 -> {86}; + + subgraph cluster_20 { + color=red + 87 [label="Enter function getter" style="filled" fillcolor=red]; + 88 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 87 -> {88}; + + subgraph cluster_21 { + color=red + 89 [label="Enter property" style="filled" fillcolor=red]; + 90 [label="Exit property" style="filled" fillcolor=red]; + } + + 89 -> {90}; + + subgraph cluster_22 { + color=red + 91 [label="Enter function bar" style="filled" fillcolor=red]; + 92 [label="Exit function bar" style="filled" fillcolor=red]; + } + + 91 -> {92}; + + subgraph cluster_23 { + color=red + 93 [label="Enter function test_1" style="filled" fillcolor=red]; + 94 [label="Access variable R|/a|"]; + 95 [label="Enter safe call"]; + 96 [label="Access variable R|/B.x|"]; + 97 [label="Exit safe call"]; + 98 [label="Variable declaration: lval x: R|kotlin/Int?|"]; + subgraph cluster_24 { + color=blue + 99 [label="Enter when"]; + subgraph cluster_25 { + color=blue + 100 [label="Enter when branch condition "]; + 101 [label="Access variable R|/x|"]; + 102 [label="Const: Null(null)"]; + 103 [label="Operator !="]; + 104 [label="Exit when branch condition"]; + } + 105 [label="Synthetic else branch"]; + 106 [label="Enter when branch result"]; + subgraph cluster_26 { + color=blue + 107 [label="Enter block"]; + 108 [label="Access variable R|/a|"]; + 109 [label="Function call: R|/a|.R|/B.bar|()"]; + 110 [label="Exit block"]; + } + 111 [label="Exit when branch result"]; + 112 [label="Exit when"]; + } + 113 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 93 -> {94}; + 94 -> {95 97}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {106 105}; + 105 -> {112}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + + subgraph cluster_27 { + color=red + 114 [label="Enter function test_2" style="filled" fillcolor=red]; + 115 [label="Access variable R|/a|"]; + 116 [label="Enter safe call"]; + 117 [label="Function call: R|/a|?.R|/B.foo|()"]; + 118 [label="Exit safe call"]; + 119 [label="Variable declaration: lval x: R|kotlin/Int?|"]; + subgraph cluster_28 { + color=blue + 120 [label="Enter when"]; + subgraph cluster_29 { + color=blue + 121 [label="Enter when branch condition "]; + 122 [label="Access variable R|/x|"]; + 123 [label="Const: Null(null)"]; + 124 [label="Operator !="]; + 125 [label="Exit when branch condition"]; + } + 126 [label="Synthetic else branch"]; + 127 [label="Enter when branch result"]; + subgraph cluster_30 { + color=blue + 128 [label="Enter block"]; + 129 [label="Access variable R|/a|"]; + 130 [label="Function call: R|/a|.R|/B.bar|()"]; + 131 [label="Exit block"]; + } + 132 [label="Exit when branch result"]; + 133 [label="Exit when"]; + } + 134 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 114 -> {115}; + 115 -> {116 118}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {127 126}; + 126 -> {133}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {132}; + 132 -> {133}; + 133 -> {134}; + + subgraph cluster_31 { + color=red + 135 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_32 { + color=blue + 136 [label="Enter when"]; + 137 [label="Access variable R|/x|"]; + 138 [label="Type operator: x as? B"]; + 139 [label="Variable declaration: lval : R|B?|"]; + subgraph cluster_33 { + color=blue + 140 [label="Enter when branch condition "]; + 141 [label="Const: Null(null)"]; + 142 [label="Operator =="]; + 143 [label="Exit when branch condition"]; + } + subgraph cluster_34 { + color=blue + 144 [label="Enter when branch condition else"]; + 145 [label="Exit when branch condition"]; + } + 146 [label="Enter when branch result"]; + subgraph cluster_35 { + color=blue + 147 [label="Enter block"]; + 148 [label="Access variable R|/|"]; + 149 [label="Exit block"]; + } + 150 [label="Exit when branch result"]; + 151 [label="Enter when branch result"]; + subgraph cluster_36 { + color=blue + 152 [label="Enter block"]; + 153 [label="Jump: ^test_3 Unit"]; + 154 [label="Stub" style="filled" fillcolor=gray]; + 155 [label="Exit block" style="filled" fillcolor=gray]; + } + 156 [label="Exit when branch result" style="filled" fillcolor=gray]; + 157 [label="Exit when"]; + } + 158 [label="Variable declaration: lval a: R|B|"]; + 159 [label="Access variable R|/a|"]; + 160 [label="Function call: R|/a|.R|/B.foo|()"]; + 161 [label="Access variable R|/x|"]; + 162 [label="Function call: R|/x|.R|/B.foo|()"]; + 163 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 135 -> {136}; + 136 -> {137}; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; + 143 -> {151 144}; + 144 -> {145}; + 145 -> {146}; + 146 -> {147}; + 147 -> {148}; + 148 -> {149}; + 149 -> {150}; + 150 -> {157}; + 151 -> {152}; + 152 -> {153}; + 153 -> {163}; + 153 -> {154} [style=dotted]; + 154 -> {155} [style=dotted]; + 155 -> {156} [style=dotted]; + 156 -> {157} [style=dotted]; + 157 -> {158}; + 158 -> {159}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162}; + 162 -> {163}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot b/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot index 0d104d9dcb2..a133bf031a4 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/bangbang.dot @@ -1,357 +1,357 @@ digraph bangbang_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function test_0" style="filled" fillcolor=red]; - 3 [label="Access variable R|/a|"]; - 4 [label="Check not null: R|/a|!!"]; - 5 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 6 [label="Access variable R|/a|"]; - 7 [label="Function call: R|/a|.R|/A.foo|()"]; - 8 [label="Exit function test_0" style="filled" fillcolor=red]; - } - - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - - subgraph cluster_2 { - color=red - 9 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 10 [label="Enter when"]; - subgraph cluster_4 { - color=blue - 11 [label="Enter when branch condition "]; - 12 [label="Access variable R|/a|"]; - 13 [label="Check not null: R|/a|!!"]; - 14 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 15 [label="Exit when branch condition"]; - } - 16 [label="Synthetic else branch"]; - 17 [label="Enter when branch result"]; - subgraph cluster_5 { - 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 when branch result"]; - 23 [label="Exit when"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - 24 [label="Access variable R|/a|"]; - 25 [label="Function call: R|/a|.R|/A.foo|()"]; - 26 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {17 16}; - 16 -> {23}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; + 0 -> {1}; - subgraph cluster_6 { - color=red - 27 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 28 [label="Enter when"]; - subgraph cluster_8 { - color=blue - 29 [label="Enter when branch condition "]; - subgraph cluster_9 { - color=blue - 30 [label="Enter &&"]; - 31 [label="Access variable R|/a|"]; - 32 [label="Check not null: R|/a|!!"]; - 33 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 34 [label="Exit left part of &&"]; - 35 [label="Enter right part of &&"]; - 36 [label="Access variable R|/b|"]; - 37 [label="Exit &&"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function test_0" style="filled" fillcolor=red]; + 3 [label="Access variable R|/a|"]; + 4 [label="Check not null: R|/a|!!"]; + 5 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 6 [label="Access variable R|/a|"]; + 7 [label="Function call: R|/a|.R|/A.foo|()"]; + 8 [label="Exit function test_0" style="filled" fillcolor=red]; + } + + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + + subgraph cluster_2 { + color=red + 9 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 10 [label="Enter when"]; + subgraph cluster_4 { + color=blue + 11 [label="Enter when branch condition "]; + 12 [label="Access variable R|/a|"]; + 13 [label="Check not null: R|/a|!!"]; + 14 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 15 [label="Exit when branch condition"]; + } + 16 [label="Synthetic else branch"]; + 17 [label="Enter when branch result"]; + subgraph cluster_5 { + 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 when branch result"]; + 23 [label="Exit when"]; } - 38 [label="Exit when branch condition"]; - } - 39 [label="Synthetic else branch"]; - 40 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 41 [label="Enter block"]; - 42 [label="Access variable R|/a|"]; - 43 [label="Function call: R|/a|.R|/A.foo|()"]; - 44 [label="Exit block"]; - } - 45 [label="Exit when branch result"]; - 46 [label="Exit when"]; + 24 [label="Access variable R|/a|"]; + 25 [label="Function call: R|/a|.R|/A.foo|()"]; + 26 [label="Exit function test_1" style="filled" fillcolor=red]; } - 47 [label="Access variable R|/a|"]; - 48 [label="Function call: R|/a|.R|/A.foo|()"]; - 49 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {37 35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {40 39}; - 39 -> {46}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {17 16}; + 16 -> {23}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; - subgraph cluster_11 { - color=red - 50 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 51 [label="Enter when"]; - subgraph cluster_13 { - color=blue - 52 [label="Enter when branch condition "]; - subgraph cluster_14 { - color=blue - 53 [label="Enter &&"]; - 54 [label="Access variable R|/b|"]; - 55 [label="Exit left part of &&"]; - 56 [label="Enter right part of &&"]; - 57 [label="Access variable R|/a|"]; - 58 [label="Check not null: R|/a|!!"]; - 59 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 60 [label="Exit &&"]; + subgraph cluster_6 { + color=red + 27 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 28 [label="Enter when"]; + subgraph cluster_8 { + color=blue + 29 [label="Enter when branch condition "]; + subgraph cluster_9 { + color=blue + 30 [label="Enter &&"]; + 31 [label="Access variable R|/a|"]; + 32 [label="Check not null: R|/a|!!"]; + 33 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 34 [label="Exit left part of &&"]; + 35 [label="Enter right part of &&"]; + 36 [label="Access variable R|/b|"]; + 37 [label="Exit &&"]; + } + 38 [label="Exit when branch condition"]; + } + 39 [label="Synthetic else branch"]; + 40 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 41 [label="Enter block"]; + 42 [label="Access variable R|/a|"]; + 43 [label="Function call: R|/a|.R|/A.foo|()"]; + 44 [label="Exit block"]; + } + 45 [label="Exit when branch result"]; + 46 [label="Exit when"]; } - 61 [label="Exit when branch condition"]; - } - 62 [label="Synthetic else branch"]; - 63 [label="Enter when branch result"]; - subgraph cluster_15 { - color=blue - 64 [label="Enter block"]; - 65 [label="Access variable R|/a|"]; - 66 [label="Function call: R|/a|.R|/A.foo|()"]; - 67 [label="Exit block"]; - } - 68 [label="Exit when branch result"]; - 69 [label="Exit when"]; + 47 [label="Access variable R|/a|"]; + 48 [label="Function call: R|/a|.R|/A.foo|()"]; + 49 [label="Exit function test_2" style="filled" fillcolor=red]; } - 70 [label="Access variable R|/a|"]; - 71 [label="Function call: R|/a|.#()"]; - 72 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {60 56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {63 62}; - 62 -> {69}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {37 35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {40 39}; + 39 -> {46}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; - subgraph cluster_16 { - color=red - 73 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_17 { - color=blue - 74 [label="Enter when"]; - subgraph cluster_18 { - color=blue - 75 [label="Enter when branch condition "]; - subgraph cluster_19 { - color=blue - 76 [label="Enter ||"]; - 77 [label="Access variable R|/a|"]; - 78 [label="Check not null: R|/a|!!"]; - 79 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 80 [label="Exit left part of ||"]; - 81 [label="Enter right part of ||"]; - 82 [label="Access variable R|/b|"]; - 83 [label="Exit ||"]; + subgraph cluster_11 { + color=red + 50 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 51 [label="Enter when"]; + subgraph cluster_13 { + color=blue + 52 [label="Enter when branch condition "]; + subgraph cluster_14 { + color=blue + 53 [label="Enter &&"]; + 54 [label="Access variable R|/b|"]; + 55 [label="Exit left part of &&"]; + 56 [label="Enter right part of &&"]; + 57 [label="Access variable R|/a|"]; + 58 [label="Check not null: R|/a|!!"]; + 59 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 60 [label="Exit &&"]; + } + 61 [label="Exit when branch condition"]; + } + 62 [label="Synthetic else branch"]; + 63 [label="Enter when branch result"]; + subgraph cluster_15 { + color=blue + 64 [label="Enter block"]; + 65 [label="Access variable R|/a|"]; + 66 [label="Function call: R|/a|.R|/A.foo|()"]; + 67 [label="Exit block"]; + } + 68 [label="Exit when branch result"]; + 69 [label="Exit when"]; } - 84 [label="Exit when branch condition"]; - } - 85 [label="Synthetic else branch"]; - 86 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 87 [label="Enter block"]; - 88 [label="Access variable R|/a|"]; - 89 [label="Function call: R|/a|.R|/A.foo|()"]; - 90 [label="Exit block"]; - } - 91 [label="Exit when branch result"]; - 92 [label="Exit when"]; + 70 [label="Access variable R|/a|"]; + 71 [label="Function call: R|/a|.#()"]; + 72 [label="Exit function test_3" style="filled" fillcolor=red]; } - 93 [label="Access variable R|/a|"]; - 94 [label="Function call: R|/a|.R|/A.foo|()"]; - 95 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {83 81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {86 85}; - 85 -> {92}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {60 56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {63 62}; + 62 -> {69}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; - subgraph cluster_21 { - color=red - 96 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 97 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 98 [label="Enter when branch condition "]; - subgraph cluster_24 { - color=blue - 99 [label="Enter ||"]; - 100 [label="Access variable R|/b|"]; - 101 [label="Exit left part of ||"]; - 102 [label="Enter right part of ||"]; - 103 [label="Access variable R|/a|"]; - 104 [label="Check not null: R|/a|!!"]; - 105 [label="Function call: R|/a|!!.R|/A.foo|()"]; - 106 [label="Exit ||"]; + subgraph cluster_16 { + color=red + 73 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_17 { + color=blue + 74 [label="Enter when"]; + subgraph cluster_18 { + color=blue + 75 [label="Enter when branch condition "]; + subgraph cluster_19 { + color=blue + 76 [label="Enter ||"]; + 77 [label="Access variable R|/a|"]; + 78 [label="Check not null: R|/a|!!"]; + 79 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 80 [label="Exit left part of ||"]; + 81 [label="Enter right part of ||"]; + 82 [label="Access variable R|/b|"]; + 83 [label="Exit ||"]; + } + 84 [label="Exit when branch condition"]; + } + 85 [label="Synthetic else branch"]; + 86 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 87 [label="Enter block"]; + 88 [label="Access variable R|/a|"]; + 89 [label="Function call: R|/a|.R|/A.foo|()"]; + 90 [label="Exit block"]; + } + 91 [label="Exit when branch result"]; + 92 [label="Exit when"]; } - 107 [label="Exit when branch condition"]; - } - 108 [label="Synthetic else branch"]; - 109 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 110 [label="Enter block"]; - 111 [label="Access variable R|/a|"]; - 112 [label="Function call: R|/a|.#()"]; - 113 [label="Exit block"]; - } - 114 [label="Exit when branch result"]; - 115 [label="Exit when"]; + 93 [label="Access variable R|/a|"]; + 94 [label="Function call: R|/a|.R|/A.foo|()"]; + 95 [label="Exit function test_4" style="filled" fillcolor=red]; } - 116 [label="Access variable R|/a|"]; - 117 [label="Function call: R|/a|.#()"]; - 118 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {106 102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {109 108}; - 108 -> {115}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {83 81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {86 85}; + 85 -> {92}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; - subgraph cluster_26 { - color=red - 119 [label="Enter function test_6" style="filled" fillcolor=red]; - 120 [label="Access variable R|/x|"]; - 121 [label="Check not null: R|/x|!!"]; - 122 [label="Function call: R|/x|!!.R|/A.foo|()"]; - 123 [label="Exit function test_6" style="filled" fillcolor=red]; - } + subgraph cluster_21 { + color=red + 96 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_22 { + color=blue + 97 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 98 [label="Enter when branch condition "]; + subgraph cluster_24 { + color=blue + 99 [label="Enter ||"]; + 100 [label="Access variable R|/b|"]; + 101 [label="Exit left part of ||"]; + 102 [label="Enter right part of ||"]; + 103 [label="Access variable R|/a|"]; + 104 [label="Check not null: R|/a|!!"]; + 105 [label="Function call: R|/a|!!.R|/A.foo|()"]; + 106 [label="Exit ||"]; + } + 107 [label="Exit when branch condition"]; + } + 108 [label="Synthetic else branch"]; + 109 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 110 [label="Enter block"]; + 111 [label="Access variable R|/a|"]; + 112 [label="Function call: R|/a|.#()"]; + 113 [label="Exit block"]; + } + 114 [label="Exit when branch result"]; + 115 [label="Exit when"]; + } + 116 [label="Access variable R|/a|"]; + 117 [label="Function call: R|/a|.#()"]; + 118 [label="Exit function test_5" style="filled" fillcolor=red]; + } - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {106 102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + 107 -> {109 108}; + 108 -> {115}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; - subgraph cluster_27 { - color=red - 124 [label="Enter function test_7" style="filled" fillcolor=red]; - 125 [label="Access variable R|/x|"]; - 126 [label="Check not null: R|/x|!!"]; - 127 [label="Function call: R|/x|!!.R|/A.foo|()"]; - 128 [label="Exit function test_7" style="filled" fillcolor=red]; - } + subgraph cluster_26 { + color=red + 119 [label="Enter function test_6" style="filled" fillcolor=red]; + 120 [label="Access variable R|/x|"]; + 121 [label="Check not null: R|/x|!!"]; + 122 [label="Function call: R|/x|!!.R|/A.foo|()"]; + 123 [label="Exit function test_6" style="filled" fillcolor=red]; + } - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; - 127 -> {128}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + + subgraph cluster_27 { + color=red + 124 [label="Enter function test_7" style="filled" fillcolor=red]; + 125 [label="Access variable R|/x|"]; + 126 [label="Check not null: R|/x|!!"]; + 127 [label="Function call: R|/x|!!.R|/A.foo|()"]; + 128 [label="Exit function test_7" style="filled" fillcolor=red]; + } + + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; + 127 -> {128}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot index f901a823488..6fa9c82bd68 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.dot @@ -1,503 +1,836 @@ digraph booleanOperators_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function bool" style="filled" fillcolor=red]; - 3 [label="Exit function bool" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function bool" style="filled" fillcolor=red]; + 3 [label="Exit function bool" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter function bar" style="filled" fillcolor=red]; - 5 [label="Exit function bar" style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter function bar" style="filled" fillcolor=red]; + 5 [label="Exit function bar" style="filled" fillcolor=red]; + } - 4 -> {5}; + 4 -> {5}; - subgraph cluster_3 { - color=red - 6 [label="Enter function baz" style="filled" fillcolor=red]; - 7 [label="Exit function baz" style="filled" fillcolor=red]; - } + subgraph cluster_3 { + color=red + 6 [label="Enter function baz" style="filled" fillcolor=red]; + 7 [label="Exit function baz" style="filled" fillcolor=red]; + } - 6 -> {7}; + 6 -> {7}; - subgraph cluster_4 { - color=red - 8 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_5 { - color=blue - 9 [label="Enter when"]; - subgraph cluster_6 { - color=blue - 10 [label="Enter when branch condition "]; - subgraph cluster_7 { - color=blue - 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 &&"]; + subgraph cluster_4 { + color=red + 8 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 9 [label="Enter when"]; + subgraph cluster_6 { + color=blue + 10 [label="Enter when branch condition "]; + subgraph cluster_7 { + color=blue + 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 &&"]; + } + 19 [label="Exit when branch condition"]; + } + 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"]; } - 19 [label="Exit when branch condition"]; - } - 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"]; + 32 [label="Exit function test_1" style="filled" fillcolor=red]; } - 32 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {18 15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {21 20}; - 20 -> {31}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {18 15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {21 20}; + 20 -> {31}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; - 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 "]; - subgraph cluster_12 { - color=blue - 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 ||"]; + 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 "]; + subgraph cluster_12 { + color=blue + 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 ||"]; + } + 44 [label="Exit when branch condition"]; + } + 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"]; } - 44 [label="Exit when branch condition"]; - } - 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"]; + 57 [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 -> {43 40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {46 45}; - 45 -> {56}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {43 40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {46 45}; + 45 -> {56}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; - 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}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {66 65}; - 65 -> {72}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - - 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 ||"]; + 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"]; } - 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"]; + 73 [label="Exit function test_3" style="filled" fillcolor=red]; } - 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}; - 79 -> {80}; - 80 -> {86 81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {89 88}; - 88 -> {95}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {66 65}; + 65 -> {72}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; - 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 ||"]; + 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"]; } - 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"]; + 96 [label="Access variable R|/x|"]; + 97 [label="Access variable #"]; + 98 [label="Exit function test_4" style="filled" fillcolor=red]; } - 119 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {109 107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {112 111}; - 111 -> {118}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {86 81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {89 88}; + 88 -> {95}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; - 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 ||"]; + 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="Type operator: x is A"]; + 105 [label="Exit left part of &&"]; + 106 [label="Enter right part of &&"]; + 107 [label="Access variable R|/x|"]; + 108 [label="Function call: R|/x|.R|/A.bool|()"]; + 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|.R|/A.foo|()"]; + 116 [label="Exit block"]; + } + 117 [label="Exit when branch result"]; + 118 [label="Exit when"]; } - 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"]; + 119 [label="Exit function test_5" style="filled" fillcolor=red]; } - 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}; - 129 -> {131}; - 130 -> {131} [style=dotted]; - 131 -> {132}; - 132 -> {134 133}; - 133 -> {140}; - 134 -> {135}; - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {141}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {109 106}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {112 111}; + 111 -> {118}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; - 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 &&"]; + 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 "]; + 123 [label="Access variable R|/x|"]; + 124 [label="Type operator: x !is A"]; + 125 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; + 126 [label="Exit when branch condition"]; + } + 127 [label="Synthetic else branch"]; + 128 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 129 [label="Enter block"]; + 130 [label="Access variable R|/x|"]; + 131 [label="Function call: R|/x|.R|/A.foo|()"]; + 132 [label="Exit block"]; + } + 133 [label="Exit when branch result"]; + 134 [label="Exit when"]; } - 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"]; + 135 [label="Exit function test_6" style="filled" fillcolor=red]; } - 162 [label="Exit function test_7" style="filled" fillcolor=red]; - } - 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {152 149}; - 149 -> {150}; - 150 -> {151}; - 151 -> {152}; - 152 -> {153}; - 153 -> {155 154}; - 154 -> {161}; - 155 -> {156}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {128 127}; + 127 -> {134}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {132}; + 132 -> {133}; + 133 -> {134}; + 134 -> {135}; - subgraph cluster_38 { - color=red - 163 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_39 { - color=blue - 164 [label="Enter when"]; - subgraph cluster_40 { - color=blue - 165 [label="Enter when branch condition "]; - 166 [label="Access variable R|/x|"]; - 167 [label="Type operator: x !is A"]; - 168 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; - 169 [label="Exit when branch condition"]; - } - 170 [label="Synthetic else branch"]; - 171 [label="Enter when branch result"]; - subgraph cluster_41 { - color=blue - 172 [label="Enter block"]; - 173 [label="Access variable R|/x|"]; - 174 [label="Function call: R|/x|.R|/A.foo|()"]; - 175 [label="Exit block"]; - } - 176 [label="Exit when branch result"]; - 177 [label="Exit when"]; + subgraph cluster_32 { + color=red + 136 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_33 { + color=blue + 137 [label="Enter when"]; + subgraph cluster_34 { + color=blue + 138 [label="Enter when branch condition "]; + subgraph cluster_35 { + color=blue + 139 [label="Enter ||"]; + 140 [label="Access variable R|/x|"]; + 141 [label="Type operator: x is A"]; + 142 [label="Exit left part of ||"]; + 143 [label="Enter right part of ||"]; + 144 [label="Const: Boolean(false)"]; + 145 [label="Exit ||"]; + } + 146 [label="Exit when branch condition"]; + } + 147 [label="Synthetic else branch"]; + 148 [label="Enter when branch result"]; + subgraph cluster_36 { + color=blue + 149 [label="Enter block"]; + 150 [label="Access variable R|/x|"]; + 151 [label="Function call: R|/x|.#()"]; + 152 [label="Exit block"]; + } + 153 [label="Exit when branch result"]; + 154 [label="Exit when"]; + } + 155 [label="Exit function test_7" style="filled" fillcolor=red]; } - 178 [label="Exit function test_8" style="filled" fillcolor=red]; - } - 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - 166 -> {167}; - 167 -> {168}; - 168 -> {169}; - 169 -> {171 170}; - 170 -> {177}; - 171 -> {172}; - 172 -> {173}; - 173 -> {174}; - 174 -> {175}; - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; + 136 -> {137}; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {145 143}; + 143 -> {144}; + 144 -> {145}; + 145 -> {146}; + 146 -> {148 147}; + 147 -> {154}; + 148 -> {149}; + 149 -> {150}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + + subgraph cluster_37 { + color=red + 156 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_38 { + color=blue + 157 [label="Enter when"]; + subgraph cluster_39 { + color=blue + 158 [label="Enter when branch condition "]; + subgraph cluster_40 { + color=blue + 159 [label="Enter ||"]; + 160 [label="Const: Boolean(false)"]; + 161 [label="Exit left part of ||"]; + 162 [label="Enter right part of ||"]; + 163 [label="Access variable R|/x|"]; + 164 [label="Type operator: x is A"]; + 165 [label="Exit ||"]; + } + 166 [label="Exit when branch condition"]; + } + 167 [label="Synthetic else branch"]; + 168 [label="Enter when branch result"]; + subgraph cluster_41 { + color=blue + 169 [label="Enter block"]; + 170 [label="Access variable R|/x|"]; + 171 [label="Function call: R|/x|.#()"]; + 172 [label="Exit block"]; + } + 173 [label="Exit when branch result"]; + 174 [label="Exit when"]; + } + 175 [label="Exit function test_8" style="filled" fillcolor=red]; + } + + 156 -> {157}; + 157 -> {158}; + 158 -> {159}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162}; + 161 -> {165} [style=dotted]; + 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}; + + subgraph cluster_42 { + color=red + 176 [label="Enter function test_9" style="filled" fillcolor=red]; + subgraph cluster_43 { + color=blue + 177 [label="Enter when"]; + subgraph cluster_44 { + color=blue + 178 [label="Enter when branch condition "]; + subgraph cluster_45 { + color=blue + 179 [label="Enter ||"]; + 180 [label="Access variable R|/x|"]; + 181 [label="Type operator: x is A"]; + 182 [label="Exit left part of ||"]; + 183 [label="Enter right part of ||"]; + 184 [label="Const: Boolean(true)"]; + 185 [label="Exit ||"]; + } + 186 [label="Exit when branch condition"]; + } + 187 [label="Synthetic else branch"]; + 188 [label="Enter when branch result"]; + subgraph cluster_46 { + color=blue + 189 [label="Enter block"]; + 190 [label="Access variable R|/x|"]; + 191 [label="Function call: R|/x|.#()"]; + 192 [label="Exit block"]; + } + 193 [label="Exit when branch result"]; + 194 [label="Exit when"]; + } + 195 [label="Exit function test_9" style="filled" fillcolor=red]; + } + + 176 -> {177}; + 177 -> {178}; + 178 -> {179}; + 179 -> {180}; + 180 -> {181}; + 181 -> {182}; + 182 -> {185 183}; + 183 -> {184}; + 184 -> {185}; + 185 -> {186}; + 186 -> {188 187}; + 187 -> {194}; + 188 -> {189}; + 189 -> {190}; + 190 -> {191}; + 191 -> {192}; + 192 -> {193}; + 193 -> {194}; + 194 -> {195}; + + subgraph cluster_47 { + color=red + 196 [label="Enter function test_10" style="filled" fillcolor=red]; + subgraph cluster_48 { + color=blue + 197 [label="Enter when"]; + subgraph cluster_49 { + color=blue + 198 [label="Enter when branch condition "]; + subgraph cluster_50 { + color=blue + 199 [label="Enter ||"]; + 200 [label="Const: Boolean(true)"]; + 201 [label="Exit left part of ||"]; + 202 [label="Enter right part of ||" style="filled" fillcolor=gray]; + 203 [label="Access variable R|/x|" style="filled" fillcolor=gray]; + 204 [label="Type operator: x is A" style="filled" fillcolor=gray]; + 205 [label="Exit ||"]; + } + 206 [label="Exit when branch condition"]; + } + 207 [label="Synthetic else branch"]; + 208 [label="Enter when branch result"]; + subgraph cluster_51 { + color=blue + 209 [label="Enter block"]; + 210 [label="Access variable R|/x|"]; + 211 [label="Function call: R|/x|.#()"]; + 212 [label="Exit block"]; + } + 213 [label="Exit when branch result"]; + 214 [label="Exit when"]; + } + 215 [label="Exit function test_10" style="filled" fillcolor=red]; + } + + 196 -> {197}; + 197 -> {198}; + 198 -> {199}; + 199 -> {200}; + 200 -> {201}; + 201 -> {205}; + 201 -> {202} [style=dotted]; + 202 -> {203} [style=dotted]; + 203 -> {204} [style=dotted]; + 204 -> {205} [style=dotted]; + 205 -> {206}; + 206 -> {208 207}; + 207 -> {214}; + 208 -> {209}; + 209 -> {210}; + 210 -> {211}; + 211 -> {212}; + 212 -> {213}; + 213 -> {214}; + 214 -> {215}; + + subgraph cluster_52 { + color=red + 216 [label="Enter function test_11" style="filled" fillcolor=red]; + subgraph cluster_53 { + color=blue + 217 [label="Enter when"]; + subgraph cluster_54 { + color=blue + 218 [label="Enter when branch condition "]; + subgraph cluster_55 { + color=blue + 219 [label="Enter &&"]; + 220 [label="Const: Boolean(false)"]; + 221 [label="Exit left part of &&"]; + 222 [label="Enter right part of &&" style="filled" fillcolor=gray]; + 223 [label="Access variable R|/x|" style="filled" fillcolor=gray]; + 224 [label="Type operator: x is A" style="filled" fillcolor=gray]; + 225 [label="Exit &&"]; + } + 226 [label="Exit when branch condition"]; + } + 227 [label="Synthetic else branch"]; + 228 [label="Enter when branch result"]; + subgraph cluster_56 { + color=blue + 229 [label="Enter block"]; + 230 [label="Access variable R|/x|"]; + 231 [label="Function call: R|/x|.R|/A.foo|()"]; + 232 [label="Exit block"]; + } + 233 [label="Exit when branch result"]; + 234 [label="Exit when"]; + } + 235 [label="Exit function test_11" style="filled" fillcolor=red]; + } + + 216 -> {217}; + 217 -> {218}; + 218 -> {219}; + 219 -> {220}; + 220 -> {221}; + 221 -> {225}; + 221 -> {222} [style=dotted]; + 222 -> {223} [style=dotted]; + 223 -> {224} [style=dotted]; + 224 -> {225} [style=dotted]; + 225 -> {226}; + 226 -> {228 227}; + 227 -> {234}; + 228 -> {229}; + 229 -> {230}; + 230 -> {231}; + 231 -> {232}; + 232 -> {233}; + 233 -> {234}; + 234 -> {235}; + + subgraph cluster_57 { + color=red + 236 [label="Enter function test_12" style="filled" fillcolor=red]; + subgraph cluster_58 { + color=blue + 237 [label="Enter when"]; + subgraph cluster_59 { + color=blue + 238 [label="Enter when branch condition "]; + subgraph cluster_60 { + color=blue + 239 [label="Enter &&"]; + 240 [label="Access variable R|/x|"]; + 241 [label="Type operator: x is A"]; + 242 [label="Exit left part of &&"]; + 243 [label="Enter right part of &&"]; + 244 [label="Const: Boolean(false)"]; + 245 [label="Exit &&"]; + } + 246 [label="Exit when branch condition"]; + } + 247 [label="Synthetic else branch"]; + 248 [label="Enter when branch result"]; + subgraph cluster_61 { + color=blue + 249 [label="Enter block"]; + 250 [label="Access variable R|/x|"]; + 251 [label="Function call: R|/x|.R|/A.foo|()"]; + 252 [label="Exit block"]; + } + 253 [label="Exit when branch result"]; + 254 [label="Exit when"]; + } + 255 [label="Exit function test_12" style="filled" fillcolor=red]; + } + + 236 -> {237}; + 237 -> {238}; + 238 -> {239}; + 239 -> {240}; + 240 -> {241}; + 241 -> {242}; + 242 -> {245 243}; + 243 -> {244}; + 244 -> {245}; + 245 -> {246}; + 246 -> {248 247}; + 247 -> {254}; + 248 -> {249}; + 249 -> {250}; + 250 -> {251}; + 251 -> {252}; + 252 -> {253}; + 253 -> {254}; + 254 -> {255}; + + subgraph cluster_62 { + color=red + 256 [label="Enter function test_13" style="filled" fillcolor=red]; + subgraph cluster_63 { + color=blue + 257 [label="Enter when"]; + subgraph cluster_64 { + color=blue + 258 [label="Enter when branch condition "]; + subgraph cluster_65 { + color=blue + 259 [label="Enter &&"]; + 260 [label="Const: Boolean(true)"]; + 261 [label="Exit left part of &&"]; + 262 [label="Enter right part of &&"]; + 263 [label="Access variable R|/x|"]; + 264 [label="Type operator: x is A"]; + 265 [label="Exit &&"]; + } + 266 [label="Exit when branch condition"]; + } + 267 [label="Synthetic else branch"]; + 268 [label="Enter when branch result"]; + subgraph cluster_66 { + color=blue + 269 [label="Enter block"]; + 270 [label="Access variable R|/x|"]; + 271 [label="Function call: R|/x|.R|/A.foo|()"]; + 272 [label="Exit block"]; + } + 273 [label="Exit when branch result"]; + 274 [label="Exit when"]; + } + 275 [label="Exit function test_13" style="filled" fillcolor=red]; + } + + 256 -> {257}; + 257 -> {258}; + 258 -> {259}; + 259 -> {260}; + 260 -> {261}; + 261 -> {262}; + 261 -> {265} [style=dotted]; + 262 -> {263}; + 263 -> {264}; + 264 -> {265}; + 265 -> {266}; + 266 -> {268 267}; + 267 -> {274}; + 268 -> {269}; + 269 -> {270}; + 270 -> {271}; + 271 -> {272}; + 272 -> {273}; + 273 -> {274}; + 274 -> {275}; + + subgraph cluster_67 { + color=red + 276 [label="Enter function test_14" style="filled" fillcolor=red]; + subgraph cluster_68 { + color=blue + 277 [label="Enter when"]; + subgraph cluster_69 { + color=blue + 278 [label="Enter when branch condition "]; + subgraph cluster_70 { + color=blue + 279 [label="Enter &&"]; + 280 [label="Access variable R|/x|"]; + 281 [label="Type operator: x is A"]; + 282 [label="Exit left part of &&"]; + 283 [label="Enter right part of &&"]; + 284 [label="Const: Boolean(false)"]; + 285 [label="Exit &&"]; + } + 286 [label="Exit when branch condition"]; + } + 287 [label="Synthetic else branch"]; + 288 [label="Enter when branch result"]; + subgraph cluster_71 { + color=blue + 289 [label="Enter block"]; + 290 [label="Access variable R|/x|"]; + 291 [label="Function call: R|/x|.R|/A.foo|()"]; + 292 [label="Exit block"]; + } + 293 [label="Exit when branch result"]; + 294 [label="Exit when"]; + } + 295 [label="Exit function test_14" style="filled" fillcolor=red]; + } + + 276 -> {277}; + 277 -> {278}; + 278 -> {279}; + 279 -> {280}; + 280 -> {281}; + 281 -> {282}; + 282 -> {285 283}; + 283 -> {284}; + 284 -> {285}; + 285 -> {286}; + 286 -> {288 287}; + 287 -> {294}; + 288 -> {289}; + 289 -> {290}; + 290 -> {291}; + 291 -> {292}; + 292 -> {293}; + 293 -> {294}; + 294 -> {295}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt index 8b1a8978f2e..c77cf53627f 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.kt @@ -41,26 +41,68 @@ fun test_4(x: Any) { x.length } -fun test_5(x: A?) { - if (x != null || false) { - x.foo() - } -} - -fun test_6(x: A?) { - if (false || x != null) { - x.foo() - } -} - -fun test_7(x: Any) { +fun test_5(x: Any) { if (x is A && x.bool()) { x.foo() } } -fun test_8(x: Any) { +fun test_6(x: Any) { if ((x !is A).not()) { x.foo() } -} \ No newline at end of file +} + +// || and const + +fun test_7(x: Any) { + if (x is A || false) { + // TODO: should be smartcast + x.foo() + } +} + +fun test_8(x: Any) { + if (false || x is A) { + // TODO: should be smartcast + x.foo() + } +} + +fun test_9(x: Any) { + if (x is A || true) { + x.foo() + } +} + +fun test_10(x: Any) { + if (true || x is A) { + x.foo() + } +} + +// && and const + +fun test_11(x: Any, b: Boolean) { + if (false && x is A) { + x.foo() + } +} + +fun test_12(x: Any, b: Boolean) { + if (x is A && false) { + x.foo() + } +} + +fun test_13(x: Any, b: Boolean) { + if (true && x is A) { + x.foo() + } +} + +fun test_14(x: Any, b: Boolean) { + if (x is A && false) { + x.foo() + } +} diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.txt b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.txt index 5a415532983..9c49017c6e3 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.txt +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators.txt @@ -50,23 +50,7 @@ FILE: booleanOperators.kt R|/x|.# } - public final fun test_5(x: R|A?|): R|kotlin/Unit| { - when () { - !=(R|/x|, Null(null)) || Boolean(false) -> { - R|/x|.#() - } - } - - } - public final fun test_6(x: R|A?|): R|kotlin/Unit| { - when () { - Boolean(false) || !=(R|/x|, Null(null)) -> { - R|/x|.#() - } - } - - } - public final fun test_7(x: R|kotlin/Any|): R|kotlin/Unit| { + public final fun test_5(x: R|kotlin/Any|): R|kotlin/Unit| { when () { (R|/x| is R|A|) && R|/x|.R|/A.bool|() -> { R|/x|.R|/A.foo|() @@ -74,7 +58,7 @@ FILE: booleanOperators.kt } } - public final fun test_8(x: R|kotlin/Any|): R|kotlin/Unit| { + public final fun test_6(x: R|kotlin/Any|): R|kotlin/Unit| { when () { (R|/x| !is R|A|).R|kotlin/Boolean.not|() -> { R|/x|.R|/A.foo|() @@ -82,3 +66,67 @@ FILE: booleanOperators.kt } } + public final fun test_7(x: R|kotlin/Any|): R|kotlin/Unit| { + when () { + (R|/x| is R|A|) || Boolean(false) -> { + R|/x|.#() + } + } + + } + public final fun test_8(x: R|kotlin/Any|): R|kotlin/Unit| { + when () { + Boolean(false) || (R|/x| is R|A|) -> { + R|/x|.#() + } + } + + } + public final fun test_9(x: R|kotlin/Any|): R|kotlin/Unit| { + when () { + (R|/x| is R|A|) || Boolean(true) -> { + R|/x|.#() + } + } + + } + public final fun test_10(x: R|kotlin/Any|): R|kotlin/Unit| { + when () { + Boolean(true) || (R|/x| is R|A|) -> { + R|/x|.#() + } + } + + } + public final fun test_11(x: R|kotlin/Any|, b: R|kotlin/Boolean|): R|kotlin/Unit| { + when () { + Boolean(false) && (R|/x| is R|A|) -> { + R|/x|.R|/A.foo|() + } + } + + } + public final fun test_12(x: R|kotlin/Any|, b: R|kotlin/Boolean|): R|kotlin/Unit| { + when () { + (R|/x| is R|A|) && Boolean(false) -> { + R|/x|.R|/A.foo|() + } + } + + } + public final fun test_13(x: R|kotlin/Any|, b: R|kotlin/Boolean|): R|kotlin/Unit| { + when () { + Boolean(true) && (R|/x| is R|A|) -> { + R|/x|.R|/A.foo|() + } + } + + } + public final fun test_14(x: R|kotlin/Any|, b: R|kotlin/Boolean|): R|kotlin/Unit| { + when () { + (R|/x| is R|A|) && Boolean(false) -> { + R|/x|.R|/A.foo|() + } + } + + } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators_0.dot b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators_0.dot new file mode 100644 index 00000000000..f901a823488 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/smartcasts/booleanOperators_0.dot @@ -0,0 +1,503 @@ +digraph booleanOperators_kt { + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] + + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } + + 0 -> {1}; + + subgraph cluster_1 { + color=red + 2 [label="Enter function bool" style="filled" fillcolor=red]; + 3 [label="Exit function bool" style="filled" fillcolor=red]; + } + + 2 -> {3}; + + subgraph cluster_2 { + color=red + 4 [label="Enter function bar" style="filled" fillcolor=red]; + 5 [label="Exit function bar" style="filled" fillcolor=red]; + } + + 4 -> {5}; + + subgraph cluster_3 { + color=red + 6 [label="Enter function baz" style="filled" fillcolor=red]; + 7 [label="Exit function baz" style="filled" fillcolor=red]; + } + + 6 -> {7}; + + subgraph cluster_4 { + color=red + 8 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_5 { + color=blue + 9 [label="Enter when"]; + subgraph cluster_6 { + color=blue + 10 [label="Enter when branch condition "]; + subgraph cluster_7 { + color=blue + 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 &&"]; + } + 19 [label="Exit when branch condition"]; + } + 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"]; + } + 32 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {18 15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {21 20}; + 20 -> {31}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + + 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 "]; + subgraph cluster_12 { + color=blue + 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 ||"]; + } + 44 [label="Exit when branch condition"]; + } + 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"]; + } + 57 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {43 40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {46 45}; + 45 -> {56}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + + 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}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {66 65}; + 65 -> {72}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + + 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}; + 79 -> {80}; + 80 -> {86 81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {89 88}; + 88 -> {95}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + + 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}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {109 107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {112 111}; + 111 -> {118}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + + 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}; + 129 -> {131}; + 130 -> {131} [style=dotted]; + 131 -> {132}; + 132 -> {134 133}; + 133 -> {140}; + 134 -> {135}; + 135 -> {136}; + 136 -> {137}; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 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 -> {144}; + 144 -> {145}; + 145 -> {146}; + 146 -> {147}; + 147 -> {148}; + 148 -> {152 149}; + 149 -> {150}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {155 154}; + 154 -> {161}; + 155 -> {156}; + 156 -> {157}; + 157 -> {158}; + 158 -> {159}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162}; + + subgraph cluster_38 { + color=red + 163 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_39 { + color=blue + 164 [label="Enter when"]; + subgraph cluster_40 { + color=blue + 165 [label="Enter when branch condition "]; + 166 [label="Access variable R|/x|"]; + 167 [label="Type operator: x !is A"]; + 168 [label="Function call: (R|/x| !is R|A|).R|kotlin/Boolean.not|()"]; + 169 [label="Exit when branch condition"]; + } + 170 [label="Synthetic else branch"]; + 171 [label="Enter when branch result"]; + subgraph cluster_41 { + color=blue + 172 [label="Enter block"]; + 173 [label="Access variable R|/x|"]; + 174 [label="Function call: R|/x|.R|/A.foo|()"]; + 175 [label="Exit block"]; + } + 176 [label="Exit when branch result"]; + 177 [label="Exit when"]; + } + 178 [label="Exit function test_8" style="filled" fillcolor=red]; + } + + 163 -> {164}; + 164 -> {165}; + 165 -> {166}; + 166 -> {167}; + 167 -> {168}; + 168 -> {169}; + 169 -> {171 170}; + 170 -> {177}; + 171 -> {172}; + 172 -> {173}; + 173 -> {174}; + 174 -> {175}; + 175 -> {176}; + 176 -> {177}; + 177 -> {178}; + +} diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot index c312defece1..68640b0a970 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/boundSmartcasts.dot @@ -1,281 +1,281 @@ digraph boundSmartcasts_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function bar" style="filled" fillcolor=red]; - 3 [label="Exit function bar" style="filled" fillcolor=red]; - } - - 2 -> {3}; - - 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 - 7 [label="Enter when"]; - subgraph cluster_4 { - color=blue - 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"]; - } - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - 22 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {13 12}; - 12 -> {21}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; + 0 -> {1}; - subgraph cluster_6 { - color=red - 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 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 - 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"]; - } - 39 [label="Exit when branch result"]; - 40 [label="Exit when"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function bar" style="filled" fillcolor=red]; + 3 [label="Exit function bar" 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 -> {32 31}; - 31 -> {40}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; + 2 -> {3}; - 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"]; + 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 + 7 [label="Enter when"]; + subgraph cluster_4 { + color=blue + 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"]; + } + 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"]; + } + 22 [label="Exit function test_1" style="filled" fillcolor=red]; } - 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="Access variable R|/z|"]; - 71 [label="Function call: R|/z|.R|/B.bar|()"]; - 72 [label="Exit block"]; - } - 73 [label="Exit when branch result"]; - 74 [label="Exit when"]; + + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {13 12}; + 12 -> {21}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + + subgraph cluster_6 { + color=red + 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 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 + 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"]; + } + 39 [label="Exit when branch result"]; + 40 [label="Exit when"]; + } + 41 [label="Exit function test_2" style="filled" fillcolor=red]; } - 75 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {51 50}; - 50 -> {57}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {66 65}; - 65 -> {74}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {32 31}; + 31 -> {40}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; - subgraph cluster_17 { - color=red - 76 [label="Enter function test_4" style="filled" fillcolor=red]; - 77 [label="Const: Int(1)"]; - 78 [label="Variable declaration: lvar x: R|kotlin/Any|"]; - 79 [label="Access variable R|/x|"]; - 80 [label="Type operator: x as Int"]; - 81 [label="Access variable R|/x|"]; - 82 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; - 83 [label="Access variable R|/y|"]; - 84 [label="Assignmenet: R|/x|"]; - 85 [label="Access variable R|/x|"]; - 86 [label="Function call: R|/x|.#()"]; - subgraph cluster_18 { - color=blue - 87 [label="Enter when"]; - subgraph cluster_19 { - color=blue - 88 [label="Enter when branch condition "]; - 89 [label="Access variable R|/y|"]; - 90 [label="Type operator: y is A"]; - 91 [label="Exit when branch condition"]; - } - 92 [label="Synthetic else branch"]; - 93 [label="Enter when branch result"]; - subgraph cluster_20 { - color=blue - 94 [label="Enter block"]; - 95 [label="Access variable R|/x|"]; - 96 [label="Function call: R|/x|.R|/A.foo|()"]; - 97 [label="Access variable R|/y|"]; - 98 [label="Function call: R|/y|.R|/A.foo|()"]; - 99 [label="Exit block"]; - } - 100 [label="Exit when branch result"]; - 101 [label="Exit when"]; + 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="Access variable R|/z|"]; + 71 [label="Function call: R|/z|.R|/B.bar|()"]; + 72 [label="Exit block"]; + } + 73 [label="Exit when branch result"]; + 74 [label="Exit when"]; + } + 75 [label="Exit function test_3" style="filled" fillcolor=red]; } - 102 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {93 92}; - 92 -> {101}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {51 50}; + 50 -> {57}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {66 65}; + 65 -> {74}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + + subgraph cluster_17 { + color=red + 76 [label="Enter function test_4" style="filled" fillcolor=red]; + 77 [label="Const: Int(1)"]; + 78 [label="Variable declaration: lvar x: R|kotlin/Any|"]; + 79 [label="Access variable R|/x|"]; + 80 [label="Type operator: x as Int"]; + 81 [label="Access variable R|/x|"]; + 82 [label="Function call: R|/x|.R|kotlin/Int.inc|()"]; + 83 [label="Access variable R|/y|"]; + 84 [label="Assignmenet: R|/x|"]; + 85 [label="Access variable R|/x|"]; + 86 [label="Function call: R|/x|.#()"]; + subgraph cluster_18 { + color=blue + 87 [label="Enter when"]; + subgraph cluster_19 { + color=blue + 88 [label="Enter when branch condition "]; + 89 [label="Access variable R|/y|"]; + 90 [label="Type operator: y is A"]; + 91 [label="Exit when branch condition"]; + } + 92 [label="Synthetic else branch"]; + 93 [label="Enter when branch result"]; + subgraph cluster_20 { + color=blue + 94 [label="Enter block"]; + 95 [label="Access variable R|/x|"]; + 96 [label="Function call: R|/x|.R|/A.foo|()"]; + 97 [label="Access variable R|/y|"]; + 98 [label="Function call: R|/y|.R|/A.foo|()"]; + 99 [label="Exit block"]; + } + 100 [label="Exit when branch result"]; + 101 [label="Exit when"]; + } + 102 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {93 92}; + 92 -> {101}; + 93 -> {94}; + 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/casts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot index 09795bc450b..491d09a6a47 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/casts.dot @@ -1,371 +1,371 @@ digraph casts_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - 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 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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - - subgraph cluster_1 { - color=red - 6 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 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 - 14 [label="Enter block"]; - 15 [label="Access variable R|/x|"]; - 16 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; - 17 [label="Exit block"]; - } - 18 [label="Exit when branch result"]; - 19 [label="Exit when"]; + 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 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]; } - 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 -> {13 12}; - 12 -> {19}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; - 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 &&"]; + subgraph cluster_1 { + color=red + 6 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 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 + 14 [label="Enter block"]; + 15 [label="Access variable R|/x|"]; + 16 [label="Function call: R|/x|.R|kotlin/Boolean.not|()"]; + 17 [label="Exit block"]; + } + 18 [label="Exit when branch result"]; + 19 [label="Exit when"]; } - 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"]; + 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]; } - 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 &&"]; + + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {13 12}; + 12 -> {19}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + + 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"]; } - 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 ||"]; + 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"]; } - 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"]; + 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]; } - 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}; - 26 -> {27}; - 27 -> {28}; - 28 -> {32 29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 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}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {54 49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {57 56}; - 56 -> {63}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {74 71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {77 76}; - 76 -> {83}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {32 29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 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}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {54 49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {57 56}; + 56 -> {63}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {74 71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {77 76}; + 76 -> {83}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; - 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"]; + 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]; } - 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}; - 92 -> {93}; - 93 -> {94}; - 94 -> {103 95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {109}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {127 119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {133}; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {135}; - 135 -> {136}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {103 95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {109}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {127 119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {133}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {132}; + 132 -> {133}; + 133 -> {134}; + 134 -> {135}; + 135 -> {136}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot b/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot index 63c34a496ea..e84738032d3 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/dataFlowInfoFromWhileCondition.dot @@ -1,77 +1,77 @@ digraph dataFlowInfoFromWhileCondition_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - 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 - 5 [label="Enter while loop"]; - subgraph cluster_3 { - color=blue - 6 [label="Enter loop condition"]; - subgraph cluster_4 { - color=blue - 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 block"]; - 18 [label="Access variable R|/a|"]; - 19 [label="Function call: R|/a|.R|/A.foo|()"]; - 20 [label="Exit block"]; - } - 21 [label="Exit loop block"]; - } - 22 [label="Exit whileloop"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - 23 [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 -> {14 11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {22 16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {6}; - 22 -> {23}; + 0 -> {1}; + + 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 + 5 [label="Enter while loop"]; + subgraph cluster_3 { + color=blue + 6 [label="Enter loop condition"]; + subgraph cluster_4 { + color=blue + 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 block"]; + 18 [label="Access variable R|/a|"]; + 19 [label="Function call: R|/a|.R|/A.foo|()"]; + 20 [label="Exit block"]; + } + 21 [label="Exit loop block"]; + } + 22 [label="Exit whileloop"]; + } + 23 [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 -> {14 11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {22 16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 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 a5c55e230b1..49d679ea664 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/delayedAssignment.dot @@ -1,93 +1,93 @@ digraph delayedAssignment_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + 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 foo" style="filled" fillcolor=red]; - 3 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 2 -> {3}; - - subgraph cluster_2 { - color=red - 4 [label="Enter function test" style="filled" fillcolor=red]; - 5 [label="Variable declaration: lval a: R|A?|"]; - subgraph cluster_3 { - color=blue - 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 - 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: 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " 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 -> {18 10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {26}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; + 0 -> {1}; + + subgraph cluster_1 { + color=red + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; + } + + 2 -> {3}; + + subgraph cluster_2 { + color=red + 4 [label="Enter function test" style="filled" fillcolor=red]; + 5 [label="Variable declaration: lval a: R|A?|"]; + subgraph cluster_3 { + color=blue + 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 + 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: 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"]; + } + 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 -> {18 10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {26}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot b/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot index 8b02484031f..cc3050cff8b 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/elvis.dot @@ -1,220 +1,220 @@ digraph elvis_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function getter" style="filled" fillcolor=red]; + 3 [label="Exit function getter" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter property" style="filled" fillcolor=red]; - 5 [label="Exit property" style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter property" style="filled" fillcolor=red]; + 5 [label="Exit property" style="filled" fillcolor=red]; + } - 4 -> {5}; + 4 -> {5}; - subgraph cluster_3 { - color=red - 6 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_4 { - color=blue - 7 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 8 [label="Enter when branch condition "]; - subgraph cluster_6 { - color=blue - 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 { + subgraph cluster_3 { + color=red + 6 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_4 { color=blue - 15 [label="Enter when branch condition "]; - 16 [label="Const: Null(null)"]; - 17 [label="Operator =="]; - 18 [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"]; + 7 [label="Enter when"]; + subgraph cluster_5 { + color=blue + 8 [label="Enter when branch condition "]; + subgraph cluster_6 { + color=blue + 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 + 15 [label="Enter when branch condition "]; + 16 [label="Const: Null(null)"]; + 17 [label="Operator =="]; + 18 [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"]; + } + 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="Exit block"]; + } + 40 [label="Exit when branch result"]; + 41 [label="Exit when"]; } - 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="Exit block"]; - } - 40 [label="Exit when branch result"]; - 41 [label="Exit when"]; + 42 [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 13}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {26 19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {32}; - 26 -> {27}; - 27 -> {28}; - 28 -> {42}; - 28 -> {29} [style=dotted]; - 29 -> {30} [style=dotted]; - 30 -> {31} [style=dotted]; - 31 -> {32} [style=dotted]; - 32 -> {33}; - 33 -> {35 34}; - 34 -> {41}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11 13}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {26 19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {32}; + 26 -> {27}; + 27 -> {28}; + 28 -> {42}; + 28 -> {29} [style=dotted]; + 29 -> {30} [style=dotted]; + 30 -> {31} [style=dotted]; + 31 -> {32} [style=dotted]; + 32 -> {33}; + 33 -> {35 34}; + 34 -> {41}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; - subgraph cluster_12 { - color=red - 43 [label="Enter function test2" style="filled" fillcolor=red]; - subgraph cluster_13 { - color=blue - 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 - 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 - 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 - 79 [label="Enter when branch condition else"]; - 80 [label="Exit when branch condition"]; - } - 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|) { + subgraph cluster_12 { + color=red + 43 [label="Enter function test2" style="filled" fillcolor=red]; + subgraph cluster_13 { + color=blue + 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 + 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 + 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 + 79 [label="Enter when branch condition else"]; + 80 [label="Exit when branch condition"]; + } + 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| } @@ -223,63 +223,63 @@ digraph elvis_kt { } } "]; - 93 [label="Stub" style="filled" fillcolor=gray]; - 94 [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 -> {50 49}; - 49 -> {57}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {94}; - 53 -> {54} [style=dotted]; - 54 -> {55} [style=dotted]; - 55 -> {56} [style=dotted]; - 56 -> {57} [style=dotted]; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {64 63}; - 63 -> {71}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {94}; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {70} [style=dotted]; - 70 -> {71} [style=dotted]; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {86 79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {91}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {94}; - 92 -> {93} [style=dotted]; - 93 -> {94} [style=dotted]; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {50 49}; + 49 -> {57}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {94}; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; + 55 -> {56} [style=dotted]; + 56 -> {57} [style=dotted]; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {64 63}; + 63 -> {71}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {94}; + 67 -> {68} [style=dotted]; + 68 -> {69} [style=dotted]; + 69 -> {70} [style=dotted]; + 70 -> {71} [style=dotted]; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {86 79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {91}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 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 19219fef3fe..5a8b69aa4a9 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/endlessLoops.dot @@ -1,600 +1,586 @@ digraph endlessLoops_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 3 [label="Enter while loop"]; - subgraph cluster_3 { - color=blue - 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 block"]; - 9 [label="Access variable R|/x|"]; - 10 [label="Type operator: x as A"]; - subgraph cluster_6 { - color=blue - 11 [label="Enter when"]; - subgraph cluster_7 { - color=blue - 12 [label="Enter when branch condition "]; - 13 [label="Access variable R|/b|"]; - 14 [label="Exit when branch condition"]; - } - 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"]; - } - 23 [label="Exit block"]; - } - 24 [label="Exit loop block"]; - } - 25 [label="Stub" style="filled" fillcolor=gray]; - 26 [label="Exit whileloop"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" 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}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 6 -> {25} [style=dotted]; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {16 15}; - 15 -> {22}; - 16 -> {17}; - 17 -> {18}; - 18 -> {26}; - 18 -> {19} [style=dotted]; - 19 -> {20} [style=dotted]; - 20 -> {21} [style=dotted]; - 21 -> {22} [style=dotted]; - 22 -> {23}; - 23 -> {24}; - 24 -> {4}; - 25 -> {26} [style=dotted]; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; + 0 -> {1}; - subgraph cluster_9 { - color=red - 30 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { - color=blue - 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 - 35 [label="Enter loop block"]; - subgraph cluster_13 { - color=blue - 36 [label="Enter block"]; - subgraph cluster_14 { + subgraph cluster_1 { + color=red + 2 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_2 { color=blue - 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"]; + 3 [label="Enter while loop"]; + subgraph cluster_3 { + color=blue + 4 [label="Enter loop condition"]; + 5 [label="Const: Boolean(true)"]; + 6 [label="Exit loop condition"]; } - 41 [label="Synthetic else branch"]; - 42 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 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]; + subgraph cluster_4 { + color=blue + 7 [label="Enter loop block"]; + subgraph cluster_5 { + color=blue + 8 [label="Enter block"]; + 9 [label="Access variable R|/x|"]; + 10 [label="Type operator: x as A"]; + subgraph cluster_6 { + color=blue + 11 [label="Enter when"]; + subgraph cluster_7 { + color=blue + 12 [label="Enter when branch condition "]; + 13 [label="Access variable R|/b|"]; + 14 [label="Exit when branch condition"]; + } + 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"]; + } + 23 [label="Exit block"]; + } + 24 [label="Exit loop block"]; } - 49 [label="Exit when branch result" style="filled" fillcolor=gray]; - 50 [label="Exit when"]; - } - 51 [label="Exit block"]; + 25 [label="Exit whileloop"]; } - 52 [label="Exit loop block"]; - } - 53 [label="Stub" style="filled" fillcolor=gray]; - 54 [label="Exit whileloop"]; + 26 [label="Access variable R|/x|"]; + 27 [label="Function call: R|/x|.R|/A.foo|()"]; + 28 [label="Exit function test_1" 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}; - 38 -> {39}; - 39 -> {40}; - 40 -> {42 41}; - 41 -> {50}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {54}; - 46 -> {47} [style=dotted]; - 47 -> {48} [style=dotted]; - 48 -> {49} [style=dotted]; - 49 -> {50} [style=dotted]; - 50 -> {51}; - 51 -> {52}; - 52 -> {32}; - 53 -> {54} [style=dotted]; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 6 -> {25} [style=dotted]; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {16 15}; + 15 -> {22}; + 16 -> {17}; + 17 -> {18}; + 18 -> {25}; + 18 -> {19} [style=dotted]; + 19 -> {20} [style=dotted]; + 20 -> {21} [style=dotted]; + 21 -> {22} [style=dotted]; + 22 -> {23}; + 23 -> {24}; + 24 -> {4}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; - 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 { + subgraph cluster_9 { + color=red + 29 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { 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"]; + 30 [label="Enter while loop"]; + subgraph cluster_11 { + color=blue + 31 [label="Enter loop condition"]; + 32 [label="Const: Boolean(true)"]; + 33 [label="Exit loop 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]; + subgraph cluster_12 { + color=blue + 34 [label="Enter loop block"]; + subgraph cluster_13 { + color=blue + 35 [label="Enter block"]; + subgraph cluster_14 { + color=blue + 36 [label="Enter when"]; + subgraph cluster_15 { + color=blue + 37 [label="Enter when branch condition "]; + 38 [label="Access variable R|/b|"]; + 39 [label="Exit when branch condition"]; + } + 40 [label="Synthetic else branch"]; + 41 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 42 [label="Enter block"]; + 43 [label="Access variable R|/x|"]; + 44 [label="Type operator: x as A"]; + 45 [label="Jump: break@@@[Boolean(true)] "]; + 46 [label="Stub" style="filled" fillcolor=gray]; + 47 [label="Exit block" style="filled" fillcolor=gray]; + } + 48 [label="Exit when branch result" style="filled" fillcolor=gray]; + 49 [label="Exit when"]; + } + 50 [label="Exit block"]; + } + 51 [label="Exit loop block"]; } - 77 [label="Exit when branch result" style="filled" fillcolor=gray]; - 78 [label="Exit when"]; - } - subgraph cluster_25 { + 52 [label="Exit whileloop"]; + } + 53 [label="Access variable R|/x|"]; + 54 [label="Function call: R|/x|.R|/A.foo|()"]; + 55 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 33 -> {52} [style=dotted]; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {41 40}; + 40 -> {49}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {52}; + 45 -> {46} [style=dotted]; + 46 -> {47} [style=dotted]; + 47 -> {48} [style=dotted]; + 48 -> {49} [style=dotted]; + 49 -> {50}; + 50 -> {51}; + 51 -> {31}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + + subgraph cluster_17 { + color=red + 56 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_18 { 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"]; + 57 [label="Enter while loop"]; + subgraph cluster_19 { + color=blue + 58 [label="Enter loop condition"]; + 59 [label="Const: Boolean(true)"]; + 60 [label="Exit loop 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]; + subgraph cluster_20 { + color=blue + 61 [label="Enter loop block"]; + subgraph cluster_21 { + color=blue + 62 [label="Enter block"]; + 63 [label="Access variable R|/x|"]; + 64 [label="Type operator: x as A"]; + subgraph cluster_22 { + color=blue + 65 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 66 [label="Enter when branch condition "]; + 67 [label="Access variable R|/b|"]; + 68 [label="Exit when branch condition"]; + } + 69 [label="Synthetic else branch"]; + 70 [label="Enter when branch result"]; + subgraph cluster_24 { + color=blue + 71 [label="Enter block"]; + 72 [label="Jump: break@@@[Boolean(true)] "]; + 73 [label="Stub" style="filled" fillcolor=gray]; + 74 [label="Exit block" style="filled" fillcolor=gray]; + } + 75 [label="Exit when branch result" style="filled" fillcolor=gray]; + 76 [label="Exit when"]; + } + subgraph cluster_25 { + color=blue + 77 [label="Enter when"]; + subgraph cluster_26 { + color=blue + 78 [label="Enter when branch condition "]; + 79 [label="Access variable R|/b|"]; + 80 [label="Exit when branch condition"]; + } + 81 [label="Synthetic else branch"]; + 82 [label="Enter when branch result"]; + subgraph cluster_27 { + color=blue + 83 [label="Enter block"]; + 84 [label="Jump: break@@@[Boolean(true)] "]; + 85 [label="Stub" style="filled" fillcolor=gray]; + 86 [label="Exit block" style="filled" fillcolor=gray]; + } + 87 [label="Exit when branch result" style="filled" fillcolor=gray]; + 88 [label="Exit when"]; + } + 89 [label="Exit block"]; + } + 90 [label="Exit loop block"]; } - 89 [label="Exit when branch result" style="filled" fillcolor=gray]; - 90 [label="Exit when"]; - } - 91 [label="Exit block"]; + 91 [label="Exit whileloop"]; } - 92 [label="Exit loop block"]; - } - 93 [label="Stub" style="filled" fillcolor=gray]; - 94 [label="Exit whileloop"]; + 92 [label="Access variable R|/x|"]; + 93 [label="Function call: R|/x|.R|/A.foo|()"]; + 94 [label="Exit function test_3" style="filled" fillcolor=red]; } - 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}; - 61 -> {62}; - 62 -> {63}; - 62 -> {93} [style=dotted]; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {72 71}; - 71 -> {78}; - 72 -> {73}; - 73 -> {74}; - 74 -> {94}; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; - 76 -> {77} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {84 83}; - 83 -> {90}; - 84 -> {85}; - 85 -> {86}; - 86 -> {94}; - 86 -> {87} [style=dotted]; - 87 -> {88} [style=dotted]; - 88 -> {89} [style=dotted]; - 89 -> {90} [style=dotted]; - 90 -> {91}; - 91 -> {92}; - 92 -> {60}; - 93 -> {94} [style=dotted]; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 60 -> {91} [style=dotted]; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {70 69}; + 69 -> {76}; + 70 -> {71}; + 71 -> {72}; + 72 -> {91}; + 72 -> {73} [style=dotted]; + 73 -> {74} [style=dotted]; + 74 -> {75} [style=dotted]; + 75 -> {76} [style=dotted]; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {82 81}; + 81 -> {88}; + 82 -> {83}; + 83 -> {84}; + 84 -> {91}; + 84 -> {85} [style=dotted]; + 85 -> {86} [style=dotted]; + 86 -> {87} [style=dotted]; + 87 -> {88} [style=dotted]; + 88 -> {89}; + 89 -> {90}; + 90 -> {58}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; - 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 { + subgraph cluster_28 { + color=red + 95 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_29 { 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"]; + 96 [label="Enter while loop"]; + subgraph cluster_30 { + color=blue + 97 [label="Enter loop condition"]; + 98 [label="Const: Boolean(true)"]; + 99 [label="Exit loop 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]; + subgraph cluster_31 { + color=blue + 100 [label="Enter loop block"]; + subgraph cluster_32 { + color=blue + 101 [label="Enter block"]; + subgraph cluster_33 { + color=blue + 102 [label="Enter when"]; + subgraph cluster_34 { + 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_35 { + color=blue + 108 [label="Enter block"]; + 109 [label="Access variable R|/x|"]; + 110 [label="Type operator: x as A"]; + 111 [label="Jump: break@@@[Boolean(true)] "]; + 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"]; + } + 116 [label="Jump: break@@@[Boolean(true)] "]; + 117 [label="Stub" style="filled" fillcolor=gray]; + 118 [label="Exit block" style="filled" fillcolor=gray]; + } + 119 [label="Exit loop 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]; + 120 [label="Exit whileloop"]; } - 122 [label="Exit loop block" style="filled" fillcolor=gray]; - } - 123 [label="Stub" style="filled" fillcolor=gray]; - 124 [label="Exit whileloop"]; + 121 [label="Access variable R|/x|"]; + 122 [label="Function call: R|/x|.#()"]; + 123 [label="Exit function test_4" style="filled" fillcolor=red]; } - 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}; - 102 -> {123} [style=dotted]; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; - 108 -> {110 109}; - 109 -> {118}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {124}; - 114 -> {115} [style=dotted]; - 115 -> {116} [style=dotted]; - 116 -> {117} [style=dotted]; - 117 -> {118} [style=dotted]; - 118 -> {119}; - 119 -> {124}; - 119 -> {120} [style=dotted]; - 120 -> {121} [style=dotted]; - 121 -> {122} [style=dotted]; - 122 -> {100} [style=dotted]; - 123 -> {124} [style=dotted]; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 99 -> {120} [style=dotted]; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {107 106}; + 106 -> {115}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {120}; + 111 -> {112} [style=dotted]; + 112 -> {113} [style=dotted]; + 113 -> {114} [style=dotted]; + 114 -> {115} [style=dotted]; + 115 -> {116}; + 116 -> {120}; + 116 -> {117} [style=dotted]; + 117 -> {118} [style=dotted]; + 118 -> {119} [style=dotted]; + 119 -> {97} [style=dotted]; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; - 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 { + subgraph cluster_36 { + color=red + 124 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_37 { 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"]; + 125 [label="Enter do-while loop"]; + subgraph cluster_38 { + color=blue + 126 [label="Enter loop block"]; + subgraph cluster_39 { + color=blue + 127 [label="Enter block"]; + subgraph cluster_40 { + color=blue + 128 [label="Enter when"]; + subgraph cluster_41 { + color=blue + 129 [label="Enter when branch condition "]; + 130 [label="Access variable R|/b|"]; + 131 [label="Exit when branch condition"]; + } + 132 [label="Synthetic else branch"]; + 133 [label="Enter when branch result"]; + subgraph cluster_42 { + color=blue + 134 [label="Enter block"]; + 135 [label="Access variable R|/x|"]; + 136 [label="Type operator: x as A"]; + 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"]; } - 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]; + subgraph cluster_43 { + color=blue + 144 [label="Enter loop condition"]; + 145 [label="Const: Boolean(true)"]; + 146 [label="Exit loop condition"]; } - 144 [label="Exit when branch result" style="filled" fillcolor=gray]; - 145 [label="Exit when"]; - } - 146 [label="Exit block"]; + 147 [label="Exit do-whileloop"]; } - 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"]; + 148 [label="Access variable R|/x|"]; + 149 [label="Function call: R|/x|.R|/A.foo|()"]; + 150 [label="Exit function test_5" style="filled" fillcolor=red]; } - 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}; - 135 -> {137 136}; - 136 -> {145}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {141}; - 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 -> {130}; - 150 -> {151} [style=dotted]; - 151 -> {152} [style=dotted]; - 152 -> {153}; - 153 -> {154}; - 154 -> {155}; + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {133 132}; + 132 -> {141}; + 133 -> {134}; + 134 -> {135}; + 135 -> {136}; + 136 -> {137}; + 137 -> {147}; + 137 -> {138} [style=dotted]; + 138 -> {139} [style=dotted]; + 139 -> {140} [style=dotted]; + 140 -> {141} [style=dotted]; + 141 -> {142}; + 142 -> {143}; + 143 -> {144}; + 144 -> {145}; + 145 -> {146}; + 146 -> {126}; + 146 -> {147} [style=dotted]; + 147 -> {148}; + 148 -> {149}; + 149 -> {150}; - 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 { + subgraph cluster_44 { + color=red + 151 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_45 { 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"]; + 152 [label="Enter do-while loop"]; + subgraph cluster_46 { + color=blue + 153 [label="Enter loop block"]; + subgraph cluster_47 { + color=blue + 154 [label="Enter block"]; + 155 [label="Access variable R|/x|"]; + 156 [label="Type operator: x as A"]; + subgraph cluster_48 { + color=blue + 157 [label="Enter when"]; + subgraph cluster_49 { + color=blue + 158 [label="Enter when branch condition "]; + 159 [label="Access variable R|/b|"]; + 160 [label="Exit when branch condition"]; + } + 161 [label="Synthetic else branch"]; + 162 [label="Enter when branch result"]; + subgraph cluster_50 { + color=blue + 163 [label="Enter block"]; + 164 [label="Jump: break@@@[Boolean(true)] "]; + 165 [label="Stub" style="filled" fillcolor=gray]; + 166 [label="Exit block" style="filled" fillcolor=gray]; + } + 167 [label="Exit when branch result" style="filled" fillcolor=gray]; + 168 [label="Exit when"]; + } + 169 [label="Exit block"]; + } + 170 [label="Exit loop block"]; } - 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]; + subgraph cluster_51 { + color=blue + 171 [label="Enter loop condition"]; + 172 [label="Const: Boolean(true)"]; + 173 [label="Exit loop condition"]; } - 172 [label="Exit when branch result" style="filled" fillcolor=gray]; - 173 [label="Exit when"]; - } - 174 [label="Exit block"]; + 174 [label="Exit do-whileloop"]; } - 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"]; + 175 [label="Access variable R|/x|"]; + 176 [label="Function call: R|/x|.R|/A.foo|()"]; + 177 [label="Exit function test_6" style="filled" fillcolor=red]; } - 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 -> {160}; - 160 -> {161}; - 161 -> {162}; - 162 -> {163}; - 163 -> {164}; - 164 -> {165}; - 165 -> {167 166}; - 166 -> {173}; - 167 -> {168}; - 168 -> {169}; - 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 -> {177}; - 177 -> {178}; - 178 -> {158}; - 178 -> {179} [style=dotted]; - 179 -> {180} [style=dotted]; - 180 -> {181}; - 181 -> {182}; - 182 -> {183}; + 151 -> {152}; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + 155 -> {156}; + 156 -> {157}; + 157 -> {158}; + 158 -> {159}; + 159 -> {160}; + 160 -> {162 161}; + 161 -> {168}; + 162 -> {163}; + 163 -> {164}; + 164 -> {174}; + 164 -> {165} [style=dotted]; + 165 -> {166} [style=dotted]; + 166 -> {167} [style=dotted]; + 167 -> {168} [style=dotted]; + 168 -> {169}; + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {173}; + 173 -> {153}; + 173 -> {174} [style=dotted]; + 174 -> {175}; + 175 -> {176}; + 176 -> {177}; - 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"]; + subgraph cluster_52 { + color=red + 178 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_53 { + color=blue + 179 [label="Enter do-while loop"]; + subgraph cluster_54 { + color=blue + 180 [label="Enter loop block"]; + subgraph cluster_55 { + color=blue + 181 [label="Enter block"]; + 182 [label="Access variable R|/x|"]; + 183 [label="Type operator: x as A"]; + 184 [label="Exit block"]; + } + 185 [label="Exit loop block"]; + } + subgraph cluster_56 { + color=blue + 186 [label="Enter loop condition"]; + 187 [label="Const: Boolean(true)"]; + 188 [label="Exit loop condition"]; + } + 189 [label="Exit do-whileloop" style="filled" fillcolor=gray]; } - 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]; + 190 [label="Access variable R|/x|" style="filled" fillcolor=gray]; + 191 [label="Function call: R|/x|.R|/A.foo|()" style="filled" fillcolor=gray]; + 192 [label="Exit function test_7" style="filled" fillcolor=red 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 -> {190}; - 190 -> {191}; - 191 -> {192}; - 192 -> {193}; - 193 -> {194}; - 194 -> {186}; - 194 -> {195} [style=dotted]; - 195 -> {196} [style=dotted]; - 196 -> {197} [style=dotted]; - 197 -> {198} [style=dotted]; - 198 -> {199} [style=dotted]; + 178 -> {179}; + 179 -> {180}; + 180 -> {181}; + 181 -> {182}; + 182 -> {183}; + 183 -> {184}; + 184 -> {185}; + 185 -> {186}; + 186 -> {187}; + 187 -> {188}; + 188 -> {180}; + 188 -> {189} [style=dotted]; + 189 -> {190} [style=dotted]; + 190 -> {191} [style=dotted]; + 191 -> {192} [style=dotted]; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot index c002f23846d..54ba3f5db26 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsAndIdentity.dot @@ -1,322 +1,322 @@ digraph equalsAndIdentity_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_2 { - color=blue - 3 [label="Enter when"]; - subgraph cluster_3 { - color=blue - 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_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - subgraph cluster_5 { - color=blue - 19 [label="Enter when"]; - subgraph cluster_6 { - color=blue - 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"]; - } - 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"]; - } - 35 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {10 9}; - 9 -> {18}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {26 25}; - 25 -> {34}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; + 0 -> {1}; - subgraph cluster_8 { - color=red - 36 [label="Enter function test_2" 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="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 - 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_1 { + color=red + 2 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_2 { + color=blue + 3 [label="Enter when"]; + subgraph cluster_3 { + color=blue + 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 branch condition "]; + 21 [label="Access variable R|/x|"]; + 22 [label="Access variable R|/y|"]; + 23 [label="Operator ==="]; + 24 [label="Exit when branch condition"]; + } + 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"]; + } + 35 [label="Exit function test_1" style="filled" fillcolor=red]; } - 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 - 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"]; - } - 67 [label="Exit when branch result"]; - 68 [label="Exit when"]; - } - 69 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {44 43}; - 43 -> {52}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {60 59}; - 59 -> {68}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {10 9}; + 9 -> {18}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {26 25}; + 25 -> {34}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; - 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_8 { + color=red + 36 [label="Enter function test_2" 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="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 + 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 + 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"]; + } + 67 [label="Exit when branch result"]; + 68 [label="Exit when"]; + } + 69 [label="Exit function test_2" style="filled" fillcolor=red]; } - 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}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {78 77}; - 77 -> {84}; - 78 -> {79}; - 79 -> {80}; - 80 -> {117}; - 80 -> {81} [style=dotted]; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; - 83 -> {84} [style=dotted]; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {92 91}; - 91 -> {100}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {108 107}; - 107 -> {116}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {44 43}; + 43 -> {52}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {60 59}; + 59 -> {68}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + + 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}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {78 77}; + 77 -> {84}; + 78 -> {79}; + 79 -> {80}; + 80 -> {117}; + 80 -> {81} [style=dotted]; + 81 -> {82} [style=dotted]; + 82 -> {83} [style=dotted]; + 83 -> {84} [style=dotted]; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {92 91}; + 91 -> {100}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {108 107}; + 107 -> {116}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot index 774dd5cd4a6..4eff0d026cc 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/equalsToBoolean.dot @@ -1,582 +1,582 @@ digraph equalsToBoolean_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function getter" style="filled" fillcolor=red]; - 3 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 2 -> {3}; - - subgraph cluster_2 { - color=red - 4 [label="Enter property" style="filled" fillcolor=red]; - 5 [label="Exit property" style="filled" fillcolor=red]; - } - - 4 -> {5}; - - subgraph cluster_3 { - color=red - 6 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_4 { - color=blue - 7 [label="Enter when"]; - subgraph cluster_5 { - color=blue - 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"]; - } - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - 30 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {23 15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {29}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; + 0 -> {1}; - subgraph cluster_9 { - color=red - 31 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_10 { - color=blue - 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 - 40 [label="Enter when branch condition else"]; - 41 [label="Exit when branch condition"]; - } - 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"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function getter" style="filled" fillcolor=red]; + 3 [label="Exit function getter" 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 -> {48 40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {54}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; + 2 -> {3}; - 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"]; + subgraph cluster_2 { + color=red + 4 [label="Enter property" style="filled" fillcolor=red]; + 5 [label="Exit property" style="filled" fillcolor=red]; } - 80 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {73 65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {79}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; + 4 -> {5}; - 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"]; + subgraph cluster_3 { + color=red + 6 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_4 { + color=blue + 7 [label="Enter when"]; + subgraph cluster_5 { + color=blue + 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"]; + } + 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"]; + } + 30 [label="Exit function test_1" style="filled" fillcolor=red]; } - 105 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {98 90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {104}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {23 15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {29}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; - 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"]; + subgraph cluster_9 { + color=red + 31 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_10 { + color=blue + 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 + 40 [label="Enter when branch condition else"]; + 41 [label="Exit when branch condition"]; + } + 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"]; + } + 55 [label="Exit function test_2" style="filled" fillcolor=red]; } - 130 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {123 115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {129}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {48 40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {54}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; - 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"]; + 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]; } - 155 [label="Exit function test_6" style="filled" fillcolor=red]; - } - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {135}; - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {148 140}; - 140 -> {141}; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; - 147 -> {154}; - 148 -> {149}; - 149 -> {150}; - 150 -> {151}; - 151 -> {152}; - 152 -> {153}; - 153 -> {154}; - 154 -> {155}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {73 65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {79}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; - 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"]; + 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]; } - 180 [label="Exit function test_7" style="filled" fillcolor=red]; - } - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162}; - 162 -> {163}; - 163 -> {164}; - 164 -> {173 165}; - 165 -> {166}; - 166 -> {167}; - 167 -> {168}; - 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {179}; - 173 -> {174}; - 174 -> {175}; - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; - 178 -> {179}; - 179 -> {180}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {98 90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {104}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; - 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"]; + 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]; } - 205 [label="Exit function test_8" style="filled" fillcolor=red]; - } - 181 -> {182}; - 182 -> {183}; - 183 -> {184}; - 184 -> {185}; - 185 -> {186}; - 186 -> {187}; - 187 -> {188}; - 188 -> {189}; - 189 -> {198 190}; - 190 -> {191}; - 191 -> {192}; - 192 -> {193}; - 193 -> {194}; - 194 -> {195}; - 195 -> {196}; - 196 -> {197}; - 197 -> {204}; - 198 -> {199}; - 199 -> {200}; - 200 -> {201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {204}; - 204 -> {205}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {123 115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {129}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + + 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}; + 135 -> {136}; + 136 -> {137}; + 137 -> {138}; + 138 -> {139}; + 139 -> {148 140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; + 143 -> {144}; + 144 -> {145}; + 145 -> {146}; + 146 -> {147}; + 147 -> {154}; + 148 -> {149}; + 149 -> {150}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + + 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 -> {159}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162}; + 162 -> {163}; + 163 -> {164}; + 164 -> {173 165}; + 165 -> {166}; + 166 -> {167}; + 167 -> {168}; + 168 -> {169}; + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {179}; + 173 -> {174}; + 174 -> {175}; + 175 -> {176}; + 176 -> {177}; + 177 -> {178}; + 178 -> {179}; + 179 -> {180}; + + 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 -> {186}; + 186 -> {187}; + 187 -> {188}; + 188 -> {189}; + 189 -> {198 190}; + 190 -> {191}; + 191 -> {192}; + 192 -> {193}; + 193 -> {194}; + 194 -> {195}; + 195 -> {196}; + 196 -> {197}; + 197 -> {204}; + 198 -> {199}; + 199 -> {200}; + 200 -> {201}; + 201 -> {202}; + 202 -> {203}; + 203 -> {204}; + 204 -> {205}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot index a627642fb24..3ca2a2424e3 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceiverAsWhenSubject.dot @@ -1,60 +1,60 @@ digraph implicitReceiverAsWhenSubject_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - 2 [label="Access variable this@R|/test_1|"]; - subgraph cluster_2 { - color=blue - 3 [label="Enter when branch condition "]; - 4 [label="Type operator: List<*>"]; - 5 [label="Exit when branch condition"]; - } - 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|) { + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + 2 [label="Access variable this@R|/test_1|"]; + subgraph cluster_2 { + color=blue + 3 [label="Enter when branch condition "]; + 4 [label="Type operator: List<*>"]; + 5 [label="Exit when branch condition"]; + } + 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| } @@ -66,99 +66,99 @@ digraph implicitReceiverAsWhenSubject_kt { } } "]; - 29 [label="Stub" style="filled" fillcolor=gray]; - 30 [label="Exit function test_1" style="filled" fillcolor=red]; - } - - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {21 6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {16 9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {27}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {27}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {30}; - 28 -> {29} [style=dotted]; - 29 -> {30} [style=dotted]; - - subgraph cluster_8 { - color=red - 31 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 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 - 38 [label="Enter when branch condition "]; - 39 [label="Type operator: String"]; - 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="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"]; + 29 [label="Stub" style="filled" fillcolor=gray]; + 30 [label="Exit function test_1" style="filled" fillcolor=red]; } - 64 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) { + + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {21 6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {16 9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {27}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {27}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {30}; + 28 -> {29} [style=dotted]; + 29 -> {30} [style=dotted]; + + subgraph cluster_8 { + color=red + 31 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 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 + 38 [label="Enter when branch condition "]; + 39 [label="Type operator: String"]; + 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="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| @@ -172,45 +172,45 @@ digraph implicitReceiverAsWhenSubject_kt { } } "]; - 65 [label="Stub" style="filled" fillcolor=gray]; - 66 [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 -> {55 38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {48 41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {63}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {63}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {66}; - 64 -> {65} [style=dotted]; - 65 -> {66} [style=dotted]; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {55 38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {48 41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {63}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {63}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 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 6bebfb832f3..95c3e106478 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/implicitReceivers.dot @@ -1,228 +1,228 @@ digraph implicitReceivers_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + 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 foo" style="filled" fillcolor=red]; - 3 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 2 -> {3}; - - subgraph cluster_2 { - color=red - 4 [label="Enter function " style="filled" fillcolor=red]; - 5 [label="Exit function " style="filled" fillcolor=red]; - } - - 4 -> {5}; - - subgraph cluster_3 { - color=red - 6 [label="Enter function bar" style="filled" fillcolor=red]; - 7 [label="Exit function bar" style="filled" fillcolor=red]; - } - - 6 -> {7}; - - subgraph cluster_4 { - color=red - 8 [label="Enter function with" style="filled" fillcolor=red]; - 9 [label="Exit function with" style="filled" fillcolor=red]; - } - - 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 when"]; - subgraph cluster_7 { - color=blue - 12 [label="Enter when branch condition "]; - 13 [label="Access variable this@R|/test_1|"]; - 14 [label="Type operator: this is A"]; - 15 [label="Exit when branch condition"]; - } - subgraph cluster_8 { - color=blue - 16 [label="Enter when branch condition else"]; - 17 [label="Exit when branch condition"]; - } - 18 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 19 [label="Enter block"]; - 20 [label="Access variable this@R|/test_1|"]; - 21 [label="Function call: this@R|/test_1|.#()"]; - 22 [label="Function call: #()"]; - 23 [label="Exit block"]; - } - 24 [label="Exit when branch result"]; - 25 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 26 [label="Enter block"]; - 27 [label="Access variable this@R|/test_1|"]; - 28 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; - 29 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; - 30 [label="Exit block"]; - } - 31 [label="Exit when branch result"]; - 32 [label="Exit when"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function " style="filled" fillcolor=red]; + 1 [label="Exit function " style="filled" fillcolor=red]; } - 33 [label="Access variable this@R|/test_1|"]; - 34 [label="Function call: this@R|/test_1|.#()"]; - 35 [label="Function call: #()"]; - 36 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {25 16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {32}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; + 0 -> {1}; - subgraph cluster_11 { - color=red - 37 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 38 [label="Enter when"]; - subgraph cluster_13 { - color=blue - 39 [label="Enter when branch condition "]; - 40 [label="Access variable this@R|/test_2|"]; - 41 [label="Type operator: this !is A"]; - 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 this@R|/test_2|"]; - 48 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; - 49 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; - 50 [label="Exit block"]; - } - 51 [label="Exit when branch result"]; - 52 [label="Enter when branch result"]; - subgraph cluster_16 { - color=blue - 53 [label="Enter block"]; - 54 [label="Access variable this@R|/test_2|"]; - 55 [label="Function call: this@R|/test_2|.#()"]; - 56 [label="Function call: #()"]; - 57 [label="Exit block"]; - } - 58 [label="Exit when branch result"]; - 59 [label="Exit when"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; } - 60 [label="Access variable this@R|/test_2|"]; - 61 [label="Function call: this@R|/test_2|.#()"]; - 62 [label="Function call: #()"]; - 63 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {52 43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {59}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; + 2 -> {3}; - subgraph cluster_17 { - color=red - 64 [label="Enter function test_3" style="filled" fillcolor=red]; - 65 [label="Access variable R|/a|"]; - subgraph cluster_18 { - color=blue - 66 [label="Enter function anonymousFunction"]; - 67 [label="Access variable R|/b|"]; - subgraph cluster_19 { - color=blue - 68 [label="Enter function anonymousFunction"]; - 69 [label="Access variable R|/c|"]; - subgraph cluster_20 { - color=blue - 70 [label="Enter function anonymousFunction"]; - 71 [label="Access variable this@R|special/anonymous|"]; - 72 [label="Type operator: this@wb as A"]; - 73 [label="Access variable this@R|special/anonymous|"]; - 74 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 75 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 76 [label="Exit function anonymousFunction"]; + subgraph cluster_2 { + color=red + 4 [label="Enter function " style="filled" fillcolor=red]; + 5 [label="Exit function " style="filled" fillcolor=red]; + } + + 4 -> {5}; + + subgraph cluster_3 { + color=red + 6 [label="Enter function bar" style="filled" fillcolor=red]; + 7 [label="Exit function bar" style="filled" fillcolor=red]; + } + + 6 -> {7}; + + subgraph cluster_4 { + color=red + 8 [label="Enter function with" style="filled" fillcolor=red]; + 9 [label="Exit function with" style="filled" fillcolor=red]; + } + + 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 when"]; + subgraph cluster_7 { + color=blue + 12 [label="Enter when branch condition "]; + 13 [label="Access variable this@R|/test_1|"]; + 14 [label="Type operator: this is A"]; + 15 [label="Exit when branch condition"]; + } + subgraph cluster_8 { + color=blue + 16 [label="Enter when branch condition else"]; + 17 [label="Exit when branch condition"]; + } + 18 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 19 [label="Enter block"]; + 20 [label="Access variable this@R|/test_1|"]; + 21 [label="Function call: this@R|/test_1|.#()"]; + 22 [label="Function call: #()"]; + 23 [label="Exit block"]; + } + 24 [label="Exit when branch result"]; + 25 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 26 [label="Enter block"]; + 27 [label="Access variable this@R|/test_1|"]; + 28 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; + 29 [label="Function call: this@R|/test_1|.R|/A.foo|()"]; + 30 [label="Exit block"]; + } + 31 [label="Exit when branch result"]; + 32 [label="Exit when"]; } - 77 [label="Function call: R|kotlin/with|(R|/c|, = wc@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 33 [label="Access variable this@R|/test_1|"]; + 34 [label="Function call: this@R|/test_1|.#()"]; + 35 [label="Function call: #()"]; + 36 [label="Exit function test_1" style="filled" fillcolor=red]; + } + + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {25 16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {32}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + + subgraph cluster_11 { + color=red + 37 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 38 [label="Enter when"]; + subgraph cluster_13 { + color=blue + 39 [label="Enter when branch condition "]; + 40 [label="Access variable this@R|/test_2|"]; + 41 [label="Type operator: this !is A"]; + 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 this@R|/test_2|"]; + 48 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; + 49 [label="Function call: this@R|/test_2|.R|/A.foo|()"]; + 50 [label="Exit block"]; + } + 51 [label="Exit when branch result"]; + 52 [label="Enter when branch result"]; + subgraph cluster_16 { + color=blue + 53 [label="Enter block"]; + 54 [label="Access variable this@R|/test_2|"]; + 55 [label="Function call: this@R|/test_2|.#()"]; + 56 [label="Function call: #()"]; + 57 [label="Exit block"]; + } + 58 [label="Exit when branch result"]; + 59 [label="Exit when"]; + } + 60 [label="Access variable this@R|/test_2|"]; + 61 [label="Function call: this@R|/test_2|.#()"]; + 62 [label="Function call: #()"]; + 63 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {52 43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {59}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + + subgraph cluster_17 { + color=red + 64 [label="Enter function test_3" style="filled" fillcolor=red]; + 65 [label="Access variable R|/a|"]; + subgraph cluster_18 { + color=blue + 66 [label="Enter function anonymousFunction"]; + 67 [label="Access variable R|/b|"]; + subgraph cluster_19 { + color=blue + 68 [label="Enter function anonymousFunction"]; + 69 [label="Access variable R|/c|"]; + subgraph cluster_20 { + color=blue + 70 [label="Enter function anonymousFunction"]; + 71 [label="Access variable this@R|special/anonymous|"]; + 72 [label="Type operator: this@wb as A"]; + 73 [label="Access variable this@R|special/anonymous|"]; + 74 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 75 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 76 [label="Exit function anonymousFunction"]; + } + 77 [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|special/anonymous|.R|/A.foo|() } )"]; - 78 [label="Access variable this@R|special/anonymous|"]; - 79 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 80 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; - 81 [label="Exit function anonymousFunction"]; - } - 82 [label="Function call: R|kotlin/with|(R|/b|, = wb@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 78 [label="Access variable this@R|special/anonymous|"]; + 79 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 80 [label="Function call: this@R|special/anonymous|.R|/A.foo|()"]; + 81 [label="Exit function anonymousFunction"]; + } + 82 [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|() @@ -233,9 +233,9 @@ digraph implicitReceivers_kt { this@R|special/anonymous|.R|/A.foo|() } )"]; - 83 [label="Exit function anonymousFunction"]; - } - 84 [label="Function call: R|kotlin/with|(R|/a|, = wa@fun R|kotlin/Any|.(): R|kotlin/Unit| { + 83 [label="Exit function anonymousFunction"]; + } + 84 [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|) @@ -249,233 +249,233 @@ digraph implicitReceivers_kt { ) } )"]; - 85 [label="Exit function test_3" style="filled" fillcolor=red]; - } + 85 [label="Exit function test_3" style="filled" fillcolor=red]; + } - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; - subgraph cluster_21 { - color=red - 86 [label="Enter function test_4" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 87 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 88 [label="Enter when branch condition "]; - 89 [label="Access variable this@R|/test_4|"]; - 90 [label="Type operator: this !is A"]; - 91 [label="Exit when branch condition"]; - } - subgraph cluster_24 { - color=blue - 92 [label="Enter when branch condition else"]; - 93 [label="Exit when branch condition"]; - } - 94 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 95 [label="Enter block"]; - subgraph cluster_26 { - color=blue - 96 [label="Enter when"]; - subgraph cluster_27 { + subgraph cluster_21 { + color=red + 86 [label="Enter function test_4" style="filled" fillcolor=red]; + subgraph cluster_22 { color=blue - 97 [label="Enter when branch condition "]; - 98 [label="Access variable this@R|/test_4|"]; - 99 [label="Type operator: this !is B"]; - 100 [label="Exit when branch condition"]; - } - subgraph cluster_28 { - color=blue - 101 [label="Enter when branch condition else"]; - 102 [label="Exit when branch condition"]; - } - 103 [label="Enter when branch result"]; - subgraph cluster_29 { - color=blue - 104 [label="Enter block"]; - 105 [label="Access variable this@R|/test_4|"]; - 106 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 107 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 108 [label="Access variable this@R|/test_4|"]; - 109 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; - 110 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; - 111 [label="Exit block"]; - } - 112 [label="Exit when branch result"]; - 113 [label="Enter when branch result"]; - subgraph cluster_30 { - color=blue - 114 [label="Enter block"]; - 115 [label="Access variable this@R|/test_4|"]; - 116 [label="Function call: this@R|/test_4|.#()"]; - 117 [label="Function call: #()"]; - 118 [label="Access variable this@R|/test_4|"]; - 119 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 120 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; - 121 [label="Exit block"]; - } - 122 [label="Exit when branch result"]; - 123 [label="Exit when"]; + 87 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 88 [label="Enter when branch condition "]; + 89 [label="Access variable this@R|/test_4|"]; + 90 [label="Type operator: this !is A"]; + 91 [label="Exit when branch condition"]; + } + subgraph cluster_24 { + color=blue + 92 [label="Enter when branch condition else"]; + 93 [label="Exit when branch condition"]; + } + 94 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 95 [label="Enter block"]; + subgraph cluster_26 { + color=blue + 96 [label="Enter when"]; + subgraph cluster_27 { + color=blue + 97 [label="Enter when branch condition "]; + 98 [label="Access variable this@R|/test_4|"]; + 99 [label="Type operator: this !is B"]; + 100 [label="Exit when branch condition"]; + } + subgraph cluster_28 { + color=blue + 101 [label="Enter when branch condition else"]; + 102 [label="Exit when branch condition"]; + } + 103 [label="Enter when branch result"]; + subgraph cluster_29 { + color=blue + 104 [label="Enter block"]; + 105 [label="Access variable this@R|/test_4|"]; + 106 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; + 107 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; + 108 [label="Access variable this@R|/test_4|"]; + 109 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; + 110 [label="Function call: this@R|/test_4|.R|/B.bar|()"]; + 111 [label="Exit block"]; + } + 112 [label="Exit when branch result"]; + 113 [label="Enter when branch result"]; + subgraph cluster_30 { + color=blue + 114 [label="Enter block"]; + 115 [label="Access variable this@R|/test_4|"]; + 116 [label="Function call: this@R|/test_4|.#()"]; + 117 [label="Function call: #()"]; + 118 [label="Access variable this@R|/test_4|"]; + 119 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; + 120 [label="Function call: this@R|/test_4|.R|/A.foo|()"]; + 121 [label="Exit block"]; + } + 122 [label="Exit when branch result"]; + 123 [label="Exit when"]; + } + 124 [label="Exit block"]; + } + 125 [label="Exit when branch result"]; + 126 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 127 [label="Enter block"]; + 128 [label="Access variable this@R|/test_4|"]; + 129 [label="Function call: this@R|/test_4|.#()"]; + 130 [label="Function call: #()"]; + 131 [label="Access variable this@R|/test_4|"]; + 132 [label="Function call: this@R|/test_4|.#()"]; + 133 [label="Function call: #()"]; + 134 [label="Exit block"]; + } + 135 [label="Exit when branch result"]; + 136 [label="Exit when"]; } - 124 [label="Exit block"]; - } - 125 [label="Exit when branch result"]; - 126 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 127 [label="Enter block"]; - 128 [label="Access variable this@R|/test_4|"]; - 129 [label="Function call: this@R|/test_4|.#()"]; - 130 [label="Function call: #()"]; - 131 [label="Access variable this@R|/test_4|"]; - 132 [label="Function call: this@R|/test_4|.#()"]; - 133 [label="Function call: #()"]; - 134 [label="Exit block"]; - } - 135 [label="Exit when branch result"]; - 136 [label="Exit when"]; + 137 [label="Access variable this@R|/test_4|"]; + 138 [label="Function call: this@R|/test_4|.#()"]; + 139 [label="Function call: #()"]; + 140 [label="Access variable this@R|/test_4|"]; + 141 [label="Function call: this@R|/test_4|.#()"]; + 142 [label="Function call: #()"]; + 143 [label="Exit function test_4" style="filled" fillcolor=red]; } - 137 [label="Access variable this@R|/test_4|"]; - 138 [label="Function call: this@R|/test_4|.#()"]; - 139 [label="Function call: #()"]; - 140 [label="Access variable this@R|/test_4|"]; - 141 [label="Function call: this@R|/test_4|.#()"]; - 142 [label="Function call: #()"]; - 143 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {126 92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {113 101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {123}; - 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 -> {136}; - 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}; - 140 -> {141}; - 141 -> {142}; - 142 -> {143}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {126 92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {113 101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {123}; + 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 -> {136}; + 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}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; - subgraph cluster_32 { - color=red - 144 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_33 { - color=blue - 145 [label="Enter when"]; - subgraph cluster_34 { - color=blue - 146 [label="Enter when branch condition "]; - 147 [label="Access variable this@R|/test_5|"]; - 148 [label="Type operator: this is List<*>"]; - 149 [label="Exit when branch condition"]; - } - subgraph cluster_35 { - color=blue - 150 [label="Enter when branch condition "]; - 151 [label="Access variable this@R|/test_5|"]; - 152 [label="Type operator: this is String"]; - 153 [label="Exit when branch condition"]; - } - subgraph cluster_36 { - color=blue - 154 [label="Enter when branch condition else"]; - 155 [label="Exit when branch condition"]; - } - 156 [label="Enter when branch result"]; - subgraph cluster_37 { - color=blue - 157 [label="Enter block"]; - 158 [label="Const: Int(0)"]; - 159 [label="Exit block"]; - } - 160 [label="Exit when branch result"]; - 161 [label="Enter when branch result"]; - subgraph cluster_38 { - color=blue - 162 [label="Enter block"]; - 163 [label="Access variable R|kotlin/String.length|"]; - 164 [label="Exit block"]; - } - 165 [label="Exit when branch result"]; - 166 [label="Enter when branch result"]; - subgraph cluster_39 { - color=blue - 167 [label="Enter block"]; - 168 [label="Access variable R|kotlin/collections/List.size|"]; - 169 [label="Exit block"]; - } - 170 [label="Exit when branch result"]; - 171 [label="Exit when"]; - } - 172 [label="Jump: ^test_5 when () { + subgraph cluster_32 { + color=red + 144 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_33 { + color=blue + 145 [label="Enter when"]; + subgraph cluster_34 { + color=blue + 146 [label="Enter when branch condition "]; + 147 [label="Access variable this@R|/test_5|"]; + 148 [label="Type operator: this is List<*>"]; + 149 [label="Exit when branch condition"]; + } + subgraph cluster_35 { + color=blue + 150 [label="Enter when branch condition "]; + 151 [label="Access variable this@R|/test_5|"]; + 152 [label="Type operator: this is String"]; + 153 [label="Exit when branch condition"]; + } + subgraph cluster_36 { + color=blue + 154 [label="Enter when branch condition else"]; + 155 [label="Exit when branch condition"]; + } + 156 [label="Enter when branch result"]; + subgraph cluster_37 { + color=blue + 157 [label="Enter block"]; + 158 [label="Const: Int(0)"]; + 159 [label="Exit block"]; + } + 160 [label="Exit when branch result"]; + 161 [label="Enter when branch result"]; + subgraph cluster_38 { + color=blue + 162 [label="Enter block"]; + 163 [label="Access variable R|kotlin/String.length|"]; + 164 [label="Exit block"]; + } + 165 [label="Exit when branch result"]; + 166 [label="Enter when branch result"]; + subgraph cluster_39 { + color=blue + 167 [label="Enter block"]; + 168 [label="Access variable R|kotlin/collections/List.size|"]; + 169 [label="Exit block"]; + } + 170 [label="Exit when branch result"]; + 171 [label="Exit when"]; + } + 172 [label="Jump: ^test_5 when () { (this@R|/test_5| is R|kotlin/collections/List<*>|) -> { this@R|/test_5|.R|kotlin/collections/List.size| } @@ -487,60 +487,60 @@ digraph implicitReceivers_kt { } } "]; - 173 [label="Stub" style="filled" fillcolor=gray]; - 174 [label="Exit function test_5" style="filled" fillcolor=red]; - } + 173 [label="Stub" style="filled" fillcolor=gray]; + 174 [label="Exit function test_5" style="filled" fillcolor=red]; + } - 144 -> {145}; - 145 -> {146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {149}; - 149 -> {166 150}; - 150 -> {151}; - 151 -> {152}; - 152 -> {153}; - 153 -> {161 154}; - 154 -> {155}; - 155 -> {156}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159}; - 159 -> {160}; - 160 -> {171}; - 161 -> {162}; - 162 -> {163}; - 163 -> {164}; - 164 -> {165}; - 165 -> {171}; - 166 -> {167}; - 167 -> {168}; - 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {174}; - 172 -> {173} [style=dotted]; - 173 -> {174} [style=dotted]; + 144 -> {145}; + 145 -> {146}; + 146 -> {147}; + 147 -> {148}; + 148 -> {149}; + 149 -> {166 150}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {161 154}; + 154 -> {155}; + 155 -> {156}; + 156 -> {157}; + 157 -> {158}; + 158 -> {159}; + 159 -> {160}; + 160 -> {171}; + 161 -> {162}; + 162 -> {163}; + 163 -> {164}; + 164 -> {165}; + 165 -> {171}; + 166 -> {167}; + 167 -> {168}; + 168 -> {169}; + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {174}; + 172 -> {173} [style=dotted]; + 173 -> {174} [style=dotted]; - subgraph cluster_40 { - color=red - 175 [label="Enter function test_6" style="filled" fillcolor=red]; - 176 [label="Access variable this@R|/test_6|"]; - 177 [label="Type operator: this as List<*>"]; - 178 [label="Access variable R|kotlin/collections/List.size|"]; - 179 [label="Access variable this@R|/test_6|"]; - 180 [label="Type operator: this as String"]; - 181 [label="Access variable R|kotlin/String.length|"]; - 182 [label="Exit function test_6" style="filled" fillcolor=red]; - } + subgraph cluster_40 { + color=red + 175 [label="Enter function test_6" style="filled" fillcolor=red]; + 176 [label="Access variable this@R|/test_6|"]; + 177 [label="Type operator: this as List<*>"]; + 178 [label="Access variable R|kotlin/collections/List.size|"]; + 179 [label="Access variable this@R|/test_6|"]; + 180 [label="Type operator: this as String"]; + 181 [label="Access variable R|kotlin/String.length|"]; + 182 [label="Exit function test_6" style="filled" fillcolor=red]; + } - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; - 178 -> {179}; - 179 -> {180}; - 180 -> {181}; - 181 -> {182}; + 175 -> {176}; + 176 -> {177}; + 177 -> {178}; + 178 -> {179}; + 179 -> {180}; + 180 -> {181}; + 181 -> {182}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot b/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot index 2481e054886..03b412c9035 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/inPlaceLambdas.dot @@ -1,179 +1,179 @@ digraph inPlaceLambdas_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function bar" style="filled" fillcolor=red]; - 3 [label="Exit function bar" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function bar" style="filled" fillcolor=red]; + 3 [label="Exit function bar" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter function run" style="filled" fillcolor=red]; - 5 [label="Function call: R|/block|.R|FakeOverride|()"]; - 6 [label="Exit function run" style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter 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}; + 4 -> {5}; + 5 -> {6}; - subgraph cluster_3 { - color=red - 7 [label="Enter function test_1" style="filled" fillcolor=red]; - 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"]; - subgraph cluster_7 { - color=blue - 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"]; - } - 20 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + subgraph cluster_3 { + color=red + 7 [label="Enter function test_1" style="filled" fillcolor=red]; + 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"]; + subgraph cluster_7 { + color=blue + 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"]; + } + 20 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|/A.foo|() } )"]; - 21 [label="Exit block"]; - } - 22 [label="Exit when branch result"]; - 23 [label="Exit when"]; + 21 [label="Exit block"]; + } + 22 [label="Exit when branch result"]; + 23 [label="Exit when"]; + } + 24 [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 -> {14 13}; - 13 -> {23}; - 14 -> {15}; - 15 -> {16}; - 16 -> {19 17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {16 20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {14 13}; + 13 -> {23}; + 14 -> {15}; + 15 -> {16}; + 16 -> {19 17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {16 20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; - subgraph cluster_8 { - color=red - 25 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_9 { - color=blue - 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| { + subgraph cluster_8 { + color=red + 25 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_9 { + color=blue + 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|) } )"]; - 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]; - } + 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}; + 25 -> {26}; + 26 -> {29 27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {26 30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; - subgraph cluster_10 { - color=red - 34 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_11 { - color=blue - 35 [label="Enter when"]; - subgraph cluster_12 { - color=blue - 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 - 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"]; - } - 49 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { + subgraph cluster_10 { + color=red + 34 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_11 { + color=blue + 35 [label="Enter when"]; + subgraph cluster_12 { + color=blue + 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 + 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"]; + } + 49 [label="Function call: R|/run|( = run@fun (): R|kotlin/Unit| { R|/x|.R|/A.foo|() (R|/x| as R|B|) } )"]; - 50 [label="Access variable R|/x|"]; - 51 [label="Function call: R|/x|.R|/B.bar|()"]; - 52 [label="Exit block"]; - } - 53 [label="Exit when branch result"]; - 54 [label="Exit when"]; + 50 [label="Access variable R|/x|"]; + 51 [label="Function call: R|/x|.R|/B.bar|()"]; + 52 [label="Exit block"]; + } + 53 [label="Exit when branch result"]; + 54 [label="Exit when"]; + } + 55 [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 -> {43 49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; + 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 -> {43 49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/notBoundSmartcasts.dot b/compiler/fir/resolve/testData/resolve/smartcasts/notBoundSmartcasts.dot index af9ad509e67..b368cfa1b22 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/notBoundSmartcasts.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/notBoundSmartcasts.dot @@ -1,339 +1,339 @@ digraph notBoundSmartcasts_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function foo" style="filled" fillcolor=red]; - 3 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function foo" style="filled" fillcolor=red]; + 3 [label="Exit function foo" style="filled" fillcolor=red]; + } - 2 -> {3}; + 2 -> {3}; - subgraph cluster_2 { - color=red - 4 [label="Enter function getAny" style="filled" fillcolor=red]; - 5 [label="Const: Null(null)"]; - 6 [label="Jump: ^getAny Null(null)"]; - 7 [label="Stub" style="filled" fillcolor=gray]; - 8 [label="Exit function getAny" style="filled" fillcolor=red]; - } + subgraph cluster_2 { + color=red + 4 [label="Enter function getAny" style="filled" fillcolor=red]; + 5 [label="Const: Null(null)"]; + 6 [label="Jump: ^getAny Null(null)"]; + 7 [label="Stub" style="filled" fillcolor=gray]; + 8 [label="Exit function getAny" style="filled" fillcolor=red]; + } - 4 -> {5}; - 5 -> {6}; - 6 -> {8}; - 6 -> {7} [style=dotted]; - 7 -> {8} [style=dotted]; + 4 -> {5}; + 5 -> {6}; + 6 -> {8}; + 6 -> {7} [style=dotted]; + 7 -> {8} [style=dotted]; - subgraph cluster_3 { - color=red - 9 [label="Enter function test_0" style="filled" fillcolor=red]; - 10 [label="Function call: R|/getAny|()"]; - 11 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 12 [label="Function call: R|/getAny|()"]; - 13 [label="Variable declaration: lval b: R|kotlin/Any?|"]; - 14 [label="Access variable R|/a|"]; - 15 [label="Type operator: a as A"]; - 16 [label="Access variable R|/a|"]; - 17 [label="Function call: R|/a|.R|/A.foo|()"]; - 18 [label="Access variable R|/b|"]; - 19 [label="Type operator: b as B"]; - 20 [label="Access variable R|/b|"]; - 21 [label="Function call: R|/b|.R|/B.foo|()"]; - 22 [label="Exit function test_0" style="filled" fillcolor=red]; - } + subgraph cluster_3 { + color=red + 9 [label="Enter function test_0" style="filled" fillcolor=red]; + 10 [label="Function call: R|/getAny|()"]; + 11 [label="Variable declaration: lval a: R|kotlin/Any?|"]; + 12 [label="Function call: R|/getAny|()"]; + 13 [label="Variable declaration: lval b: R|kotlin/Any?|"]; + 14 [label="Access variable R|/a|"]; + 15 [label="Type operator: a as A"]; + 16 [label="Access variable R|/a|"]; + 17 [label="Function call: R|/a|.R|/A.foo|()"]; + 18 [label="Access variable R|/b|"]; + 19 [label="Type operator: b as B"]; + 20 [label="Access variable R|/b|"]; + 21 [label="Function call: R|/b|.R|/B.foo|()"]; + 22 [label="Exit function test_0" style="filled" fillcolor=red]; + } - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; - subgraph cluster_4 { - color=red - 23 [label="Enter function test_1" style="filled" fillcolor=red]; - 24 [label="Function call: R|/getAny|()"]; - 25 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 26 [label="Function call: R|/getAny|()"]; - 27 [label="Variable declaration: lval b: R|kotlin/Any?|"]; - subgraph cluster_5 { - color=blue - 28 [label="Enter when"]; - subgraph cluster_6 { - color=blue - 29 [label="Enter when branch condition "]; - subgraph cluster_7 { - color=blue - 30 [label="Enter &&"]; - 31 [label="Access variable R|/a|"]; - 32 [label="Type operator: a is A"]; - 33 [label="Exit left part of &&"]; - 34 [label="Enter right part of &&"]; - 35 [label="Access variable R|/b|"]; - 36 [label="Type operator: b is B"]; - 37 [label="Exit &&"]; + subgraph cluster_4 { + color=red + 23 [label="Enter function test_1" style="filled" fillcolor=red]; + 24 [label="Function call: R|/getAny|()"]; + 25 [label="Variable declaration: lval a: R|kotlin/Any?|"]; + 26 [label="Function call: R|/getAny|()"]; + 27 [label="Variable declaration: lval b: R|kotlin/Any?|"]; + subgraph cluster_5 { + color=blue + 28 [label="Enter when"]; + subgraph cluster_6 { + color=blue + 29 [label="Enter when branch condition "]; + subgraph cluster_7 { + color=blue + 30 [label="Enter &&"]; + 31 [label="Access variable R|/a|"]; + 32 [label="Type operator: a is A"]; + 33 [label="Exit left part of &&"]; + 34 [label="Enter right part of &&"]; + 35 [label="Access variable R|/b|"]; + 36 [label="Type operator: b is B"]; + 37 [label="Exit &&"]; + } + 38 [label="Exit when branch condition"]; + } + 39 [label="Synthetic else branch"]; + 40 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 41 [label="Enter block"]; + 42 [label="Access variable R|/a|"]; + 43 [label="Function call: R|/a|.R|/A.foo|()"]; + 44 [label="Access variable R|/b|"]; + 45 [label="Function call: R|/b|.R|/B.foo|()"]; + 46 [label="Exit block"]; + } + 47 [label="Exit when branch result"]; + 48 [label="Exit when"]; } - 38 [label="Exit when branch condition"]; - } - 39 [label="Synthetic else branch"]; - 40 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 41 [label="Enter block"]; - 42 [label="Access variable R|/a|"]; - 43 [label="Function call: R|/a|.R|/A.foo|()"]; - 44 [label="Access variable R|/b|"]; - 45 [label="Function call: R|/b|.R|/B.foo|()"]; - 46 [label="Exit block"]; - } - 47 [label="Exit when branch result"]; - 48 [label="Exit when"]; + 49 [label="Exit function test_1" style="filled" fillcolor=red]; } - 49 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {37 34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {40 39}; - 39 -> {48}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {37 34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {40 39}; + 39 -> {48}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; - subgraph cluster_9 { - color=red - 50 [label="Enter function " style="filled" fillcolor=red]; - 51 [label="Exit function " style="filled" fillcolor=red]; - } - - 50 -> {51}; - - subgraph cluster_10 { - color=red - 52 [label="Enter function getter" style="filled" fillcolor=red]; - 53 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 52 -> {53}; - - subgraph cluster_11 { - color=red - 54 [label="Enter property" style="filled" fillcolor=red]; - 55 [label="Access variable R|/any|"]; - 56 [label="Exit property" style="filled" fillcolor=red]; - } - - 54 -> {55}; - 55 -> {56}; - - subgraph cluster_12 { - color=red - 57 [label="Enter function baz" style="filled" fillcolor=red]; - 58 [label="Exit function baz" style="filled" fillcolor=red]; - } - - 57 -> {58}; - - subgraph cluster_13 { - color=red - 59 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_14 { - color=blue - 60 [label="Enter when"]; - 61 [label="Access variable R|/d|"]; - 62 [label="Access variable R|/D.any|"]; - 63 [label="Variable declaration: lval : R|kotlin/Any?|"]; - subgraph cluster_15 { - color=blue - 64 [label="Enter when branch condition "]; - 65 [label="Const: Null(null)"]; - 66 [label="Operator =="]; - 67 [label="Exit when branch condition"]; - } - subgraph cluster_16 { - color=blue - 68 [label="Enter when branch condition else"]; - 69 [label="Exit when branch condition"]; - } - 70 [label="Enter when branch result"]; - subgraph cluster_17 { - color=blue - 71 [label="Enter block"]; - 72 [label="Access variable R|/|"]; - 73 [label="Exit block"]; - } - 74 [label="Exit when branch result"]; - 75 [label="Enter when branch result"]; - subgraph cluster_18 { - color=blue - 76 [label="Enter block"]; - 77 [label="Jump: ^test_2 Unit"]; - 78 [label="Stub" style="filled" fillcolor=gray]; - 79 [label="Exit block" style="filled" fillcolor=gray]; - } - 80 [label="Exit when branch result" style="filled" fillcolor=gray]; - 81 [label="Exit when"]; + subgraph cluster_9 { + color=red + 50 [label="Enter function " style="filled" fillcolor=red]; + 51 [label="Exit function " style="filled" fillcolor=red]; } - 82 [label="Variable declaration: lval a: R|kotlin/Any|"]; - 83 [label="Access variable R|/a|"]; - 84 [label="Function call: R|/a|.R|/baz|()"]; - 85 [label="Access variable R|/d|"]; - 86 [label="Access variable R|/D.any|"]; - 87 [label="Function call: R|/d|.R|/D.any|.R|/baz|()"]; - 88 [label="Access variable R|/a|"]; - 89 [label="Type operator: a as A"]; - 90 [label="Access variable R|/a|"]; - 91 [label="Function call: R|/a|.R|/A.foo|()"]; - 92 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {75 68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {81}; - 75 -> {76}; - 76 -> {77}; - 77 -> {92}; - 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {80} [style=dotted]; - 80 -> {81} [style=dotted]; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; + 50 -> {51}; - subgraph cluster_19 { - color=red - 93 [label="Enter function test_3" style="filled" fillcolor=red]; - 94 [label="Access variable R|/d1|"]; - 95 [label="Access variable R|/D.any|"]; - 96 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 97 [label="Access variable R|/a|"]; - 98 [label="Type operator: a as A"]; - 99 [label="Access variable R|/a|"]; - 100 [label="Function call: R|/a|.R|/A.foo|()"]; - 101 [label="Access variable R|/d1|"]; - 102 [label="Access variable R|/D.any|"]; - 103 [label="Function call: R|/d1|.R|/D.any|.R|/A.foo|()"]; - 104 [label="Access variable R|/d1|"]; - 105 [label="Access variable R|/D.any|"]; - 106 [label="Function call: R|/d1|.R|/D.any|.R|/baz|()"]; - 107 [label="Exit function test_3" style="filled" fillcolor=red]; - } + subgraph cluster_10 { + color=red + 52 [label="Enter function getter" style="filled" fillcolor=red]; + 53 [label="Exit function getter" style="filled" fillcolor=red]; + } - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; + 52 -> {53}; - subgraph cluster_20 { - color=red - 108 [label="Enter function test_4" style="filled" fillcolor=red]; - 109 [label="Access variable R|/d1|"]; - 110 [label="Enter safe call"]; - 111 [label="Access variable R|/D.any|"]; - 112 [label="Exit safe call"]; - 113 [label="Variable declaration: lval a: R|kotlin/Any?|"]; - 114 [label="Access variable R|/d2|"]; - 115 [label="Enter safe call"]; - 116 [label="Access variable R|/D.any|"]; - 117 [label="Exit safe call"]; - 118 [label="Variable declaration: lval b: R|kotlin/Any?|"]; - 119 [label="Access variable R|/a|"]; - 120 [label="Type operator: a as A"]; - 121 [label="Access variable R|/a|"]; - 122 [label="Function call: R|/a|.R|/A.foo|()"]; - 123 [label="Access variable R|/b|"]; - 124 [label="Type operator: b as B"]; - 125 [label="Access variable R|/b|"]; - 126 [label="Function call: R|/b|.R|/B.foo|()"]; - 127 [label="Exit function test_4" style="filled" fillcolor=red]; - } + subgraph cluster_11 { + color=red + 54 [label="Enter property" style="filled" fillcolor=red]; + 55 [label="Access variable R|/any|"]; + 56 [label="Exit property" style="filled" fillcolor=red]; + } - 108 -> {109}; - 109 -> {110 112}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115 117}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; + 54 -> {55}; + 55 -> {56}; + + subgraph cluster_12 { + color=red + 57 [label="Enter function baz" style="filled" fillcolor=red]; + 58 [label="Exit function baz" style="filled" fillcolor=red]; + } + + 57 -> {58}; + + subgraph cluster_13 { + color=red + 59 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_14 { + color=blue + 60 [label="Enter when"]; + 61 [label="Access variable R|/d|"]; + 62 [label="Access variable R|/D.any|"]; + 63 [label="Variable declaration: lval : R|kotlin/Any?|"]; + subgraph cluster_15 { + color=blue + 64 [label="Enter when branch condition "]; + 65 [label="Const: Null(null)"]; + 66 [label="Operator =="]; + 67 [label="Exit when branch condition"]; + } + subgraph cluster_16 { + color=blue + 68 [label="Enter when branch condition else"]; + 69 [label="Exit when branch condition"]; + } + 70 [label="Enter when branch result"]; + subgraph cluster_17 { + color=blue + 71 [label="Enter block"]; + 72 [label="Access variable R|/|"]; + 73 [label="Exit block"]; + } + 74 [label="Exit when branch result"]; + 75 [label="Enter when branch result"]; + subgraph cluster_18 { + color=blue + 76 [label="Enter block"]; + 77 [label="Jump: ^test_2 Unit"]; + 78 [label="Stub" style="filled" fillcolor=gray]; + 79 [label="Exit block" style="filled" fillcolor=gray]; + } + 80 [label="Exit when branch result" style="filled" fillcolor=gray]; + 81 [label="Exit when"]; + } + 82 [label="Variable declaration: lval a: R|kotlin/Any|"]; + 83 [label="Access variable R|/a|"]; + 84 [label="Function call: R|/a|.R|/baz|()"]; + 85 [label="Access variable R|/d|"]; + 86 [label="Access variable R|/D.any|"]; + 87 [label="Function call: R|/d|.R|/D.any|.R|/baz|()"]; + 88 [label="Access variable R|/a|"]; + 89 [label="Type operator: a as A"]; + 90 [label="Access variable R|/a|"]; + 91 [label="Function call: R|/a|.R|/A.foo|()"]; + 92 [label="Exit function test_2" style="filled" fillcolor=red]; + } + + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {75 68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {81}; + 75 -> {76}; + 76 -> {77}; + 77 -> {92}; + 77 -> {78} [style=dotted]; + 78 -> {79} [style=dotted]; + 79 -> {80} [style=dotted]; + 80 -> {81} [style=dotted]; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + + subgraph cluster_19 { + color=red + 93 [label="Enter function test_3" style="filled" fillcolor=red]; + 94 [label="Access variable R|/d1|"]; + 95 [label="Access variable R|/D.any|"]; + 96 [label="Variable declaration: lval a: R|kotlin/Any?|"]; + 97 [label="Access variable R|/a|"]; + 98 [label="Type operator: a as A"]; + 99 [label="Access variable R|/a|"]; + 100 [label="Function call: R|/a|.R|/A.foo|()"]; + 101 [label="Access variable R|/d1|"]; + 102 [label="Access variable R|/D.any|"]; + 103 [label="Function call: R|/d1|.R|/D.any|.R|/A.foo|()"]; + 104 [label="Access variable R|/d1|"]; + 105 [label="Access variable R|/D.any|"]; + 106 [label="Function call: R|/d1|.R|/D.any|.R|/baz|()"]; + 107 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + + subgraph cluster_20 { + color=red + 108 [label="Enter function test_4" style="filled" fillcolor=red]; + 109 [label="Access variable R|/d1|"]; + 110 [label="Enter safe call"]; + 111 [label="Access variable R|/D.any|"]; + 112 [label="Exit safe call"]; + 113 [label="Variable declaration: lval a: R|kotlin/Any?|"]; + 114 [label="Access variable R|/d2|"]; + 115 [label="Enter safe call"]; + 116 [label="Access variable R|/D.any|"]; + 117 [label="Exit safe call"]; + 118 [label="Variable declaration: lval b: R|kotlin/Any?|"]; + 119 [label="Access variable R|/a|"]; + 120 [label="Type operator: a as A"]; + 121 [label="Access variable R|/a|"]; + 122 [label="Function call: R|/a|.R|/A.foo|()"]; + 123 [label="Access variable R|/b|"]; + 124 [label="Type operator: b as B"]; + 125 [label="Access variable R|/b|"]; + 126 [label="Function call: R|/b|.R|/B.foo|()"]; + 127 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 108 -> {109}; + 109 -> {110 112}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115 117}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot index e8aa094c0ab..81f38c43649 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/nullability.dot @@ -1,1413 +1,1413 @@ digraph nullability_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function getA" style="filled" fillcolor=red]; - 3 [label="Exit function getA" style="filled" fillcolor=red]; - } - - 2 -> {3}; - - subgraph cluster_2 { - color=red - 4 [label="Enter function getter" style="filled" fillcolor=red]; - 5 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 4 -> {5}; - - subgraph cluster_3 { - color=red - 6 [label="Enter property" style="filled" fillcolor=red]; - 7 [label="Exit property" style="filled" fillcolor=red]; - } - - 6 -> {7}; - - subgraph cluster_4 { - color=red - 8 [label="Enter function fs" style="filled" fillcolor=red]; - 9 [label="Exit function fs" style="filled" fillcolor=red]; - } - - 8 -> {9}; - - subgraph cluster_5 { - color=red - 10 [label="Enter function getter" style="filled" fillcolor=red]; - 11 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 10 -> {11}; - - subgraph cluster_6 { - color=red - 12 [label="Enter property" style="filled" fillcolor=red]; - 13 [label="Exit property" style="filled" fillcolor=red]; - } - - 12 -> {13}; - - subgraph cluster_7 { - color=red - 14 [label="Enter function fdata" style="filled" fillcolor=red]; - 15 [label="Exit function fdata" style="filled" fillcolor=red]; - } - - 14 -> {15}; - - subgraph cluster_8 { - color=red - 16 [label="Enter function " style="filled" fillcolor=red]; - 17 [label="Exit function " style="filled" fillcolor=red]; - } - - 16 -> {17}; - - subgraph cluster_9 { - color=red - 18 [label="Enter function getter" style="filled" fillcolor=red]; - 19 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 18 -> {19}; - - subgraph cluster_10 { - color=red - 20 [label="Enter property" style="filled" fillcolor=red]; - 21 [label="Access variable R|/data|"]; - 22 [label="Exit property" style="filled" fillcolor=red]; - } - - 20 -> {21}; - 21 -> {22}; - - subgraph cluster_11 { - color=red - 23 [label="Enter function fdata" style="filled" fillcolor=red]; - 24 [label="Const: Null(null)"]; - 25 [label="Jump: ^fdata Null(null)"]; - 26 [label="Stub" style="filled" fillcolor=gray]; - 27 [label="Exit function fdata" style="filled" fillcolor=red]; - } - - 23 -> {24}; - 24 -> {25}; - 25 -> {27}; - 25 -> {26} [style=dotted]; - 26 -> {27} [style=dotted]; - - subgraph cluster_12 { - color=red - 28 [label="Enter function " style="filled" fillcolor=red]; - 29 [label="Exit function " style="filled" fillcolor=red]; - } - - 28 -> {29}; - - subgraph cluster_13 { - color=red - 30 [label="Enter function getter" style="filled" fillcolor=red]; - 31 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 30 -> {31}; - - subgraph cluster_14 { - color=red - 32 [label="Enter function setter" style="filled" fillcolor=red]; - 33 [label="Exit function setter" style="filled" fillcolor=red]; - } - - 32 -> {33}; - - subgraph cluster_15 { - color=red - 34 [label="Enter property" style="filled" fillcolor=red]; - 35 [label="Access variable R|/data|"]; - 36 [label="Exit property" style="filled" fillcolor=red]; - } - - 34 -> {35}; - 35 -> {36}; - - subgraph cluster_16 { - color=red - 37 [label="Enter function fdata" style="filled" fillcolor=red]; - 38 [label="Const: Null(null)"]; - 39 [label="Jump: ^fdata Null(null)"]; - 40 [label="Stub" style="filled" fillcolor=gray]; - 41 [label="Exit function fdata" style="filled" fillcolor=red]; - } - - 37 -> {38}; - 38 -> {39}; - 39 -> {41}; - 39 -> {40} [style=dotted]; - 40 -> {41} [style=dotted]; - - subgraph cluster_17 { - color=red - 42 [label="Enter function " style="filled" fillcolor=red]; - 43 [label="Exit function " style="filled" fillcolor=red]; - } - - 42 -> {43}; - - subgraph cluster_18 { - color=red - 44 [label="Enter function getter" style="filled" fillcolor=red]; - 45 [label="Const: Null(null)"]; - 46 [label="Jump: ^ Null(null)"]; - 47 [label="Stub" style="filled" fillcolor=gray]; - 48 [label="Exit function getter" style="filled" fillcolor=red]; - } - - 44 -> {45}; - 45 -> {46}; - 46 -> {48}; - 46 -> {47} [style=dotted]; - 47 -> {48} [style=dotted]; - - subgraph cluster_19 { - color=red - 49 [label="Enter property" style="filled" fillcolor=red]; - 50 [label="Exit property" style="filled" fillcolor=red]; - } - - 49 -> {50}; - - subgraph cluster_20 { - color=red - 51 [label="Enter function fdata" style="filled" fillcolor=red]; - 52 [label="Const: Null(null)"]; - 53 [label="Jump: ^fdata Null(null)"]; - 54 [label="Stub" style="filled" fillcolor=gray]; - 55 [label="Exit function fdata" style="filled" fillcolor=red]; - } - - 51 -> {52}; - 52 -> {53}; - 53 -> {55}; - 53 -> {54} [style=dotted]; - 54 -> {55} [style=dotted]; - - subgraph cluster_21 { - color=red - 56 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_22 { - color=blue - 57 [label="Enter when"]; - subgraph cluster_23 { - color=blue - 58 [label="Enter when branch condition "]; - 59 [label="Access variable R|/x|"]; - 60 [label="Const: Null(null)"]; - 61 [label="Operator !="]; - 62 [label="Exit when branch condition"]; - } - subgraph cluster_24 { - color=blue - 63 [label="Enter when branch condition else"]; - 64 [label="Exit when branch condition"]; - } - 65 [label="Enter when branch result"]; - subgraph cluster_25 { - color=blue - 66 [label="Enter block"]; - 67 [label="Access variable R|/x|"]; - 68 [label="Function call: R|/x|.#()"]; - 69 [label="Exit block"]; - } - 70 [label="Exit when branch result"]; - 71 [label="Enter when branch result"]; - subgraph cluster_26 { - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - 78 [label="Access variable R|/x|"]; - 79 [label="Function call: R|/x|.#()"]; - 80 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {62}; - 62 -> {71 63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {77}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; + 0 -> {1}; - subgraph cluster_27 { - color=red - 81 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_28 { - color=blue - 82 [label="Enter when"]; - subgraph cluster_29 { - color=blue - 83 [label="Enter when branch condition "]; - 84 [label="Access variable R|/x|"]; - 85 [label="Const: Null(null)"]; - 86 [label="Operator =="]; - 87 [label="Exit when branch condition"]; - } - subgraph cluster_30 { - color=blue - 88 [label="Enter when branch condition else"]; - 89 [label="Exit when branch condition"]; - } - 90 [label="Enter when branch result"]; - subgraph cluster_31 { - color=blue - 91 [label="Enter block"]; - 92 [label="Access variable R|/x|"]; - 93 [label="Function call: R|/x|.R|/A.foo|()"]; - 94 [label="Exit block"]; - } - 95 [label="Exit when branch result"]; - 96 [label="Enter when branch result"]; - subgraph cluster_32 { - color=blue - 97 [label="Enter block"]; - 98 [label="Access variable R|/x|"]; - 99 [label="Function call: R|/x|.#()"]; - 100 [label="Exit block"]; - } - 101 [label="Exit when branch result"]; - 102 [label="Exit when"]; + subgraph cluster_1 { + color=red + 2 [label="Enter function getA" style="filled" fillcolor=red]; + 3 [label="Exit function getA" style="filled" fillcolor=red]; } - 103 [label="Access variable R|/x|"]; - 104 [label="Function call: R|/x|.#()"]; - 105 [label="Exit function test_2" style="filled" fillcolor=red]; - } - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {96 88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {102}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; + 2 -> {3}; - subgraph cluster_33 { - color=red - 106 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_34 { - color=blue - 107 [label="Enter when"]; - 108 [label="Access variable R|/x|"]; - 109 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_35 { - color=blue - 110 [label="Enter when branch condition "]; - 111 [label="Const: Null(null)"]; - 112 [label="Operator =="]; - 113 [label="Exit when branch condition"]; - } - subgraph cluster_36 { - color=blue - 114 [label="Enter when branch condition else"]; - 115 [label="Exit when branch condition"]; - } - 116 [label="Enter when branch result"]; - subgraph cluster_37 { - color=blue - 117 [label="Enter block"]; - 118 [label="Access variable R|/|"]; - 119 [label="Exit block"]; - } - 120 [label="Exit when branch result"]; - 121 [label="Enter when branch result"]; - subgraph cluster_38 { - color=blue - 122 [label="Enter block"]; - 123 [label="Jump: ^test_3 Unit"]; - 124 [label="Stub" style="filled" fillcolor=gray]; - 125 [label="Exit block" style="filled" fillcolor=gray]; - } - 126 [label="Exit when branch result" style="filled" fillcolor=gray]; - 127 [label="Exit when"]; + subgraph cluster_2 { + color=red + 4 [label="Enter function getter" style="filled" fillcolor=red]; + 5 [label="Exit function getter" style="filled" fillcolor=red]; } - 128 [label="Access variable R|/x|"]; - 129 [label="Function call: R|/x|.R|/A.foo|()"]; - 130 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {121 114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {127}; - 121 -> {122}; - 122 -> {123}; - 123 -> {130}; - 123 -> {124} [style=dotted]; - 124 -> {125} [style=dotted]; - 125 -> {126} [style=dotted]; - 126 -> {127} [style=dotted]; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; + 4 -> {5}; - subgraph cluster_39 { - color=red - 131 [label="Enter function test_4" style="filled" fillcolor=red]; - 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|/x|"]; - 135 [label="Enter safe call"]; - 136 [label="Function call: R|/x|?.R|/A.getA|()"]; - 137 [label="Exit safe call"]; - 138 [label="Const: Null(null)"]; - 139 [label="Operator =="]; - 140 [label="Exit when branch condition"]; - } - 141 [label="Synthetic else branch"]; - 142 [label="Enter when branch result"]; - subgraph cluster_42 { - color=blue - 143 [label="Enter block"]; - 144 [label="Jump: ^test_4 Unit"]; - 145 [label="Stub" style="filled" fillcolor=gray]; - 146 [label="Exit block" style="filled" fillcolor=gray]; - } - 147 [label="Exit when branch result" style="filled" fillcolor=gray]; - 148 [label="Exit when"]; + subgraph cluster_3 { + color=red + 6 [label="Enter property" style="filled" fillcolor=red]; + 7 [label="Exit property" style="filled" fillcolor=red]; } - 149 [label="Access variable R|/x|"]; - 150 [label="Function call: R|/x|.R|/A.foo|()"]; - 151 [label="Exit function test_4" style="filled" fillcolor=red]; - } - 131 -> {132}; - 132 -> {133}; - 133 -> {134}; - 134 -> {135 137}; - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; - 138 -> {139}; - 139 -> {140}; - 140 -> {142 141}; - 141 -> {148}; - 142 -> {143}; - 143 -> {144}; - 144 -> {151}; - 144 -> {145} [style=dotted]; - 145 -> {146} [style=dotted]; - 146 -> {147} [style=dotted]; - 147 -> {148} [style=dotted]; - 148 -> {149}; - 149 -> {150}; - 150 -> {151}; + 6 -> {7}; - subgraph cluster_43 { - color=red - 152 [label="Enter function test_5" style="filled" fillcolor=red]; - subgraph cluster_44 { - color=blue - 153 [label="Enter when"]; - subgraph cluster_45 { - color=blue - 154 [label="Enter when branch condition "]; - 155 [label="Access variable R|/q|"]; - 156 [label="Enter safe call"]; - 157 [label="Access variable R|/Q.data|"]; - 158 [label="Exit safe call"]; - 159 [label="Enter safe call"]; - 160 [label="Access variable R|/MyData.s|"]; - 161 [label="Exit safe call"]; - 162 [label="Enter safe call"]; - 163 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 164 [label="Exit safe call"]; - 165 [label="Const: Null(null)"]; - 166 [label="Operator !="]; - 167 [label="Exit when branch condition"]; - } - 168 [label="Synthetic else branch"]; - 169 [label="Enter when branch result"]; - subgraph cluster_46 { - color=blue - 170 [label="Enter block"]; - 171 [label="Access variable R|/q|"]; - 172 [label="Access variable R|/Q.data|"]; - 173 [label="Access variable R|/q|"]; - 174 [label="Access variable R|/Q.data|"]; - 175 [label="Access variable R|/MyData.s|"]; - 176 [label="Access variable R|/q|"]; - 177 [label="Access variable R|/Q.data|"]; - 178 [label="Access variable R|/MyData.s|"]; - 179 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 180 [label="Exit block"]; - } - 181 [label="Exit when branch result"]; - 182 [label="Exit when"]; + subgraph cluster_4 { + color=red + 8 [label="Enter function fs" style="filled" fillcolor=red]; + 9 [label="Exit function fs" style="filled" fillcolor=red]; } - 183 [label="Exit function test_5" style="filled" fillcolor=red]; - } - 152 -> {153}; - 153 -> {154}; - 154 -> {155}; - 155 -> {156 158}; - 156 -> {157}; - 157 -> {158}; - 158 -> {159 161}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162 164}; - 162 -> {163}; - 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - 166 -> {167}; - 167 -> {169 168}; - 168 -> {182}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {173}; - 173 -> {174}; - 174 -> {175}; - 175 -> {176}; - 176 -> {177}; - 177 -> {178}; - 178 -> {179}; - 179 -> {180}; - 180 -> {181}; - 181 -> {182}; - 182 -> {183}; + 8 -> {9}; - subgraph cluster_47 { - color=red - 184 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_48 { - color=blue - 185 [label="Enter when"]; - 186 [label="Access variable R|/q|"]; - 187 [label="Enter safe call"]; - 188 [label="Access variable R|/Q.data|"]; - 189 [label="Exit safe call"]; - 190 [label="Enter safe call"]; - 191 [label="Access variable R|/MyData.s|"]; - 192 [label="Exit safe call"]; - 193 [label="Enter safe call"]; - 194 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 195 [label="Exit safe call"]; - 196 [label="Variable declaration: lval : R|kotlin/Int?|"]; - subgraph cluster_49 { - color=blue - 197 [label="Enter when branch condition "]; - 198 [label="Const: Null(null)"]; - 199 [label="Operator =="]; - 200 [label="Exit when branch condition"]; - } - subgraph cluster_50 { - color=blue - 201 [label="Enter when branch condition else"]; - 202 [label="Exit when branch condition"]; - } - 203 [label="Enter when branch result"]; - subgraph cluster_51 { - color=blue - 204 [label="Enter block"]; - 205 [label="Access variable R|/|"]; - 206 [label="Exit block"]; - } - 207 [label="Exit when branch result"]; - 208 [label="Enter when branch result"]; - subgraph cluster_52 { - color=blue - 209 [label="Enter block"]; - 210 [label="Jump: ^test_6 Unit"]; - 211 [label="Stub" style="filled" fillcolor=gray]; - 212 [label="Exit block" style="filled" fillcolor=gray]; - } - 213 [label="Exit when branch result" style="filled" fillcolor=gray]; - 214 [label="Exit when"]; + subgraph cluster_5 { + color=red + 10 [label="Enter function getter" style="filled" fillcolor=red]; + 11 [label="Exit function getter" style="filled" fillcolor=red]; } - 215 [label="Access variable R|/q|"]; - 216 [label="Access variable R|/Q.data|"]; - 217 [label="Access variable R|/q|"]; - 218 [label="Access variable R|/Q.data|"]; - 219 [label="Access variable R|/MyData.s|"]; - 220 [label="Access variable R|/q|"]; - 221 [label="Access variable R|/Q.data|"]; - 222 [label="Access variable R|/MyData.s|"]; - 223 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 224 [label="Exit function test_6" style="filled" fillcolor=red]; - } - 184 -> {185}; - 185 -> {186}; - 186 -> {187 189}; - 187 -> {188}; - 188 -> {189}; - 189 -> {190 192}; - 190 -> {191}; - 191 -> {192}; - 192 -> {193 195}; - 193 -> {194}; - 194 -> {195}; - 195 -> {196}; - 196 -> {197}; - 197 -> {198}; - 198 -> {199}; - 199 -> {200}; - 200 -> {208 201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {204}; - 204 -> {205}; - 205 -> {206}; - 206 -> {207}; - 207 -> {214}; - 208 -> {209}; - 209 -> {210}; - 210 -> {224}; - 210 -> {211} [style=dotted]; - 211 -> {212} [style=dotted]; - 212 -> {213} [style=dotted]; - 213 -> {214} [style=dotted]; - 214 -> {215}; - 215 -> {216}; - 216 -> {217}; - 217 -> {218}; - 218 -> {219}; - 219 -> {220}; - 220 -> {221}; - 221 -> {222}; - 222 -> {223}; - 223 -> {224}; + 10 -> {11}; - subgraph cluster_53 { - color=red - 225 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_54 { - color=blue - 226 [label="Enter when"]; - subgraph cluster_55 { - color=blue - 227 [label="Enter when branch condition "]; - 228 [label="Access variable R|/q|"]; - 229 [label="Enter safe call"]; - 230 [label="Function call: R|/q|?.R|/Q.fdata|()"]; - 231 [label="Exit safe call"]; - 232 [label="Enter safe call"]; - 233 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()"]; - 234 [label="Exit safe call"]; - 235 [label="Enter safe call"]; - 236 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|()"]; - 237 [label="Exit safe call"]; - 238 [label="Const: Null(null)"]; - 239 [label="Operator !="]; - 240 [label="Exit when branch condition"]; - } - 241 [label="Synthetic else branch"]; - 242 [label="Enter when branch result"]; - subgraph cluster_56 { - color=blue - 243 [label="Enter block"]; - 244 [label="Access variable R|/q|"]; - 245 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 246 [label="Access variable R|/q|"]; - 247 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 248 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 249 [label="Access variable R|/q|"]; - 250 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 251 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 252 [label="Function call: R|/q|.R|/Q.fdata|().#().#()"]; - 253 [label="Exit block"]; - } - 254 [label="Exit when branch result"]; - 255 [label="Exit when"]; + subgraph cluster_6 { + color=red + 12 [label="Enter property" style="filled" fillcolor=red]; + 13 [label="Exit property" style="filled" fillcolor=red]; } - 256 [label="Exit function test_7" style="filled" fillcolor=red]; - } - 225 -> {226}; - 226 -> {227}; - 227 -> {228}; - 228 -> {229 231}; - 229 -> {230}; - 230 -> {231}; - 231 -> {232 234}; - 232 -> {233}; - 233 -> {234}; - 234 -> {235 237}; - 235 -> {236}; - 236 -> {237}; - 237 -> {238}; - 238 -> {239}; - 239 -> {240}; - 240 -> {242 241}; - 241 -> {255}; - 242 -> {243}; - 243 -> {244}; - 244 -> {245}; - 245 -> {246}; - 246 -> {247}; - 247 -> {248}; - 248 -> {249}; - 249 -> {250}; - 250 -> {251}; - 251 -> {252}; - 252 -> {253}; - 253 -> {254}; - 254 -> {255}; - 255 -> {256}; + 12 -> {13}; - subgraph cluster_57 { - color=red - 257 [label="Enter function test_8" style="filled" fillcolor=red]; - subgraph cluster_58 { - color=blue - 258 [label="Enter when"]; - subgraph cluster_59 { - color=blue - 259 [label="Enter when branch condition "]; - 260 [label="Access variable R|/b|"]; - 261 [label="Const: Boolean(true)"]; - 262 [label="Operator =="]; - 263 [label="Exit when branch condition"]; - } - 264 [label="Synthetic else branch"]; - 265 [label="Enter when branch result"]; - subgraph cluster_60 { - color=blue - 266 [label="Enter block"]; - 267 [label="Access variable R|/b|"]; - 268 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; - 269 [label="Exit block"]; - } - 270 [label="Exit when branch result"]; - 271 [label="Exit when"]; + subgraph cluster_7 { + color=red + 14 [label="Enter function fdata" style="filled" fillcolor=red]; + 15 [label="Exit function fdata" style="filled" fillcolor=red]; } - 272 [label="Exit function test_8" style="filled" fillcolor=red]; - } - 257 -> {258}; - 258 -> {259}; - 259 -> {260}; - 260 -> {261}; - 261 -> {262}; - 262 -> {263}; - 263 -> {265 264}; - 264 -> {271}; - 265 -> {266}; - 266 -> {267}; - 267 -> {268}; - 268 -> {269}; - 269 -> {270}; - 270 -> {271}; - 271 -> {272}; + 14 -> {15}; - subgraph cluster_61 { - color=red - 273 [label="Enter function test_9" style="filled" fillcolor=red]; - subgraph cluster_62 { - color=blue - 274 [label="Enter when"]; - subgraph cluster_63 { - color=blue - 275 [label="Enter when branch condition "]; - 276 [label="Access variable R|/a|"]; - 277 [label="Access variable R|/b|"]; - 278 [label="Operator =="]; - 279 [label="Exit when branch condition"]; - } - 280 [label="Synthetic else branch"]; - 281 [label="Enter when branch result"]; - subgraph cluster_64 { - color=blue - 282 [label="Enter block"]; - 283 [label="Access variable R|/b|"]; - 284 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 285 [label="Exit block"]; - } - 286 [label="Exit when branch result"]; - 287 [label="Exit when"]; + subgraph cluster_8 { + color=red + 16 [label="Enter function " style="filled" fillcolor=red]; + 17 [label="Exit function " style="filled" fillcolor=red]; } - 288 [label="Access variable R|/b|"]; - 289 [label="Function call: R|/b|.#()"]; - subgraph cluster_65 { - color=blue - 290 [label="Enter when"]; - subgraph cluster_66 { - color=blue - 291 [label="Enter when branch condition "]; - 292 [label="Access variable R|/a|"]; - 293 [label="Access variable R|/b|"]; - 294 [label="Operator ==="]; - 295 [label="Exit when branch condition"]; - } - 296 [label="Synthetic else branch"]; - 297 [label="Enter when branch result"]; - subgraph cluster_67 { - color=blue - 298 [label="Enter block"]; - 299 [label="Access variable R|/b|"]; - 300 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 301 [label="Exit block"]; - } - 302 [label="Exit when branch result"]; - 303 [label="Exit when"]; - } - 304 [label="Access variable R|/b|"]; - 305 [label="Function call: R|/b|.#()"]; - subgraph cluster_68 { - color=blue - 306 [label="Enter when"]; - subgraph cluster_69 { - color=blue - 307 [label="Enter when branch condition "]; - 308 [label="Access variable R|/b|"]; - 309 [label="Access variable R|/a|"]; - 310 [label="Operator =="]; - 311 [label="Exit when branch condition"]; - } - 312 [label="Synthetic else branch"]; - 313 [label="Enter when branch result"]; - subgraph cluster_70 { - color=blue - 314 [label="Enter block"]; - 315 [label="Access variable R|/b|"]; - 316 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 317 [label="Exit block"]; - } - 318 [label="Exit when branch result"]; - 319 [label="Exit when"]; - } - 320 [label="Access variable R|/b|"]; - 321 [label="Function call: R|/b|.#()"]; - subgraph cluster_71 { - color=blue - 322 [label="Enter when"]; - subgraph cluster_72 { - color=blue - 323 [label="Enter when branch condition "]; - 324 [label="Access variable R|/b|"]; - 325 [label="Access variable R|/a|"]; - 326 [label="Operator ==="]; - 327 [label="Exit when branch condition"]; - } - 328 [label="Synthetic else branch"]; - 329 [label="Enter when branch result"]; - subgraph cluster_73 { - color=blue - 330 [label="Enter block"]; - 331 [label="Access variable R|/b|"]; - 332 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; - 333 [label="Exit block"]; - } - 334 [label="Exit when branch result"]; - 335 [label="Exit when"]; - } - 336 [label="Access variable R|/b|"]; - 337 [label="Function call: R|/b|.#()"]; - 338 [label="Exit function test_9" style="filled" fillcolor=red]; - } - 273 -> {274}; - 274 -> {275}; - 275 -> {276}; - 276 -> {277}; - 277 -> {278}; - 278 -> {279}; - 279 -> {281 280}; - 280 -> {287}; - 281 -> {282}; - 282 -> {283}; - 283 -> {284}; - 284 -> {285}; - 285 -> {286}; - 286 -> {287}; - 287 -> {288}; - 288 -> {289}; - 289 -> {290}; - 290 -> {291}; - 291 -> {292}; - 292 -> {293}; - 293 -> {294}; - 294 -> {295}; - 295 -> {297 296}; - 296 -> {303}; - 297 -> {298}; - 298 -> {299}; - 299 -> {300}; - 300 -> {301}; - 301 -> {302}; - 302 -> {303}; - 303 -> {304}; - 304 -> {305}; - 305 -> {306}; - 306 -> {307}; - 307 -> {308}; - 308 -> {309}; - 309 -> {310}; - 310 -> {311}; - 311 -> {313 312}; - 312 -> {319}; - 313 -> {314}; - 314 -> {315}; - 315 -> {316}; - 316 -> {317}; - 317 -> {318}; - 318 -> {319}; - 319 -> {320}; - 320 -> {321}; - 321 -> {322}; - 322 -> {323}; - 323 -> {324}; - 324 -> {325}; - 325 -> {326}; - 326 -> {327}; - 327 -> {329 328}; - 328 -> {335}; - 329 -> {330}; - 330 -> {331}; - 331 -> {332}; - 332 -> {333}; - 333 -> {334}; - 334 -> {335}; - 335 -> {336}; - 336 -> {337}; - 337 -> {338}; + 16 -> {17}; - subgraph cluster_74 { - color=red - 339 [label="Enter function test_10" style="filled" fillcolor=red]; - subgraph cluster_75 { - color=blue - 340 [label="Enter when"]; - subgraph cluster_76 { - color=blue - 341 [label="Enter when branch condition "]; - 342 [label="Access variable R|/a|"]; - 343 [label="Access variable R|/b|"]; - 344 [label="Operator =="]; - 345 [label="Exit when branch condition"]; - } - 346 [label="Synthetic else branch"]; - 347 [label="Enter when branch result"]; - subgraph cluster_77 { - color=blue - 348 [label="Enter block"]; - 349 [label="Access variable R|/b|"]; - 350 [label="Function call: R|/b|.#()"]; - 351 [label="Exit block"]; - } - 352 [label="Exit when branch result"]; - 353 [label="Exit when"]; + subgraph cluster_9 { + color=red + 18 [label="Enter function getter" style="filled" fillcolor=red]; + 19 [label="Exit function getter" style="filled" fillcolor=red]; } - 354 [label="Access variable R|/b|"]; - 355 [label="Function call: R|/b|.#()"]; - subgraph cluster_78 { - color=blue - 356 [label="Enter when"]; - subgraph cluster_79 { - color=blue - 357 [label="Enter when branch condition "]; - 358 [label="Access variable R|/a|"]; - 359 [label="Access variable R|/b|"]; - 360 [label="Operator ==="]; - 361 [label="Exit when branch condition"]; - } - 362 [label="Synthetic else branch"]; - 363 [label="Enter when branch result"]; - subgraph cluster_80 { - color=blue - 364 [label="Enter block"]; - 365 [label="Access variable R|/b|"]; - 366 [label="Function call: R|/b|.#()"]; - 367 [label="Exit block"]; - } - 368 [label="Exit when branch result"]; - 369 [label="Exit when"]; - } - 370 [label="Access variable R|/b|"]; - 371 [label="Function call: R|/b|.#()"]; - subgraph cluster_81 { - color=blue - 372 [label="Enter when"]; - subgraph cluster_82 { - color=blue - 373 [label="Enter when branch condition "]; - 374 [label="Access variable R|/b|"]; - 375 [label="Access variable R|/a|"]; - 376 [label="Operator =="]; - 377 [label="Exit when branch condition"]; - } - 378 [label="Synthetic else branch"]; - 379 [label="Enter when branch result"]; - subgraph cluster_83 { - color=blue - 380 [label="Enter block"]; - 381 [label="Access variable R|/b|"]; - 382 [label="Function call: R|/b|.#()"]; - 383 [label="Exit block"]; - } - 384 [label="Exit when branch result"]; - 385 [label="Exit when"]; - } - 386 [label="Access variable R|/b|"]; - 387 [label="Function call: R|/b|.#()"]; - subgraph cluster_84 { - color=blue - 388 [label="Enter when"]; - subgraph cluster_85 { - color=blue - 389 [label="Enter when branch condition "]; - 390 [label="Access variable R|/b|"]; - 391 [label="Access variable R|/a|"]; - 392 [label="Operator ==="]; - 393 [label="Exit when branch condition"]; - } - 394 [label="Synthetic else branch"]; - 395 [label="Enter when branch result"]; - subgraph cluster_86 { - color=blue - 396 [label="Enter block"]; - 397 [label="Access variable R|/b|"]; - 398 [label="Function call: R|/b|.#()"]; - 399 [label="Exit block"]; - } - 400 [label="Exit when branch result"]; - 401 [label="Exit when"]; - } - 402 [label="Access variable R|/b|"]; - 403 [label="Function call: R|/b|.#()"]; - 404 [label="Exit function test_10" style="filled" fillcolor=red]; - } - 339 -> {340}; - 340 -> {341}; - 341 -> {342}; - 342 -> {343}; - 343 -> {344}; - 344 -> {345}; - 345 -> {347 346}; - 346 -> {353}; - 347 -> {348}; - 348 -> {349}; - 349 -> {350}; - 350 -> {351}; - 351 -> {352}; - 352 -> {353}; - 353 -> {354}; - 354 -> {355}; - 355 -> {356}; - 356 -> {357}; - 357 -> {358}; - 358 -> {359}; - 359 -> {360}; - 360 -> {361}; - 361 -> {363 362}; - 362 -> {369}; - 363 -> {364}; - 364 -> {365}; - 365 -> {366}; - 366 -> {367}; - 367 -> {368}; - 368 -> {369}; - 369 -> {370}; - 370 -> {371}; - 371 -> {372}; - 372 -> {373}; - 373 -> {374}; - 374 -> {375}; - 375 -> {376}; - 376 -> {377}; - 377 -> {379 378}; - 378 -> {385}; - 379 -> {380}; - 380 -> {381}; - 381 -> {382}; - 382 -> {383}; - 383 -> {384}; - 384 -> {385}; - 385 -> {386}; - 386 -> {387}; - 387 -> {388}; - 388 -> {389}; - 389 -> {390}; - 390 -> {391}; - 391 -> {392}; - 392 -> {393}; - 393 -> {395 394}; - 394 -> {401}; - 395 -> {396}; - 396 -> {397}; - 397 -> {398}; - 398 -> {399}; - 399 -> {400}; - 400 -> {401}; - 401 -> {402}; - 402 -> {403}; - 403 -> {404}; + 18 -> {19}; - subgraph cluster_87 { - color=red - 405 [label="Enter function test_11" style="filled" fillcolor=red]; - subgraph cluster_88 { - color=blue - 406 [label="Enter when"]; - subgraph cluster_89 { - color=blue - 407 [label="Enter when branch condition "]; - 408 [label="Access variable R|/q|"]; - 409 [label="Enter safe call"]; - 410 [label="Access variable R|/QImpl.data|"]; - 411 [label="Exit safe call"]; - 412 [label="Enter safe call"]; - 413 [label="Access variable R|/MyData.s|"]; - 414 [label="Exit safe call"]; - 415 [label="Enter safe call"]; - 416 [label="Function call: R|/q|?.R|/QImpl.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 417 [label="Exit safe call"]; - 418 [label="Const: Null(null)"]; - 419 [label="Operator !="]; - 420 [label="Exit when branch condition"]; - } - 421 [label="Synthetic else branch"]; - 422 [label="Enter when branch result"]; - subgraph cluster_90 { - color=blue - 423 [label="Enter block"]; - 424 [label="Access variable R|/q|"]; - 425 [label="Access variable R|/QImpl.data|"]; - 426 [label="Access variable R|/q|"]; - 427 [label="Access variable R|/QImpl.data|"]; - 428 [label="Access variable R|/MyData.s|"]; - 429 [label="Access variable R|/q|"]; - 430 [label="Access variable R|/QImpl.data|"]; - 431 [label="Access variable R|/MyData.s|"]; - 432 [label="Function call: R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 433 [label="Access variable R|/q2|"]; - 434 [label="Access variable R|/QImpl.data|"]; - 435 [label="Access variable R|/q2|"]; - 436 [label="Access variable R|/QImpl.data|"]; - 437 [label="Access variable #"]; - 438 [label="Access variable R|/q2|"]; - 439 [label="Access variable R|/QImpl.data|"]; - 440 [label="Access variable #"]; - 441 [label="Function call: R|/q2|.R|/QImpl.data|.#.#()"]; - subgraph cluster_91 { - color=blue - 442 [label="Enter when"]; - subgraph cluster_92 { + subgraph cluster_10 { + color=red + 20 [label="Enter property" style="filled" fillcolor=red]; + 21 [label="Access variable R|/data|"]; + 22 [label="Exit property" style="filled" fillcolor=red]; + } + + 20 -> {21}; + 21 -> {22}; + + subgraph cluster_11 { + color=red + 23 [label="Enter function fdata" style="filled" fillcolor=red]; + 24 [label="Const: Null(null)"]; + 25 [label="Jump: ^fdata Null(null)"]; + 26 [label="Stub" style="filled" fillcolor=gray]; + 27 [label="Exit function fdata" style="filled" fillcolor=red]; + } + + 23 -> {24}; + 24 -> {25}; + 25 -> {27}; + 25 -> {26} [style=dotted]; + 26 -> {27} [style=dotted]; + + subgraph cluster_12 { + color=red + 28 [label="Enter function " style="filled" fillcolor=red]; + 29 [label="Exit function " style="filled" fillcolor=red]; + } + + 28 -> {29}; + + subgraph cluster_13 { + color=red + 30 [label="Enter function getter" style="filled" fillcolor=red]; + 31 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 30 -> {31}; + + subgraph cluster_14 { + color=red + 32 [label="Enter function setter" style="filled" fillcolor=red]; + 33 [label="Exit function setter" style="filled" fillcolor=red]; + } + + 32 -> {33}; + + subgraph cluster_15 { + color=red + 34 [label="Enter property" style="filled" fillcolor=red]; + 35 [label="Access variable R|/data|"]; + 36 [label="Exit property" style="filled" fillcolor=red]; + } + + 34 -> {35}; + 35 -> {36}; + + subgraph cluster_16 { + color=red + 37 [label="Enter function fdata" style="filled" fillcolor=red]; + 38 [label="Const: Null(null)"]; + 39 [label="Jump: ^fdata Null(null)"]; + 40 [label="Stub" style="filled" fillcolor=gray]; + 41 [label="Exit function fdata" style="filled" fillcolor=red]; + } + + 37 -> {38}; + 38 -> {39}; + 39 -> {41}; + 39 -> {40} [style=dotted]; + 40 -> {41} [style=dotted]; + + subgraph cluster_17 { + color=red + 42 [label="Enter function " style="filled" fillcolor=red]; + 43 [label="Exit function " style="filled" fillcolor=red]; + } + + 42 -> {43}; + + subgraph cluster_18 { + color=red + 44 [label="Enter function getter" style="filled" fillcolor=red]; + 45 [label="Const: Null(null)"]; + 46 [label="Jump: ^ Null(null)"]; + 47 [label="Stub" style="filled" fillcolor=gray]; + 48 [label="Exit function getter" style="filled" fillcolor=red]; + } + + 44 -> {45}; + 45 -> {46}; + 46 -> {48}; + 46 -> {47} [style=dotted]; + 47 -> {48} [style=dotted]; + + subgraph cluster_19 { + color=red + 49 [label="Enter property" style="filled" fillcolor=red]; + 50 [label="Exit property" style="filled" fillcolor=red]; + } + + 49 -> {50}; + + subgraph cluster_20 { + color=red + 51 [label="Enter function fdata" style="filled" fillcolor=red]; + 52 [label="Const: Null(null)"]; + 53 [label="Jump: ^fdata Null(null)"]; + 54 [label="Stub" style="filled" fillcolor=gray]; + 55 [label="Exit function fdata" style="filled" fillcolor=red]; + } + + 51 -> {52}; + 52 -> {53}; + 53 -> {55}; + 53 -> {54} [style=dotted]; + 54 -> {55} [style=dotted]; + + subgraph cluster_21 { + color=red + 56 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_22 { color=blue - 443 [label="Enter when branch condition "]; - 444 [label="Access variable R|/q2|"]; - 445 [label="Access variable R|/QImpl.data|"]; - 446 [label="Const: Null(null)"]; - 447 [label="Operator !="]; - 448 [label="Exit when branch condition"]; - } - 449 [label="Synthetic else branch"]; - 450 [label="Enter when branch result"]; - subgraph cluster_93 { - color=blue - 451 [label="Enter block"]; - 452 [label="Access variable R|/q2|"]; - 453 [label="Access variable R|/QImpl.data|"]; - 454 [label="Access variable R|/MyData.s|"]; - 455 [label="Access variable R|/q2|"]; - 456 [label="Access variable R|/QImpl.data|"]; - 457 [label="Access variable R|/MyData.s|"]; - 458 [label="Function call: R|/q2|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 459 [label="Exit block"]; - } - 460 [label="Exit when branch result"]; - 461 [label="Exit when"]; + 57 [label="Enter when"]; + subgraph cluster_23 { + color=blue + 58 [label="Enter when branch condition "]; + 59 [label="Access variable R|/x|"]; + 60 [label="Const: Null(null)"]; + 61 [label="Operator !="]; + 62 [label="Exit when branch condition"]; + } + subgraph cluster_24 { + color=blue + 63 [label="Enter when branch condition else"]; + 64 [label="Exit when branch condition"]; + } + 65 [label="Enter when branch result"]; + subgraph cluster_25 { + color=blue + 66 [label="Enter block"]; + 67 [label="Access variable R|/x|"]; + 68 [label="Function call: R|/x|.#()"]; + 69 [label="Exit block"]; + } + 70 [label="Exit when branch result"]; + 71 [label="Enter when branch result"]; + subgraph cluster_26 { + 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"]; } - 462 [label="Exit block"]; - } - 463 [label="Exit when branch result"]; - 464 [label="Exit when"]; + 78 [label="Access variable R|/x|"]; + 79 [label="Function call: R|/x|.#()"]; + 80 [label="Exit function test_1" style="filled" fillcolor=red]; } - 465 [label="Exit function test_11" style="filled" fillcolor=red]; - } - 405 -> {406}; - 406 -> {407}; - 407 -> {408}; - 408 -> {409 411}; - 409 -> {410}; - 410 -> {411}; - 411 -> {412 414}; - 412 -> {413}; - 413 -> {414}; - 414 -> {415 417}; - 415 -> {416}; - 416 -> {417}; - 417 -> {418}; - 418 -> {419}; - 419 -> {420}; - 420 -> {422 421}; - 421 -> {464}; - 422 -> {423}; - 423 -> {424}; - 424 -> {425}; - 425 -> {426}; - 426 -> {427}; - 427 -> {428}; - 428 -> {429}; - 429 -> {430}; - 430 -> {431}; - 431 -> {432}; - 432 -> {433}; - 433 -> {434}; - 434 -> {435}; - 435 -> {436}; - 436 -> {437}; - 437 -> {438}; - 438 -> {439}; - 439 -> {440}; - 440 -> {441}; - 441 -> {442}; - 442 -> {443}; - 443 -> {444}; - 444 -> {445}; - 445 -> {446}; - 446 -> {447}; - 447 -> {448}; - 448 -> {450 449}; - 449 -> {461}; - 450 -> {451}; - 451 -> {452}; - 452 -> {453}; - 453 -> {454}; - 454 -> {455}; - 455 -> {456}; - 456 -> {457}; - 457 -> {458}; - 458 -> {459}; - 459 -> {460}; - 460 -> {461}; - 461 -> {462}; - 462 -> {463}; - 463 -> {464}; - 464 -> {465}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {62}; + 62 -> {71 63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {77}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; - subgraph cluster_94 { - color=red - 466 [label="Enter function test_12" style="filled" fillcolor=red]; - subgraph cluster_95 { - color=blue - 467 [label="Enter when"]; - subgraph cluster_96 { - color=blue - 468 [label="Enter when branch condition "]; - 469 [label="Access variable R|/q|"]; - 470 [label="Enter safe call"]; - 471 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 472 [label="Exit safe call"]; - 473 [label="Enter safe call"]; - 474 [label="Access variable R|/MyData.s|"]; - 475 [label="Exit safe call"]; - 476 [label="Enter safe call"]; - 477 [label="Function call: R|/q|?.R|/QImplWithCustomGetter.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 478 [label="Exit safe call"]; - 479 [label="Const: Null(null)"]; - 480 [label="Operator !="]; - 481 [label="Exit when branch condition"]; - } - 482 [label="Synthetic else branch"]; - 483 [label="Enter when branch result"]; - subgraph cluster_97 { - color=blue - 484 [label="Enter block"]; - 485 [label="Access variable R|/q|"]; - 486 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 487 [label="Access variable R|/q|"]; - 488 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 489 [label="Access variable R|/MyData.s|"]; - 490 [label="Access variable R|/q|"]; - 491 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 492 [label="Access variable R|/MyData.s|"]; - 493 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 494 [label="Exit block"]; - } - 495 [label="Exit when branch result"]; - 496 [label="Exit when"]; + subgraph cluster_27 { + color=red + 81 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_28 { + color=blue + 82 [label="Enter when"]; + subgraph cluster_29 { + color=blue + 83 [label="Enter when branch condition "]; + 84 [label="Access variable R|/x|"]; + 85 [label="Const: Null(null)"]; + 86 [label="Operator =="]; + 87 [label="Exit when branch condition"]; + } + subgraph cluster_30 { + color=blue + 88 [label="Enter when branch condition else"]; + 89 [label="Exit when branch condition"]; + } + 90 [label="Enter when branch result"]; + subgraph cluster_31 { + color=blue + 91 [label="Enter block"]; + 92 [label="Access variable R|/x|"]; + 93 [label="Function call: R|/x|.R|/A.foo|()"]; + 94 [label="Exit block"]; + } + 95 [label="Exit when branch result"]; + 96 [label="Enter when branch result"]; + subgraph cluster_32 { + color=blue + 97 [label="Enter block"]; + 98 [label="Access variable R|/x|"]; + 99 [label="Function call: R|/x|.#()"]; + 100 [label="Exit block"]; + } + 101 [label="Exit when branch result"]; + 102 [label="Exit when"]; + } + 103 [label="Access variable R|/x|"]; + 104 [label="Function call: R|/x|.#()"]; + 105 [label="Exit function test_2" style="filled" fillcolor=red]; } - 497 [label="Exit function test_12" style="filled" fillcolor=red]; - } - 466 -> {467}; - 467 -> {468}; - 468 -> {469}; - 469 -> {470 472}; - 470 -> {471}; - 471 -> {472}; - 472 -> {473 475}; - 473 -> {474}; - 474 -> {475}; - 475 -> {476 478}; - 476 -> {477}; - 477 -> {478}; - 478 -> {479}; - 479 -> {480}; - 480 -> {481}; - 481 -> {483 482}; - 482 -> {496}; - 483 -> {484}; - 484 -> {485}; - 485 -> {486}; - 486 -> {487}; - 487 -> {488}; - 488 -> {489}; - 489 -> {490}; - 490 -> {491}; - 491 -> {492}; - 492 -> {493}; - 493 -> {494}; - 494 -> {495}; - 495 -> {496}; - 496 -> {497}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {96 88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {102}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; - subgraph cluster_98 { - color=red - 498 [label="Enter function test_13" style="filled" fillcolor=red]; - subgraph cluster_99 { - color=blue - 499 [label="Enter when"]; - subgraph cluster_100 { - color=blue - 500 [label="Enter when branch condition "]; - 501 [label="Access variable R|/q|"]; - 502 [label="Enter safe call"]; - 503 [label="Access variable R|/QImplMutable.data|"]; - 504 [label="Exit safe call"]; - 505 [label="Enter safe call"]; - 506 [label="Access variable R|/MyData.s|"]; - 507 [label="Exit safe call"]; - 508 [label="Enter safe call"]; - 509 [label="Function call: R|/q|?.R|/QImplMutable.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; - 510 [label="Exit safe call"]; - 511 [label="Const: Null(null)"]; - 512 [label="Operator !="]; - 513 [label="Exit when branch condition"]; - } - 514 [label="Synthetic else branch"]; - 515 [label="Enter when branch result"]; - subgraph cluster_101 { - color=blue - 516 [label="Enter block"]; - 517 [label="Access variable R|/q|"]; - 518 [label="Access variable R|/QImplMutable.data|"]; - 519 [label="Access variable R|/q|"]; - 520 [label="Access variable R|/QImplMutable.data|"]; - 521 [label="Access variable R|/MyData.s|"]; - 522 [label="Access variable R|/q|"]; - 523 [label="Access variable R|/QImplMutable.data|"]; - 524 [label="Access variable R|/MyData.s|"]; - 525 [label="Function call: R|/q|.R|/QImplMutable.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; - 526 [label="Exit block"]; - } - 527 [label="Exit when branch result"]; - 528 [label="Exit when"]; + subgraph cluster_33 { + color=red + 106 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_34 { + color=blue + 107 [label="Enter when"]; + 108 [label="Access variable R|/x|"]; + 109 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_35 { + color=blue + 110 [label="Enter when branch condition "]; + 111 [label="Const: Null(null)"]; + 112 [label="Operator =="]; + 113 [label="Exit when branch condition"]; + } + subgraph cluster_36 { + color=blue + 114 [label="Enter when branch condition else"]; + 115 [label="Exit when branch condition"]; + } + 116 [label="Enter when branch result"]; + subgraph cluster_37 { + color=blue + 117 [label="Enter block"]; + 118 [label="Access variable R|/|"]; + 119 [label="Exit block"]; + } + 120 [label="Exit when branch result"]; + 121 [label="Enter when branch result"]; + subgraph cluster_38 { + color=blue + 122 [label="Enter block"]; + 123 [label="Jump: ^test_3 Unit"]; + 124 [label="Stub" style="filled" fillcolor=gray]; + 125 [label="Exit block" style="filled" fillcolor=gray]; + } + 126 [label="Exit when branch result" style="filled" fillcolor=gray]; + 127 [label="Exit when"]; + } + 128 [label="Access variable R|/x|"]; + 129 [label="Function call: R|/x|.R|/A.foo|()"]; + 130 [label="Exit function test_3" style="filled" fillcolor=red]; } - 529 [label="Exit function test_13" style="filled" fillcolor=red]; - } - 498 -> {499}; - 499 -> {500}; - 500 -> {501}; - 501 -> {502 504}; - 502 -> {503}; - 503 -> {504}; - 504 -> {505 507}; - 505 -> {506}; - 506 -> {507}; - 507 -> {508 510}; - 508 -> {509}; - 509 -> {510}; - 510 -> {511}; - 511 -> {512}; - 512 -> {513}; - 513 -> {515 514}; - 514 -> {528}; - 515 -> {516}; - 516 -> {517}; - 517 -> {518}; - 518 -> {519}; - 519 -> {520}; - 520 -> {521}; - 521 -> {522}; - 522 -> {523}; - 523 -> {524}; - 524 -> {525}; - 525 -> {526}; - 526 -> {527}; - 527 -> {528}; - 528 -> {529}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {121 114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {127}; + 121 -> {122}; + 122 -> {123}; + 123 -> {130}; + 123 -> {124} [style=dotted]; + 124 -> {125} [style=dotted]; + 125 -> {126} [style=dotted]; + 126 -> {127} [style=dotted]; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + + subgraph cluster_39 { + color=red + 131 [label="Enter function test_4" style="filled" fillcolor=red]; + 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|/x|"]; + 135 [label="Enter safe call"]; + 136 [label="Function call: R|/x|?.R|/A.getA|()"]; + 137 [label="Exit safe call"]; + 138 [label="Const: Null(null)"]; + 139 [label="Operator =="]; + 140 [label="Exit when branch condition"]; + } + 141 [label="Synthetic else branch"]; + 142 [label="Enter when branch result"]; + subgraph cluster_42 { + color=blue + 143 [label="Enter block"]; + 144 [label="Jump: ^test_4 Unit"]; + 145 [label="Stub" style="filled" fillcolor=gray]; + 146 [label="Exit block" style="filled" fillcolor=gray]; + } + 147 [label="Exit when branch result" style="filled" fillcolor=gray]; + 148 [label="Exit when"]; + } + 149 [label="Access variable R|/x|"]; + 150 [label="Function call: R|/x|.R|/A.foo|()"]; + 151 [label="Exit function test_4" style="filled" fillcolor=red]; + } + + 131 -> {132}; + 132 -> {133}; + 133 -> {134}; + 134 -> {135 137}; + 135 -> {136}; + 136 -> {137}; + 137 -> {138}; + 138 -> {139}; + 139 -> {140}; + 140 -> {142 141}; + 141 -> {148}; + 142 -> {143}; + 143 -> {144}; + 144 -> {151}; + 144 -> {145} [style=dotted]; + 145 -> {146} [style=dotted]; + 146 -> {147} [style=dotted]; + 147 -> {148} [style=dotted]; + 148 -> {149}; + 149 -> {150}; + 150 -> {151}; + + subgraph cluster_43 { + color=red + 152 [label="Enter function test_5" style="filled" fillcolor=red]; + subgraph cluster_44 { + color=blue + 153 [label="Enter when"]; + subgraph cluster_45 { + color=blue + 154 [label="Enter when branch condition "]; + 155 [label="Access variable R|/q|"]; + 156 [label="Enter safe call"]; + 157 [label="Access variable R|/Q.data|"]; + 158 [label="Exit safe call"]; + 159 [label="Enter safe call"]; + 160 [label="Access variable R|/MyData.s|"]; + 161 [label="Exit safe call"]; + 162 [label="Enter safe call"]; + 163 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 164 [label="Exit safe call"]; + 165 [label="Const: Null(null)"]; + 166 [label="Operator !="]; + 167 [label="Exit when branch condition"]; + } + 168 [label="Synthetic else branch"]; + 169 [label="Enter when branch result"]; + subgraph cluster_46 { + color=blue + 170 [label="Enter block"]; + 171 [label="Access variable R|/q|"]; + 172 [label="Access variable R|/Q.data|"]; + 173 [label="Access variable R|/q|"]; + 174 [label="Access variable R|/Q.data|"]; + 175 [label="Access variable R|/MyData.s|"]; + 176 [label="Access variable R|/q|"]; + 177 [label="Access variable R|/Q.data|"]; + 178 [label="Access variable R|/MyData.s|"]; + 179 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 180 [label="Exit block"]; + } + 181 [label="Exit when branch result"]; + 182 [label="Exit when"]; + } + 183 [label="Exit function test_5" style="filled" fillcolor=red]; + } + + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + 155 -> {156 158}; + 156 -> {157}; + 157 -> {158}; + 158 -> {159 161}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162 164}; + 162 -> {163}; + 163 -> {164}; + 164 -> {165}; + 165 -> {166}; + 166 -> {167}; + 167 -> {169 168}; + 168 -> {182}; + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {173}; + 173 -> {174}; + 174 -> {175}; + 175 -> {176}; + 176 -> {177}; + 177 -> {178}; + 178 -> {179}; + 179 -> {180}; + 180 -> {181}; + 181 -> {182}; + 182 -> {183}; + + subgraph cluster_47 { + color=red + 184 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_48 { + color=blue + 185 [label="Enter when"]; + 186 [label="Access variable R|/q|"]; + 187 [label="Enter safe call"]; + 188 [label="Access variable R|/Q.data|"]; + 189 [label="Exit safe call"]; + 190 [label="Enter safe call"]; + 191 [label="Access variable R|/MyData.s|"]; + 192 [label="Exit safe call"]; + 193 [label="Enter safe call"]; + 194 [label="Function call: R|/q|?.R|/Q.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 195 [label="Exit safe call"]; + 196 [label="Variable declaration: lval : R|kotlin/Int?|"]; + subgraph cluster_49 { + color=blue + 197 [label="Enter when branch condition "]; + 198 [label="Const: Null(null)"]; + 199 [label="Operator =="]; + 200 [label="Exit when branch condition"]; + } + subgraph cluster_50 { + color=blue + 201 [label="Enter when branch condition else"]; + 202 [label="Exit when branch condition"]; + } + 203 [label="Enter when branch result"]; + subgraph cluster_51 { + color=blue + 204 [label="Enter block"]; + 205 [label="Access variable R|/|"]; + 206 [label="Exit block"]; + } + 207 [label="Exit when branch result"]; + 208 [label="Enter when branch result"]; + subgraph cluster_52 { + color=blue + 209 [label="Enter block"]; + 210 [label="Jump: ^test_6 Unit"]; + 211 [label="Stub" style="filled" fillcolor=gray]; + 212 [label="Exit block" style="filled" fillcolor=gray]; + } + 213 [label="Exit when branch result" style="filled" fillcolor=gray]; + 214 [label="Exit when"]; + } + 215 [label="Access variable R|/q|"]; + 216 [label="Access variable R|/Q.data|"]; + 217 [label="Access variable R|/q|"]; + 218 [label="Access variable R|/Q.data|"]; + 219 [label="Access variable R|/MyData.s|"]; + 220 [label="Access variable R|/q|"]; + 221 [label="Access variable R|/Q.data|"]; + 222 [label="Access variable R|/MyData.s|"]; + 223 [label="Function call: R|/q|.R|/Q.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 224 [label="Exit function test_6" style="filled" fillcolor=red]; + } + + 184 -> {185}; + 185 -> {186}; + 186 -> {187 189}; + 187 -> {188}; + 188 -> {189}; + 189 -> {190 192}; + 190 -> {191}; + 191 -> {192}; + 192 -> {193 195}; + 193 -> {194}; + 194 -> {195}; + 195 -> {196}; + 196 -> {197}; + 197 -> {198}; + 198 -> {199}; + 199 -> {200}; + 200 -> {208 201}; + 201 -> {202}; + 202 -> {203}; + 203 -> {204}; + 204 -> {205}; + 205 -> {206}; + 206 -> {207}; + 207 -> {214}; + 208 -> {209}; + 209 -> {210}; + 210 -> {224}; + 210 -> {211} [style=dotted]; + 211 -> {212} [style=dotted]; + 212 -> {213} [style=dotted]; + 213 -> {214} [style=dotted]; + 214 -> {215}; + 215 -> {216}; + 216 -> {217}; + 217 -> {218}; + 218 -> {219}; + 219 -> {220}; + 220 -> {221}; + 221 -> {222}; + 222 -> {223}; + 223 -> {224}; + + subgraph cluster_53 { + color=red + 225 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_54 { + color=blue + 226 [label="Enter when"]; + subgraph cluster_55 { + color=blue + 227 [label="Enter when branch condition "]; + 228 [label="Access variable R|/q|"]; + 229 [label="Enter safe call"]; + 230 [label="Function call: R|/q|?.R|/Q.fdata|()"]; + 231 [label="Exit safe call"]; + 232 [label="Enter safe call"]; + 233 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()"]; + 234 [label="Exit safe call"]; + 235 [label="Enter safe call"]; + 236 [label="Function call: R|/q|?.R|/Q.fdata|()?.R|/MyData.fs|()?.R|kotlin/Int.inc|()"]; + 237 [label="Exit safe call"]; + 238 [label="Const: Null(null)"]; + 239 [label="Operator !="]; + 240 [label="Exit when branch condition"]; + } + 241 [label="Synthetic else branch"]; + 242 [label="Enter when branch result"]; + subgraph cluster_56 { + color=blue + 243 [label="Enter block"]; + 244 [label="Access variable R|/q|"]; + 245 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 246 [label="Access variable R|/q|"]; + 247 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 248 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 249 [label="Access variable R|/q|"]; + 250 [label="Function call: R|/q|.R|/Q.fdata|()"]; + 251 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 252 [label="Function call: R|/q|.R|/Q.fdata|().#().#()"]; + 253 [label="Exit block"]; + } + 254 [label="Exit when branch result"]; + 255 [label="Exit when"]; + } + 256 [label="Exit function test_7" style="filled" fillcolor=red]; + } + + 225 -> {226}; + 226 -> {227}; + 227 -> {228}; + 228 -> {229 231}; + 229 -> {230}; + 230 -> {231}; + 231 -> {232 234}; + 232 -> {233}; + 233 -> {234}; + 234 -> {235 237}; + 235 -> {236}; + 236 -> {237}; + 237 -> {238}; + 238 -> {239}; + 239 -> {240}; + 240 -> {242 241}; + 241 -> {255}; + 242 -> {243}; + 243 -> {244}; + 244 -> {245}; + 245 -> {246}; + 246 -> {247}; + 247 -> {248}; + 248 -> {249}; + 249 -> {250}; + 250 -> {251}; + 251 -> {252}; + 252 -> {253}; + 253 -> {254}; + 254 -> {255}; + 255 -> {256}; + + subgraph cluster_57 { + color=red + 257 [label="Enter function test_8" style="filled" fillcolor=red]; + subgraph cluster_58 { + color=blue + 258 [label="Enter when"]; + subgraph cluster_59 { + color=blue + 259 [label="Enter when branch condition "]; + 260 [label="Access variable R|/b|"]; + 261 [label="Const: Boolean(true)"]; + 262 [label="Operator =="]; + 263 [label="Exit when branch condition"]; + } + 264 [label="Synthetic else branch"]; + 265 [label="Enter when branch result"]; + subgraph cluster_60 { + color=blue + 266 [label="Enter block"]; + 267 [label="Access variable R|/b|"]; + 268 [label="Function call: R|/b|.R|kotlin/Boolean.not|()"]; + 269 [label="Exit block"]; + } + 270 [label="Exit when branch result"]; + 271 [label="Exit when"]; + } + 272 [label="Exit function test_8" style="filled" fillcolor=red]; + } + + 257 -> {258}; + 258 -> {259}; + 259 -> {260}; + 260 -> {261}; + 261 -> {262}; + 262 -> {263}; + 263 -> {265 264}; + 264 -> {271}; + 265 -> {266}; + 266 -> {267}; + 267 -> {268}; + 268 -> {269}; + 269 -> {270}; + 270 -> {271}; + 271 -> {272}; + + subgraph cluster_61 { + color=red + 273 [label="Enter function test_9" style="filled" fillcolor=red]; + subgraph cluster_62 { + color=blue + 274 [label="Enter when"]; + subgraph cluster_63 { + color=blue + 275 [label="Enter when branch condition "]; + 276 [label="Access variable R|/a|"]; + 277 [label="Access variable R|/b|"]; + 278 [label="Operator =="]; + 279 [label="Exit when branch condition"]; + } + 280 [label="Synthetic else branch"]; + 281 [label="Enter when branch result"]; + subgraph cluster_64 { + color=blue + 282 [label="Enter block"]; + 283 [label="Access variable R|/b|"]; + 284 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 285 [label="Exit block"]; + } + 286 [label="Exit when branch result"]; + 287 [label="Exit when"]; + } + 288 [label="Access variable R|/b|"]; + 289 [label="Function call: R|/b|.#()"]; + subgraph cluster_65 { + color=blue + 290 [label="Enter when"]; + subgraph cluster_66 { + color=blue + 291 [label="Enter when branch condition "]; + 292 [label="Access variable R|/a|"]; + 293 [label="Access variable R|/b|"]; + 294 [label="Operator ==="]; + 295 [label="Exit when branch condition"]; + } + 296 [label="Synthetic else branch"]; + 297 [label="Enter when branch result"]; + subgraph cluster_67 { + color=blue + 298 [label="Enter block"]; + 299 [label="Access variable R|/b|"]; + 300 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 301 [label="Exit block"]; + } + 302 [label="Exit when branch result"]; + 303 [label="Exit when"]; + } + 304 [label="Access variable R|/b|"]; + 305 [label="Function call: R|/b|.#()"]; + subgraph cluster_68 { + color=blue + 306 [label="Enter when"]; + subgraph cluster_69 { + color=blue + 307 [label="Enter when branch condition "]; + 308 [label="Access variable R|/b|"]; + 309 [label="Access variable R|/a|"]; + 310 [label="Operator =="]; + 311 [label="Exit when branch condition"]; + } + 312 [label="Synthetic else branch"]; + 313 [label="Enter when branch result"]; + subgraph cluster_70 { + color=blue + 314 [label="Enter block"]; + 315 [label="Access variable R|/b|"]; + 316 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 317 [label="Exit block"]; + } + 318 [label="Exit when branch result"]; + 319 [label="Exit when"]; + } + 320 [label="Access variable R|/b|"]; + 321 [label="Function call: R|/b|.#()"]; + subgraph cluster_71 { + color=blue + 322 [label="Enter when"]; + subgraph cluster_72 { + color=blue + 323 [label="Enter when branch condition "]; + 324 [label="Access variable R|/b|"]; + 325 [label="Access variable R|/a|"]; + 326 [label="Operator ==="]; + 327 [label="Exit when branch condition"]; + } + 328 [label="Synthetic else branch"]; + 329 [label="Enter when branch result"]; + subgraph cluster_73 { + color=blue + 330 [label="Enter block"]; + 331 [label="Access variable R|/b|"]; + 332 [label="Function call: R|/b|.R|kotlin/Int.inc|()"]; + 333 [label="Exit block"]; + } + 334 [label="Exit when branch result"]; + 335 [label="Exit when"]; + } + 336 [label="Access variable R|/b|"]; + 337 [label="Function call: R|/b|.#()"]; + 338 [label="Exit function test_9" style="filled" fillcolor=red]; + } + + 273 -> {274}; + 274 -> {275}; + 275 -> {276}; + 276 -> {277}; + 277 -> {278}; + 278 -> {279}; + 279 -> {281 280}; + 280 -> {287}; + 281 -> {282}; + 282 -> {283}; + 283 -> {284}; + 284 -> {285}; + 285 -> {286}; + 286 -> {287}; + 287 -> {288}; + 288 -> {289}; + 289 -> {290}; + 290 -> {291}; + 291 -> {292}; + 292 -> {293}; + 293 -> {294}; + 294 -> {295}; + 295 -> {297 296}; + 296 -> {303}; + 297 -> {298}; + 298 -> {299}; + 299 -> {300}; + 300 -> {301}; + 301 -> {302}; + 302 -> {303}; + 303 -> {304}; + 304 -> {305}; + 305 -> {306}; + 306 -> {307}; + 307 -> {308}; + 308 -> {309}; + 309 -> {310}; + 310 -> {311}; + 311 -> {313 312}; + 312 -> {319}; + 313 -> {314}; + 314 -> {315}; + 315 -> {316}; + 316 -> {317}; + 317 -> {318}; + 318 -> {319}; + 319 -> {320}; + 320 -> {321}; + 321 -> {322}; + 322 -> {323}; + 323 -> {324}; + 324 -> {325}; + 325 -> {326}; + 326 -> {327}; + 327 -> {329 328}; + 328 -> {335}; + 329 -> {330}; + 330 -> {331}; + 331 -> {332}; + 332 -> {333}; + 333 -> {334}; + 334 -> {335}; + 335 -> {336}; + 336 -> {337}; + 337 -> {338}; + + subgraph cluster_74 { + color=red + 339 [label="Enter function test_10" style="filled" fillcolor=red]; + subgraph cluster_75 { + color=blue + 340 [label="Enter when"]; + subgraph cluster_76 { + color=blue + 341 [label="Enter when branch condition "]; + 342 [label="Access variable R|/a|"]; + 343 [label="Access variable R|/b|"]; + 344 [label="Operator =="]; + 345 [label="Exit when branch condition"]; + } + 346 [label="Synthetic else branch"]; + 347 [label="Enter when branch result"]; + subgraph cluster_77 { + color=blue + 348 [label="Enter block"]; + 349 [label="Access variable R|/b|"]; + 350 [label="Function call: R|/b|.#()"]; + 351 [label="Exit block"]; + } + 352 [label="Exit when branch result"]; + 353 [label="Exit when"]; + } + 354 [label="Access variable R|/b|"]; + 355 [label="Function call: R|/b|.#()"]; + subgraph cluster_78 { + color=blue + 356 [label="Enter when"]; + subgraph cluster_79 { + color=blue + 357 [label="Enter when branch condition "]; + 358 [label="Access variable R|/a|"]; + 359 [label="Access variable R|/b|"]; + 360 [label="Operator ==="]; + 361 [label="Exit when branch condition"]; + } + 362 [label="Synthetic else branch"]; + 363 [label="Enter when branch result"]; + subgraph cluster_80 { + color=blue + 364 [label="Enter block"]; + 365 [label="Access variable R|/b|"]; + 366 [label="Function call: R|/b|.#()"]; + 367 [label="Exit block"]; + } + 368 [label="Exit when branch result"]; + 369 [label="Exit when"]; + } + 370 [label="Access variable R|/b|"]; + 371 [label="Function call: R|/b|.#()"]; + subgraph cluster_81 { + color=blue + 372 [label="Enter when"]; + subgraph cluster_82 { + color=blue + 373 [label="Enter when branch condition "]; + 374 [label="Access variable R|/b|"]; + 375 [label="Access variable R|/a|"]; + 376 [label="Operator =="]; + 377 [label="Exit when branch condition"]; + } + 378 [label="Synthetic else branch"]; + 379 [label="Enter when branch result"]; + subgraph cluster_83 { + color=blue + 380 [label="Enter block"]; + 381 [label="Access variable R|/b|"]; + 382 [label="Function call: R|/b|.#()"]; + 383 [label="Exit block"]; + } + 384 [label="Exit when branch result"]; + 385 [label="Exit when"]; + } + 386 [label="Access variable R|/b|"]; + 387 [label="Function call: R|/b|.#()"]; + subgraph cluster_84 { + color=blue + 388 [label="Enter when"]; + subgraph cluster_85 { + color=blue + 389 [label="Enter when branch condition "]; + 390 [label="Access variable R|/b|"]; + 391 [label="Access variable R|/a|"]; + 392 [label="Operator ==="]; + 393 [label="Exit when branch condition"]; + } + 394 [label="Synthetic else branch"]; + 395 [label="Enter when branch result"]; + subgraph cluster_86 { + color=blue + 396 [label="Enter block"]; + 397 [label="Access variable R|/b|"]; + 398 [label="Function call: R|/b|.#()"]; + 399 [label="Exit block"]; + } + 400 [label="Exit when branch result"]; + 401 [label="Exit when"]; + } + 402 [label="Access variable R|/b|"]; + 403 [label="Function call: R|/b|.#()"]; + 404 [label="Exit function test_10" style="filled" fillcolor=red]; + } + + 339 -> {340}; + 340 -> {341}; + 341 -> {342}; + 342 -> {343}; + 343 -> {344}; + 344 -> {345}; + 345 -> {347 346}; + 346 -> {353}; + 347 -> {348}; + 348 -> {349}; + 349 -> {350}; + 350 -> {351}; + 351 -> {352}; + 352 -> {353}; + 353 -> {354}; + 354 -> {355}; + 355 -> {356}; + 356 -> {357}; + 357 -> {358}; + 358 -> {359}; + 359 -> {360}; + 360 -> {361}; + 361 -> {363 362}; + 362 -> {369}; + 363 -> {364}; + 364 -> {365}; + 365 -> {366}; + 366 -> {367}; + 367 -> {368}; + 368 -> {369}; + 369 -> {370}; + 370 -> {371}; + 371 -> {372}; + 372 -> {373}; + 373 -> {374}; + 374 -> {375}; + 375 -> {376}; + 376 -> {377}; + 377 -> {379 378}; + 378 -> {385}; + 379 -> {380}; + 380 -> {381}; + 381 -> {382}; + 382 -> {383}; + 383 -> {384}; + 384 -> {385}; + 385 -> {386}; + 386 -> {387}; + 387 -> {388}; + 388 -> {389}; + 389 -> {390}; + 390 -> {391}; + 391 -> {392}; + 392 -> {393}; + 393 -> {395 394}; + 394 -> {401}; + 395 -> {396}; + 396 -> {397}; + 397 -> {398}; + 398 -> {399}; + 399 -> {400}; + 400 -> {401}; + 401 -> {402}; + 402 -> {403}; + 403 -> {404}; + + subgraph cluster_87 { + color=red + 405 [label="Enter function test_11" style="filled" fillcolor=red]; + subgraph cluster_88 { + color=blue + 406 [label="Enter when"]; + subgraph cluster_89 { + color=blue + 407 [label="Enter when branch condition "]; + 408 [label="Access variable R|/q|"]; + 409 [label="Enter safe call"]; + 410 [label="Access variable R|/QImpl.data|"]; + 411 [label="Exit safe call"]; + 412 [label="Enter safe call"]; + 413 [label="Access variable R|/MyData.s|"]; + 414 [label="Exit safe call"]; + 415 [label="Enter safe call"]; + 416 [label="Function call: R|/q|?.R|/QImpl.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 417 [label="Exit safe call"]; + 418 [label="Const: Null(null)"]; + 419 [label="Operator !="]; + 420 [label="Exit when branch condition"]; + } + 421 [label="Synthetic else branch"]; + 422 [label="Enter when branch result"]; + subgraph cluster_90 { + color=blue + 423 [label="Enter block"]; + 424 [label="Access variable R|/q|"]; + 425 [label="Access variable R|/QImpl.data|"]; + 426 [label="Access variable R|/q|"]; + 427 [label="Access variable R|/QImpl.data|"]; + 428 [label="Access variable R|/MyData.s|"]; + 429 [label="Access variable R|/q|"]; + 430 [label="Access variable R|/QImpl.data|"]; + 431 [label="Access variable R|/MyData.s|"]; + 432 [label="Function call: R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 433 [label="Access variable R|/q2|"]; + 434 [label="Access variable R|/QImpl.data|"]; + 435 [label="Access variable R|/q2|"]; + 436 [label="Access variable R|/QImpl.data|"]; + 437 [label="Access variable #"]; + 438 [label="Access variable R|/q2|"]; + 439 [label="Access variable R|/QImpl.data|"]; + 440 [label="Access variable #"]; + 441 [label="Function call: R|/q2|.R|/QImpl.data|.#.#()"]; + subgraph cluster_91 { + color=blue + 442 [label="Enter when"]; + subgraph cluster_92 { + color=blue + 443 [label="Enter when branch condition "]; + 444 [label="Access variable R|/q2|"]; + 445 [label="Access variable R|/QImpl.data|"]; + 446 [label="Const: Null(null)"]; + 447 [label="Operator !="]; + 448 [label="Exit when branch condition"]; + } + 449 [label="Synthetic else branch"]; + 450 [label="Enter when branch result"]; + subgraph cluster_93 { + color=blue + 451 [label="Enter block"]; + 452 [label="Access variable R|/q2|"]; + 453 [label="Access variable R|/QImpl.data|"]; + 454 [label="Access variable R|/MyData.s|"]; + 455 [label="Access variable R|/q2|"]; + 456 [label="Access variable R|/QImpl.data|"]; + 457 [label="Access variable R|/MyData.s|"]; + 458 [label="Function call: R|/q2|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 459 [label="Exit block"]; + } + 460 [label="Exit when branch result"]; + 461 [label="Exit when"]; + } + 462 [label="Exit block"]; + } + 463 [label="Exit when branch result"]; + 464 [label="Exit when"]; + } + 465 [label="Exit function test_11" style="filled" fillcolor=red]; + } + + 405 -> {406}; + 406 -> {407}; + 407 -> {408}; + 408 -> {409 411}; + 409 -> {410}; + 410 -> {411}; + 411 -> {412 414}; + 412 -> {413}; + 413 -> {414}; + 414 -> {415 417}; + 415 -> {416}; + 416 -> {417}; + 417 -> {418}; + 418 -> {419}; + 419 -> {420}; + 420 -> {422 421}; + 421 -> {464}; + 422 -> {423}; + 423 -> {424}; + 424 -> {425}; + 425 -> {426}; + 426 -> {427}; + 427 -> {428}; + 428 -> {429}; + 429 -> {430}; + 430 -> {431}; + 431 -> {432}; + 432 -> {433}; + 433 -> {434}; + 434 -> {435}; + 435 -> {436}; + 436 -> {437}; + 437 -> {438}; + 438 -> {439}; + 439 -> {440}; + 440 -> {441}; + 441 -> {442}; + 442 -> {443}; + 443 -> {444}; + 444 -> {445}; + 445 -> {446}; + 446 -> {447}; + 447 -> {448}; + 448 -> {450 449}; + 449 -> {461}; + 450 -> {451}; + 451 -> {452}; + 452 -> {453}; + 453 -> {454}; + 454 -> {455}; + 455 -> {456}; + 456 -> {457}; + 457 -> {458}; + 458 -> {459}; + 459 -> {460}; + 460 -> {461}; + 461 -> {462}; + 462 -> {463}; + 463 -> {464}; + 464 -> {465}; + + subgraph cluster_94 { + color=red + 466 [label="Enter function test_12" style="filled" fillcolor=red]; + subgraph cluster_95 { + color=blue + 467 [label="Enter when"]; + subgraph cluster_96 { + color=blue + 468 [label="Enter when branch condition "]; + 469 [label="Access variable R|/q|"]; + 470 [label="Enter safe call"]; + 471 [label="Access variable R|/QImplWithCustomGetter.data|"]; + 472 [label="Exit safe call"]; + 473 [label="Enter safe call"]; + 474 [label="Access variable R|/MyData.s|"]; + 475 [label="Exit safe call"]; + 476 [label="Enter safe call"]; + 477 [label="Function call: R|/q|?.R|/QImplWithCustomGetter.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 478 [label="Exit safe call"]; + 479 [label="Const: Null(null)"]; + 480 [label="Operator !="]; + 481 [label="Exit when branch condition"]; + } + 482 [label="Synthetic else branch"]; + 483 [label="Enter when branch result"]; + subgraph cluster_97 { + color=blue + 484 [label="Enter block"]; + 485 [label="Access variable R|/q|"]; + 486 [label="Access variable R|/QImplWithCustomGetter.data|"]; + 487 [label="Access variable R|/q|"]; + 488 [label="Access variable R|/QImplWithCustomGetter.data|"]; + 489 [label="Access variable R|/MyData.s|"]; + 490 [label="Access variable R|/q|"]; + 491 [label="Access variable R|/QImplWithCustomGetter.data|"]; + 492 [label="Access variable R|/MyData.s|"]; + 493 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 494 [label="Exit block"]; + } + 495 [label="Exit when branch result"]; + 496 [label="Exit when"]; + } + 497 [label="Exit function test_12" style="filled" fillcolor=red]; + } + + 466 -> {467}; + 467 -> {468}; + 468 -> {469}; + 469 -> {470 472}; + 470 -> {471}; + 471 -> {472}; + 472 -> {473 475}; + 473 -> {474}; + 474 -> {475}; + 475 -> {476 478}; + 476 -> {477}; + 477 -> {478}; + 478 -> {479}; + 479 -> {480}; + 480 -> {481}; + 481 -> {483 482}; + 482 -> {496}; + 483 -> {484}; + 484 -> {485}; + 485 -> {486}; + 486 -> {487}; + 487 -> {488}; + 488 -> {489}; + 489 -> {490}; + 490 -> {491}; + 491 -> {492}; + 492 -> {493}; + 493 -> {494}; + 494 -> {495}; + 495 -> {496}; + 496 -> {497}; + + subgraph cluster_98 { + color=red + 498 [label="Enter function test_13" style="filled" fillcolor=red]; + subgraph cluster_99 { + color=blue + 499 [label="Enter when"]; + subgraph cluster_100 { + color=blue + 500 [label="Enter when branch condition "]; + 501 [label="Access variable R|/q|"]; + 502 [label="Enter safe call"]; + 503 [label="Access variable R|/QImplMutable.data|"]; + 504 [label="Exit safe call"]; + 505 [label="Enter safe call"]; + 506 [label="Access variable R|/MyData.s|"]; + 507 [label="Exit safe call"]; + 508 [label="Enter safe call"]; + 509 [label="Function call: R|/q|?.R|/QImplMutable.data|?.R|/MyData.s|?.R|kotlin/Int.inc|()"]; + 510 [label="Exit safe call"]; + 511 [label="Const: Null(null)"]; + 512 [label="Operator !="]; + 513 [label="Exit when branch condition"]; + } + 514 [label="Synthetic else branch"]; + 515 [label="Enter when branch result"]; + subgraph cluster_101 { + color=blue + 516 [label="Enter block"]; + 517 [label="Access variable R|/q|"]; + 518 [label="Access variable R|/QImplMutable.data|"]; + 519 [label="Access variable R|/q|"]; + 520 [label="Access variable R|/QImplMutable.data|"]; + 521 [label="Access variable R|/MyData.s|"]; + 522 [label="Access variable R|/q|"]; + 523 [label="Access variable R|/QImplMutable.data|"]; + 524 [label="Access variable R|/MyData.s|"]; + 525 [label="Function call: R|/q|.R|/QImplMutable.data|.R|/MyData.s|.R|kotlin/Int.inc|()"]; + 526 [label="Exit block"]; + } + 527 [label="Exit when branch result"]; + 528 [label="Exit when"]; + } + 529 [label="Exit function test_13" style="filled" fillcolor=red]; + } + + 498 -> {499}; + 499 -> {500}; + 500 -> {501}; + 501 -> {502 504}; + 502 -> {503}; + 503 -> {504}; + 504 -> {505 507}; + 505 -> {506}; + 506 -> {507}; + 507 -> {508 510}; + 508 -> {509}; + 509 -> {510}; + 510 -> {511}; + 511 -> {512}; + 512 -> {513}; + 513 -> {515 514}; + 514 -> {528}; + 515 -> {516}; + 516 -> {517}; + 517 -> {518}; + 518 -> {519}; + 519 -> {520}; + 520 -> {521}; + 521 -> {522}; + 522 -> {523}; + 523 -> {524}; + 524 -> {525}; + 525 -> {526}; + 526 -> {527}; + 527 -> {528}; + 528 -> {529}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot b/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot index 7a15a131c41..e55bdc4441f 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/returns.dot @@ -1,344 +1,344 @@ digraph returns_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_0" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 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"]; - } - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test_0" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; + } + 19 [label="Access variable R|/x|"]; + 20 [label="Access variable #"]; + 21 [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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {12 6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {18}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {12 6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {18}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; - subgraph cluster_6 { - color=red - 22 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_7 { - color=blue - 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 - 28 [label="Enter when branch condition else"]; - 29 [label="Exit when branch condition"]; - } - 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"]; + subgraph cluster_6 { + color=red + 22 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_7 { + color=blue + 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 + 28 [label="Enter when branch condition else"]; + 29 [label="Exit when branch condition"]; + } + 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"]; + } + 43 [label="Access variable R|/x|"]; + 44 [label="Access variable R|kotlin/String.length|"]; + 45 [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 -> {36 28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 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}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {36 28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 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}; - 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}; - - 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 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 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"]; + subgraph cluster_12 { + color=red + 46 [label="Enter function foo" style="filled" fillcolor=red]; + 47 [label="Exit function foo" style="filled" fillcolor=red]; } - 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}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {76 58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - 61 -> {70 62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {89}; - 66 -> {67} [style=dotted]; - 67 -> {68} [style=dotted]; - 68 -> {69} [style=dotted]; - 69 -> {82} [style=dotted]; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {75}; - 75 -> {82}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; + 46 -> {47}; - 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"]; + subgraph cluster_13 { + color=red + 48 [label="Enter function bar" style="filled" fillcolor=red]; + 49 [label="Exit function bar" style="filled" fillcolor=red]; } - 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}; - 95 -> {107 96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {101 100}; - 100 -> {113}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {113}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; + 48 -> {49}; + + subgraph cluster_14 { + color=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 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}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {76 58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + 61 -> {70 62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {89}; + 66 -> {67} [style=dotted]; + 67 -> {68} [style=dotted]; + 68 -> {69} [style=dotted]; + 69 -> {82} [style=dotted]; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {75}; + 75 -> {82}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + + 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}; + 95 -> {107 96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {101 100}; + 100 -> {113}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {113}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot index 0868603d72e..90524b55e2a 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/safeCalls.dot @@ -1,239 +1,238 @@ digraph safeCalls_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter 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]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter 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 -> {4}; - 2 -> {3} [style=dotted]; - 3 -> {4} [style=dotted]; + 0 -> {1}; + 1 -> {2}; + 2 -> {4}; + 2 -> {3} [style=dotted]; + 3 -> {4} [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]; - } + 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}; + 5 -> {6}; - subgraph cluster_2 { - color=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]; - } + subgraph cluster_2 { + color=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 15}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; + 7 -> {8}; + 8 -> {9 15}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; - subgraph cluster_3 { - color=red - 19 [label="Enter function bar" style="filled" fillcolor=red]; - 20 [label="Exit function bar" style="filled" fillcolor=red]; - } + 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}; + 19 -> {20}; - subgraph cluster_4 { - color=red - 21 [label="Enter function bool" style="filled" fillcolor=red]; - 22 [label="Exit function bool" style="filled" fillcolor=red]; - } + 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}; + 21 -> {22}; - subgraph cluster_5 { - color=red - 23 [label="Enter function id" style="filled" fillcolor=red]; - 24 [label="Exit function id" style="filled" fillcolor=red]; - } + 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}; + 23 -> {24}; - subgraph cluster_6 { - color=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]; - } + subgraph cluster_6 { + color=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}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28 31}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; - subgraph cluster_7 { - color=red - 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| { + subgraph cluster_7 { + color=red + 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|() } )"]; - 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 47}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - - subgraph cluster_8 { - color=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}; - - subgraph cluster_10 { - color=red - 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 - 71 [label="Enter function anonymousFunction"]; - 72 [label="Jump: ^test_5 Unit"]; - 73 [label="Stub" style="filled" fillcolor=gray]; - 74 [label="Exit function anonymousFunction" style="filled" fillcolor=gray]; + 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]; } - 75 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Nothing| { + + 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 47}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + + subgraph cluster_8 { + color=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}; + + subgraph cluster_10 { + color=red + 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 + 71 [label="Enter function anonymousFunction"]; + 72 [label="Jump: ^test_5 Unit"]; + 73 [label="Stub" style="filled" fillcolor=gray]; + 74 [label="Exit function anonymousFunction" style="filled" fillcolor=gray]; + } + 75 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Nothing| { ^test_5 Unit } )" style="filled" fillcolor=gray]; - 76 [label="Exit safe call" style="filled" fillcolor=gray]; - 77 [label="Enter safe call" style="filled" fillcolor=gray]; - 78 [label="Access variable R|/x|" style="filled" fillcolor=gray]; - 79 [label="Function call: R|/x|.R|/A.bool|()" style="filled" fillcolor=gray]; - 80 [label="Function call: R|/x|?.R|kotlin/let|( = let@fun (it: R|A|): R|kotlin/Nothing| { + 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/Nothing| { ^test_5 Unit } -)?.R|/boo|(R|/x|.R|/A.bool|())" style="filled" fillcolor=gray]; - 81 [label="Exit safe call" style="filled" fillcolor=gray]; - 82 [label="Access variable R|/x|" style="filled" fillcolor=gray]; - 83 [label="Function call: R|/x|.#()" style="filled" fillcolor=gray]; - 84 [label="Exit function test_5" style="filled" fillcolor=red]; - } +)?.R|/boo|(R|/x|.R|/A.bool|())"]; + 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}; - 69 -> {76} [style=dotted]; - 70 -> {71}; - 71 -> {72}; - 72 -> {84}; - 72 -> {73} [style=dotted]; - 73 -> {74} [style=dotted]; - 74 -> {75} [style=dotted]; - 75 -> {76} [style=dotted]; - 76 -> {77 81} [style=dotted]; - 77 -> {78} [style=dotted]; - 78 -> {79} [style=dotted]; - 79 -> {80} [style=dotted]; - 80 -> {81} [style=dotted]; - 81 -> {82} [style=dotted]; - 82 -> {83} [style=dotted]; - 83 -> {84} [style=dotted]; + 68 -> {69}; + 69 -> {70 76}; + 70 -> {71}; + 71 -> {72}; + 72 -> {84}; + 72 -> {73} [style=dotted]; + 73 -> {74} [style=dotted]; + 74 -> {75} [style=dotted]; + 75 -> {76} [style=dotted]; + 76 -> {77 81}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot index bbb5bba9ad6..e335d10d40f 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/simpleIf.dot @@ -1,189 +1,189 @@ digraph simpleIf_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test_1" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 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"]; - } - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; + } + 14 [label="Access variable R|/x|"]; + 15 [label="Access variable #"]; + 16 [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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {7 6}; - 6 -> {13}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {7 6}; + 6 -> {13}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; - subgraph cluster_4 { - color=red - 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 - 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 - 27 [label="Enter block"]; - 28 [label="Access variable R|/x|"]; - 29 [label="Access variable R|kotlin/String.length|"]; - 30 [label="Exit block"]; - } - 31 [label="Exit when branch result"]; - 32 [label="Exit when"]; + subgraph cluster_4 { + color=red + 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 + 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 + 27 [label="Enter block"]; + 28 [label="Access variable R|/x|"]; + 29 [label="Access variable R|kotlin/String.length|"]; + 30 [label="Exit block"]; + } + 31 [label="Exit when branch result"]; + 32 [label="Exit when"]; + } + 33 [label="Access variable R|/x|"]; + 34 [label="Access variable #"]; + 35 [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 -> {26 25}; - 25 -> {32}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {26 25}; + 25 -> {32}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; - 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"]; + 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]; } - 65 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {60 42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {56 46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {64}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {64}; - 60 -> {61}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {60 42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {56 46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {64}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {64}; + 60 -> {61}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot index 65b357603e5..833941f07ee 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastAfterReassignment.dot @@ -1,107 +1,107 @@ digraph smartcastAfterReassignment_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter 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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - - subgraph cluster_1 { - color=red - 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 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 - 19 [label="Enter block"]; - 20 [label="Const: String()"]; - 21 [label="Assignmenet: R|/x|"]; - 22 [label="Exit block"]; - } - 23 [label="Exit when branch result"]; - 24 [label="Exit when"]; + subgraph cluster_0 { + color=red + 0 [label="Enter 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]; } - 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 -> {18 17}; - 17 -> {24}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; - 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="Access variable #"]; - 39 [label="Exit function test_3" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 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 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 + 19 [label="Enter block"]; + 20 [label="Const: String()"]; + 21 [label="Assignmenet: R|/x|"]; + 22 [label="Exit block"]; + } + 23 [label="Exit when branch result"]; + 24 [label="Exit when"]; + } + 25 [label="Access variable R|/x|"]; + 26 [label="Access variable R|kotlin/String.length|"]; + 27 [label="Exit function test_2" style="filled" fillcolor=red]; + } - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {18 17}; + 17 -> {24}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + + 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="Access variable #"]; + 39 [label="Exit function test_3" style="filled" fillcolor=red]; + } + + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastFromArgument.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastFromArgument.dot index dce6fd6fa8b..50f9c80e049 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastFromArgument.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastFromArgument.dot @@ -1,78 +1,78 @@ digraph smartcastFromArgument_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } + subgraph cluster_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; + } - 0 -> {1}; + 0 -> {1}; - subgraph cluster_1 { - color=red - 2 [label="Enter function takeA" style="filled" fillcolor=red]; - 3 [label="Const: Boolean(true)"]; - 4 [label="Jump: ^takeA Boolean(true)"]; - 5 [label="Stub" style="filled" fillcolor=gray]; - 6 [label="Exit function takeA" style="filled" fillcolor=red]; - } + subgraph cluster_1 { + color=red + 2 [label="Enter function takeA" style="filled" fillcolor=red]; + 3 [label="Const: Boolean(true)"]; + 4 [label="Jump: ^takeA Boolean(true)"]; + 5 [label="Stub" style="filled" fillcolor=gray]; + 6 [label="Exit function takeA" style="filled" fillcolor=red]; + } - 2 -> {3}; - 3 -> {4}; - 4 -> {6}; - 4 -> {5} [style=dotted]; - 5 -> {6} [style=dotted]; + 2 -> {3}; + 3 -> {4}; + 4 -> {6}; + 4 -> {5} [style=dotted]; + 5 -> {6} [style=dotted]; - subgraph cluster_2 { - color=red - 7 [label="Enter function test" style="filled" fillcolor=red]; - subgraph cluster_3 { - color=blue - 8 [label="Enter when"]; - subgraph cluster_4 { - color=blue - 9 [label="Enter when branch condition "]; - subgraph cluster_5 { - color=blue - 10 [label="Enter when"]; - 11 [label="Access variable R|/a|"]; - 12 [label="Type operator: a as? A"]; - 13 [label="Variable declaration: lval : R|A?|"]; - subgraph cluster_6 { + subgraph cluster_2 { + color=red + 7 [label="Enter function test" style="filled" fillcolor=red]; + subgraph cluster_3 { color=blue - 14 [label="Enter when branch condition "]; - 15 [label="Const: Null(null)"]; - 16 [label="Operator =="]; - 17 [label="Exit when branch condition"]; - } - subgraph cluster_7 { - color=blue - 18 [label="Enter when branch condition else"]; - 19 [label="Exit when branch condition"]; - } - 20 [label="Enter when branch result"]; - subgraph cluster_8 { - color=blue - 21 [label="Enter block"]; - 22 [label="Access variable R|/|"]; - 23 [label="Exit block"]; - } - 24 [label="Exit when branch result"]; - 25 [label="Enter when branch result"]; - subgraph cluster_9 { - color=blue - 26 [label="Enter block"]; - 27 [label="Jump: ^test Unit"]; - 28 [label="Stub" style="filled" fillcolor=gray]; - 29 [label="Exit block" style="filled" fillcolor=gray]; - } - 30 [label="Exit when branch result" style="filled" fillcolor=gray]; - 31 [label="Exit when"]; - } - 32 [label="Function call: R|/takeA|(when (lval : R|A?| = (R|/a| as? R|A|)) { + 8 [label="Enter when"]; + subgraph cluster_4 { + color=blue + 9 [label="Enter when branch condition "]; + subgraph cluster_5 { + color=blue + 10 [label="Enter when"]; + 11 [label="Access variable R|/a|"]; + 12 [label="Type operator: a as? A"]; + 13 [label="Variable declaration: lval : R|A?|"]; + subgraph cluster_6 { + color=blue + 14 [label="Enter when branch condition "]; + 15 [label="Const: Null(null)"]; + 16 [label="Operator =="]; + 17 [label="Exit when branch condition"]; + } + subgraph cluster_7 { + color=blue + 18 [label="Enter when branch condition else"]; + 19 [label="Exit when branch condition"]; + } + 20 [label="Enter when branch result"]; + subgraph cluster_8 { + color=blue + 21 [label="Enter block"]; + 22 [label="Access variable R|/|"]; + 23 [label="Exit block"]; + } + 24 [label="Exit when branch result"]; + 25 [label="Enter when branch result"]; + subgraph cluster_9 { + color=blue + 26 [label="Enter block"]; + 27 [label="Jump: ^test Unit"]; + 28 [label="Stub" style="filled" fillcolor=gray]; + 29 [label="Exit block" style="filled" fillcolor=gray]; + } + 30 [label="Exit when branch result" style="filled" fillcolor=gray]; + 31 [label="Exit when"]; + } + 32 [label="Function call: R|/takeA|(when (lval : R|A?| = (R|/a| as? R|A|)) { ==($subj$, Null(null)) -> { ^test Unit } @@ -81,58 +81,58 @@ digraph smartcastFromArgument_kt { } } )"]; - 33 [label="Exit when branch condition"]; - } - 34 [label="Synthetic else branch"]; - 35 [label="Enter when branch result"]; - subgraph cluster_10 { - color=blue - 36 [label="Enter block"]; - 37 [label="Access variable R|/a|"]; - 38 [label="Function call: R|/a|.R|/A.foo|()"]; - 39 [label="Exit block"]; - } - 40 [label="Exit when branch result"]; - 41 [label="Exit when"]; + 33 [label="Exit when branch condition"]; + } + 34 [label="Synthetic else branch"]; + 35 [label="Enter when branch result"]; + subgraph cluster_10 { + color=blue + 36 [label="Enter block"]; + 37 [label="Access variable R|/a|"]; + 38 [label="Function call: R|/a|.R|/A.foo|()"]; + 39 [label="Exit block"]; + } + 40 [label="Exit when branch result"]; + 41 [label="Exit when"]; + } + 42 [label="Exit function test" style="filled" fillcolor=red]; } - 42 [label="Exit function test" style="filled" fillcolor=red]; - } - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; - 14 -> {15}; - 15 -> {16}; - 16 -> {17}; - 17 -> {25 18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {31}; - 25 -> {26}; - 26 -> {27}; - 27 -> {42}; - 27 -> {28} [style=dotted]; - 28 -> {29} [style=dotted]; - 29 -> {30} [style=dotted]; - 30 -> {31} [style=dotted]; - 31 -> {32}; - 32 -> {33}; - 33 -> {35 34}; - 34 -> {41}; - 35 -> {36}; - 36 -> {37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {25 18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {31}; + 25 -> {26}; + 26 -> {27}; + 27 -> {42}; + 27 -> {28} [style=dotted]; + 28 -> {29} [style=dotted]; + 29 -> {30} [style=dotted]; + 30 -> {31} [style=dotted]; + 31 -> {32}; + 32 -> {33}; + 33 -> {35 34}; + 34 -> {41}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot index bbeb0eaf35f..2df1a010620 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/smartcastOnLambda.dot @@ -1,49 +1,49 @@ digraph smartcastOnLambda_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function test" style="filled" fillcolor=red]; - subgraph cluster_1 { - color=blue - 1 [label="Enter when"]; - subgraph cluster_2 { - color=blue - 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"]; - } - 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"]; + subgraph cluster_0 { + color=red + 0 [label="Enter function test" style="filled" fillcolor=red]; + subgraph cluster_1 { + color=blue + 1 [label="Enter when"]; + subgraph cluster_2 { + color=blue + 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"]; + } + 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"]; + } + 14 [label="Exit function test" style="filled" fillcolor=red]; } - 14 [label="Exit function test" style="filled" fillcolor=red]; - } - 0 -> {1}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {8 7}; - 7 -> {13}; - 8 -> {9}; - 9 -> {10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {14}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {8 7}; + 7 -> {13}; + 8 -> {9}; + 9 -> {10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; } diff --git a/compiler/fir/resolve/testData/resolve/smartcasts/when.dot b/compiler/fir/resolve/testData/resolve/smartcasts/when.dot index c10ed9a8a11..267dbd4e5e9 100644 --- a/compiler/fir/resolve/testData/resolve/smartcasts/when.dot +++ b/compiler/fir/resolve/testData/resolve/smartcasts/when.dot @@ -1,649 +1,649 @@ digraph when_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - subgraph cluster_0 { - color=red - 0 [label="Enter function foo" style="filled" fillcolor=red]; - 1 [label="Exit function foo" style="filled" fillcolor=red]; - } - - 0 -> {1}; - - subgraph cluster_1 { - color=red - 2 [label="Enter function bar" style="filled" fillcolor=red]; - 3 [label="Exit function bar" 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 when"]; - subgraph cluster_4 { - color=blue - 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_0 { + color=red + 0 [label="Enter function foo" style="filled" fillcolor=red]; + 1 [label="Exit function foo" style="filled" fillcolor=red]; } - subgraph cluster_8 { - color=blue - 28 [label="Enter when"]; - subgraph cluster_9 { - color=blue - 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"]; - } - 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"]; + + 0 -> {1}; + + subgraph cluster_1 { + color=red + 2 [label="Enter function bar" style="filled" fillcolor=red]; + 3 [label="Exit function bar" style="filled" fillcolor=red]; } - 72 [label="Exit function test_1" style="filled" fillcolor=red]; - } - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {21 10}; - 10 -> {11}; - 11 -> {12}; - 12 -> {13}; - 13 -> {15 14}; - 14 -> {27}; - 15 -> {16}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {27}; - 21 -> {22}; - 22 -> {23}; - 23 -> {24}; - 24 -> {25}; - 25 -> {26}; - 26 -> {27}; - 27 -> {28}; - 28 -> {29}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {67 33}; - 33 -> {34}; - 34 -> {35}; - 35 -> {36}; - 36 -> {61 37}; - 37 -> {38}; - 38 -> {39}; - 39 -> {40}; - 40 -> {51 41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {71}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {71}; - 61 -> {62}; - 62 -> {63}; - 63 -> {64}; - 64 -> {65}; - 65 -> {66}; - 66 -> {71}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; + 2 -> {3}; - subgraph cluster_17 { - color=red - 73 [label="Enter function test_2" style="filled" fillcolor=red]; - subgraph cluster_18 { - color=blue - 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 - 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_2 { + color=red + 4 [label="Enter function test_1" style="filled" fillcolor=red]; + subgraph cluster_3 { + color=blue + 5 [label="Enter when"]; + subgraph cluster_4 { + color=blue + 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 branch condition "]; + 30 [label="Access variable R|/x|"]; + 31 [label="Type operator: x !is A"]; + 32 [label="Exit when branch condition"]; + } + 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"]; + } + 72 [label="Exit function test_1" style="filled" fillcolor=red]; } - 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 - 101 [label="Enter when branch condition "]; - 102 [label="Type operator: B"]; - 103 [label="Exit when branch condition"]; - } - 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"]; + + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {21 10}; + 10 -> {11}; + 11 -> {12}; + 12 -> {13}; + 13 -> {15 14}; + 14 -> {27}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {27}; + 21 -> {22}; + 22 -> {23}; + 23 -> {24}; + 24 -> {25}; + 25 -> {26}; + 26 -> {27}; + 27 -> {28}; + 28 -> {29}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {67 33}; + 33 -> {34}; + 34 -> {35}; + 35 -> {36}; + 36 -> {61 37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {51 41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {71}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {71}; + 61 -> {62}; + 62 -> {63}; + 63 -> {64}; + 64 -> {65}; + 65 -> {66}; + 66 -> {71}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + + subgraph cluster_17 { + color=red + 73 [label="Enter function test_2" style="filled" fillcolor=red]; + subgraph cluster_18 { + color=blue + 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 + 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 + 101 [label="Enter when branch condition "]; + 102 [label="Type operator: B"]; + 103 [label="Exit when branch condition"]; + } + 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"]; + } + 138 [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 -> {89 79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {83 82}; - 82 -> {95}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {95}; - 89 -> {90}; - 90 -> {91}; - 91 -> {92}; - 92 -> {93}; - 93 -> {94}; - 94 -> {95}; - 95 -> {96}; - 96 -> {97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {133 101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {127 104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {117 107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {112}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {137}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {137}; - 127 -> {128}; - 128 -> {129}; - 129 -> {130}; - 130 -> {131}; - 131 -> {132}; - 132 -> {137}; - 133 -> {134}; - 134 -> {135}; - 135 -> {136}; - 136 -> {137}; - 137 -> {138}; + 73 -> {74}; + 74 -> {75}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {89 79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {83 82}; + 82 -> {95}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {95}; + 89 -> {90}; + 90 -> {91}; + 91 -> {92}; + 92 -> {93}; + 93 -> {94}; + 94 -> {95}; + 95 -> {96}; + 96 -> {97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {133 101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {127 104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {117 107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {112}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {137}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {137}; + 127 -> {128}; + 128 -> {129}; + 129 -> {130}; + 130 -> {131}; + 131 -> {132}; + 132 -> {137}; + 133 -> {134}; + 134 -> {135}; + 135 -> {136}; + 136 -> {137}; + 137 -> {138}; - subgraph cluster_32 { - color=red - 139 [label="Enter function test_3" style="filled" fillcolor=red]; - subgraph cluster_33 { - color=blue - 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 - 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_32 { + color=red + 139 [label="Enter function test_3" style="filled" fillcolor=red]; + subgraph cluster_33 { + color=blue + 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 + 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 + 176 [label="Enter when branch condition "]; + 177 [label="Type operator: Int"]; + 178 [label="Exit when branch condition"]; + } + 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"]; + } + 222 [label="Exit function test_3" style="filled" fillcolor=red]; } - 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 - 176 [label="Enter when branch condition "]; - 177 [label="Type operator: Int"]; - 178 [label="Exit when branch condition"]; - } - 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"]; + + 139 -> {140}; + 140 -> {141}; + 141 -> {142}; + 142 -> {143}; + 143 -> {144}; + 144 -> {145}; + 145 -> {158 146}; + 146 -> {147}; + 147 -> {148}; + 148 -> {150 149}; + 149 -> {166}; + 150 -> {151}; + 151 -> {152}; + 152 -> {153}; + 153 -> {154}; + 154 -> {155}; + 155 -> {156}; + 156 -> {157}; + 157 -> {166}; + 158 -> {159}; + 159 -> {160}; + 160 -> {161}; + 161 -> {162}; + 162 -> {163}; + 163 -> {164}; + 164 -> {165}; + 165 -> {166}; + 166 -> {167}; + 167 -> {168}; + 168 -> {169}; + 169 -> {170}; + 170 -> {171}; + 171 -> {172}; + 172 -> {217 173}; + 173 -> {174}; + 174 -> {175}; + 175 -> {209 176}; + 176 -> {177}; + 177 -> {178}; + 178 -> {193 179}; + 179 -> {180}; + 180 -> {181}; + 181 -> {182}; + 182 -> {183}; + 183 -> {184}; + 184 -> {185}; + 185 -> {186}; + 186 -> {187}; + 187 -> {188}; + 188 -> {189}; + 189 -> {190}; + 190 -> {191}; + 191 -> {192}; + 192 -> {221}; + 193 -> {194}; + 194 -> {195}; + 195 -> {196}; + 196 -> {197}; + 197 -> {198}; + 198 -> {199}; + 199 -> {200}; + 200 -> {201}; + 201 -> {202}; + 202 -> {203}; + 203 -> {204}; + 204 -> {205}; + 205 -> {206}; + 206 -> {207}; + 207 -> {208}; + 208 -> {221}; + 209 -> {210}; + 210 -> {211}; + 211 -> {212}; + 212 -> {213}; + 213 -> {214}; + 214 -> {215}; + 215 -> {216}; + 216 -> {221}; + 217 -> {218}; + 218 -> {219}; + 219 -> {220}; + 220 -> {221}; + 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]; } - 222 [label="Exit function test_3" style="filled" fillcolor=red]; - } - 139 -> {140}; - 140 -> {141}; - 141 -> {142}; - 142 -> {143}; - 143 -> {144}; - 144 -> {145}; - 145 -> {158 146}; - 146 -> {147}; - 147 -> {148}; - 148 -> {150 149}; - 149 -> {166}; - 150 -> {151}; - 151 -> {152}; - 152 -> {153}; - 153 -> {154}; - 154 -> {155}; - 155 -> {156}; - 156 -> {157}; - 157 -> {166}; - 158 -> {159}; - 159 -> {160}; - 160 -> {161}; - 161 -> {162}; - 162 -> {163}; - 163 -> {164}; - 164 -> {165}; - 165 -> {166}; - 166 -> {167}; - 167 -> {168}; - 168 -> {169}; - 169 -> {170}; - 170 -> {171}; - 171 -> {172}; - 172 -> {217 173}; - 173 -> {174}; - 174 -> {175}; - 175 -> {209 176}; - 176 -> {177}; - 177 -> {178}; - 178 -> {193 179}; - 179 -> {180}; - 180 -> {181}; - 181 -> {182}; - 182 -> {183}; - 183 -> {184}; - 184 -> {185}; - 185 -> {186}; - 186 -> {187}; - 187 -> {188}; - 188 -> {189}; - 189 -> {190}; - 190 -> {191}; - 191 -> {192}; - 192 -> {221}; - 193 -> {194}; - 194 -> {195}; - 195 -> {196}; - 196 -> {197}; - 197 -> {198}; - 198 -> {199}; - 199 -> {200}; - 200 -> {201}; - 201 -> {202}; - 202 -> {203}; - 203 -> {204}; - 204 -> {205}; - 205 -> {206}; - 206 -> {207}; - 207 -> {208}; - 208 -> {221}; - 209 -> {210}; - 210 -> {211}; - 211 -> {212}; - 212 -> {213}; - 213 -> {214}; - 214 -> {215}; - 215 -> {216}; - 216 -> {221}; - 217 -> {218}; - 218 -> {219}; - 219 -> {220}; - 220 -> {221}; - 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}; - 228 -> {229}; - 229 -> {230}; - 230 -> {232 231}; - 231 -> {238}; - 232 -> {233}; - 233 -> {234}; - 234 -> {235}; - 235 -> {236}; - 236 -> {237}; - 237 -> {238}; - 238 -> {239}; - 239 -> {240}; - 240 -> {241}; + 223 -> {224}; + 224 -> {225}; + 225 -> {226}; + 226 -> {227}; + 227 -> {228}; + 228 -> {229}; + 229 -> {230}; + 230 -> {232 231}; + 231 -> {238}; + 232 -> {233}; + 233 -> {234}; + 234 -> {235}; + 235 -> {236}; + 236 -> {237}; + 237 -> {238}; + 238 -> {239}; + 239 -> {240}; + 240 -> {241}; } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot b/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot index 2578435fabc..ad94cd9f1e7 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot +++ b/compiler/fir/resolve/testData/resolve/stdlib/contracts/callsInPlace.dot @@ -1,259 +1,259 @@ digraph callsInPlace_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - 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 - 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| { + 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 + 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) } )"]; - 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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - - subgraph cluster_2 { - color=red - 10 [label="Enter function test_2" style="filled" fillcolor=red]; - 11 [label="Const: Int(10)"]; - subgraph cluster_3 { - color=blue - 12 [label="Enter function anonymousFunction"]; - 13 [label="Const: String(test_2)"]; - 14 [label="Exit function anonymousFunction"]; + 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]; } - 15 [label="Function call: R|kotlin/repeat|(Int(10), = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + + subgraph cluster_2 { + color=red + 10 [label="Enter function test_2" style="filled" fillcolor=red]; + 11 [label="Const: Int(10)"]; + subgraph cluster_3 { + color=blue + 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) } )"]; - 16 [label="Exit function test_2" style="filled" fillcolor=red]; - } - - 10 -> {11}; - 11 -> {12}; - 12 -> {14 13}; - 13 -> {14}; - 14 -> {12 15}; - 15 -> {16}; - - subgraph cluster_4 { - color=red - 17 [label="Enter function test_3" style="filled" fillcolor=red]; - 18 [label="Const: Int(10)"]; - subgraph cluster_5 { - color=blue - 19 [label="Enter function anonymousFunction"]; - 20 [label="Const: String(test_3)"]; - 21 [label="Exit function anonymousFunction"]; + 16 [label="Exit function test_2" style="filled" fillcolor=red]; } - 22 [label="Function call: R|kotlin/repeat|(action = repeat@fun (it: R|kotlin/Int|): R|kotlin/Unit| { + + 10 -> {11}; + 11 -> {12}; + 12 -> {14 13}; + 13 -> {14}; + 14 -> {12 15}; + 15 -> {16}; + + subgraph cluster_4 { + color=red + 17 [label="Enter function test_3" style="filled" fillcolor=red]; + 18 [label="Const: Int(10)"]; + subgraph cluster_5 { + color=blue + 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))"]; - 23 [label="Exit function test_3" style="filled" fillcolor=red]; - } - - 17 -> {18}; - 18 -> {19}; - 19 -> {21 20}; - 20 -> {21}; - 21 -> {19 22}; - 22 -> {23}; - - subgraph cluster_6 { - color=red - 24 [label="Enter function test_4" style="filled" fillcolor=red]; - 25 [label="Const: Int(1)"]; - subgraph cluster_7 { - color=blue - 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"]; + 23 [label="Exit function test_3" style="filled" fillcolor=red]; } - 32 [label="Function call: Int(1).R|kotlin/takeUnless|( = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { + + 17 -> {18}; + 18 -> {19}; + 19 -> {21 20}; + 20 -> {21}; + 21 -> {19 22}; + 22 -> {23}; + + subgraph cluster_6 { + color=red + 24 [label="Enter function test_4" style="filled" fillcolor=red]; + 25 [label="Const: Int(1)"]; + subgraph cluster_7 { + color=blue + 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)) } )"]; - 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"]; + 33 [label="Exit function test_4" style="filled" fillcolor=red]; } - 42 [label="Function call: Int(1).R|kotlin/takeUnless|(predicate = takeUnless@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { + + 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}; - 39 -> {40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - - 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}; - - subgraph cluster_11 { - color=red - 48 [label="Enter function test_6" style="filled" fillcolor=red]; - subgraph cluster_12 { - color=blue - 49 [label="Enter function anonymousFunction"]; - 50 [label="Const: String(test_6_1)"]; - 51 [label="Exit function anonymousFunction"]; + 43 [label="Exit function test_5" style="filled" fillcolor=red]; } - subgraph cluster_13 { - color=blue - 52 [label="Enter function anonymousFunction"]; - 53 [label="Const: String(test_6_2)"]; - 54 [label="Exit function anonymousFunction"]; + + 34 -> {35}; + 35 -> {36}; + 36 -> {37}; + 37 -> {38}; + 38 -> {39}; + 39 -> {40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + + 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]; } - 55 [label="Function call: R|/myRun|(myRun@fun (): R|kotlin/Unit| { + + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + + subgraph cluster_11 { + color=red + 48 [label="Enter function test_6" style="filled" fillcolor=red]; + subgraph cluster_12 { + color=blue + 49 [label="Enter function anonymousFunction"]; + 50 [label="Const: String(test_6_1)"]; + 51 [label="Exit function anonymousFunction"]; + } + subgraph cluster_13 { + color=blue + 52 [label="Enter function anonymousFunction"]; + 53 [label="Const: String(test_6_2)"]; + 54 [label="Exit function anonymousFunction"]; + } + 55 [label="Function call: R|/myRun|(myRun@fun (): R|kotlin/Unit| { String(test_6_1) } , = myRun@fun (): R|kotlin/Unit| { String(test_6_2) } )"]; - 56 [label="Exit function test_6" style="filled" fillcolor=red]; - } - - 48 -> {49}; - 49 -> {51 50}; - 50 -> {51}; - 51 -> {49 52}; - 52 -> {54 53}; - 53 -> {54}; - 54 -> {52 55}; - 55 -> {56}; - - subgraph cluster_14 { - color=red - 57 [label="Enter function test_7" style="filled" fillcolor=red]; - subgraph cluster_15 { - color=blue - 58 [label="Enter function anonymousFunction"]; - 59 [label="Const: String(test_7_2)"]; - 60 [label="Exit function anonymousFunction"]; + 56 [label="Exit function test_6" style="filled" fillcolor=red]; } - 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| { + + 48 -> {49}; + 49 -> {51 50}; + 50 -> {51}; + 51 -> {49 52}; + 52 -> {54 53}; + 53 -> {54}; + 54 -> {52 55}; + 55 -> {56}; + + subgraph cluster_14 { + color=red + 57 [label="Enter function test_7" style="filled" fillcolor=red]; + subgraph cluster_15 { + color=blue + 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) } )"]; - 65 [label="Exit function test_7" style="filled" fillcolor=red]; - } + 65 [label="Exit function test_7" style="filled" fillcolor=red]; + } - 57 -> {58}; - 58 -> {60 59}; - 59 -> {60}; - 60 -> {58 61}; - 61 -> {63 62}; - 62 -> {63}; - 63 -> {61 64}; - 64 -> {65}; + 57 -> {58}; + 58 -> {60 59}; + 59 -> {60}; + 60 -> {58 61}; + 61 -> {63 62}; + 62 -> {63}; + 63 -> {61 64}; + 64 -> {65}; - subgraph cluster_17 { - color=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]; - } + subgraph cluster_17 { + color=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]; + } - 66 -> {67}; - 67 -> {68}; + 66 -> {67}; + 67 -> {68}; - subgraph cluster_18 { - color=red - 69 [label="Enter function test_8" style="filled" fillcolor=red]; - 70 [label="Function call: R|/myDummyRun|( = myDummyRun@fun (): R|kotlin/Unit| { + subgraph cluster_18 { + color=red + 69 [label="Enter function test_8" style="filled" fillcolor=red]; + 70 [label="Function call: R|/myDummyRun|( = myDummyRun@fun (): R|kotlin/Unit| { String(test_8) } )"]; - 71 [label="Exit function test_8" style="filled" fillcolor=red]; - } + 71 [label="Exit function test_8" style="filled" fillcolor=red]; + } - 69 -> {70}; - 70 -> {71}; + 69 -> {70}; + 70 -> {71}; - subgraph cluster_19 { - color=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]; - } + subgraph cluster_19 { + color=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]; + } - 72 -> {73}; - 73 -> {74}; + 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 762870503ce..333f576cb0f 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot +++ b/compiler/fir/resolve/testData/resolve/stdlib/contracts/conditionalEffects.dot @@ -1,345 +1,345 @@ digraph conditionalEffects_kt { - graph [splines=ortho nodesep=3] - node [shape=box penwidth=2] - edge [penwidth=2] + graph [splines=ortho nodesep=3] + node [shape=box penwidth=2] + edge [penwidth=2] - 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 - 4 [label="Enter contract"]; - 5 [label="Access variable R|/x|"]; - 6 [label="Type operator: x is Int"]; - 7 [label="Exit contract"]; - } - 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}; - 1 -> {2}; - 2 -> {3}; - 3 -> {4}; - 4 -> {5}; - 5 -> {6}; - 6 -> {7}; - 7 -> {8}; - 8 -> {9}; - 9 -> {10}; - - subgraph cluster_2 { - color=red - 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 contract"]; - 15 [label="Access variable R|/x|"]; - 16 [label="Const: Null(null)"]; - 17 [label="Operator !="]; - 18 [label="Exit contract"]; - } - 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}; - 16 -> {17}; - 17 -> {18}; - 18 -> {19}; - 19 -> {20}; - 20 -> {21}; - - subgraph cluster_4 { - color=red - 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 contract"]; - 28 [label="Access variable R|/x|"]; - 29 [label="Const: Null(null)"]; - 30 [label="Operator !="]; - 31 [label="Exit contract"]; - } - 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}; - 29 -> {30}; - 30 -> {31}; - 31 -> {32}; - 32 -> {33}; - 33 -> {34}; - - 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 -> {44 40}; - 40 -> {41}; - 41 -> {42}; - 42 -> {43}; - 43 -> {44}; - 44 -> {45}; - 45 -> {46}; - 46 -> {47}; - 47 -> {48}; - 48 -> {49}; - 49 -> {50}; - 50 -> {55 51}; - 51 -> {52}; - 52 -> {53}; - 53 -> {54}; - 54 -> {55}; - 55 -> {56}; - 56 -> {57}; - 57 -> {58}; - 58 -> {59}; - 59 -> {60}; - 60 -> {61}; - - 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"]; + 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 + 4 [label="Enter contract"]; + 5 [label="Access variable R|/x|"]; + 6 [label="Type operator: x is Int"]; + 7 [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"]; + 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]; } - 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 -> {75 67}; - 67 -> {68}; - 68 -> {69}; - 69 -> {70}; - 70 -> {71}; - 71 -> {72}; - 72 -> {73}; - 73 -> {74}; - 74 -> {88}; - 75 -> {76}; - 76 -> {77}; - 77 -> {78}; - 78 -> {79}; - 79 -> {80}; - 80 -> {81}; - 81 -> {82}; - 82 -> {83}; - 83 -> {84}; - 84 -> {85}; - 85 -> {86}; - 86 -> {87}; - 87 -> {88}; - 88 -> {89}; - 89 -> {90}; - 90 -> {91}; + 0 -> {1}; + 1 -> {2}; + 2 -> {3}; + 3 -> {4}; + 4 -> {5}; + 5 -> {6}; + 6 -> {7}; + 7 -> {8}; + 8 -> {9}; + 9 -> {10}; - 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"]; + subgraph cluster_2 { + color=red + 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 contract"]; + 15 [label="Access variable R|/x|"]; + 16 [label="Const: Null(null)"]; + 17 [label="Operator !="]; + 18 [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"]; + 19 [label="Access variable R|/x|"]; + 20 [label="Access variable R|kotlin/String.length|"]; + 21 [label="Exit function test_2" style="filled" fillcolor=red]; } - 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 -> {112 97}; - 97 -> {98}; - 98 -> {99}; - 99 -> {100}; - 100 -> {101}; - 101 -> {102}; - 102 -> {103}; - 103 -> {104}; - 104 -> {105}; - 105 -> {106}; - 106 -> {107}; - 107 -> {108}; - 108 -> {109}; - 109 -> {110}; - 110 -> {111}; - 111 -> {125}; - 112 -> {113}; - 113 -> {114}; - 114 -> {115}; - 115 -> {116}; - 116 -> {117}; - 117 -> {118}; - 118 -> {119}; - 119 -> {120}; - 120 -> {121}; - 121 -> {122}; - 122 -> {123}; - 123 -> {124}; - 124 -> {125}; - 125 -> {126}; - 126 -> {127}; - 127 -> {128}; + 11 -> {12}; + 12 -> {13}; + 13 -> {14}; + 14 -> {15}; + 15 -> {16}; + 16 -> {17}; + 17 -> {18}; + 18 -> {19}; + 19 -> {20}; + 20 -> {21}; + + subgraph cluster_4 { + color=red + 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 contract"]; + 28 [label="Access variable R|/x|"]; + 29 [label="Const: Null(null)"]; + 30 [label="Operator !="]; + 31 [label="Exit contract"]; + } + 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}; + 29 -> {30}; + 30 -> {31}; + 31 -> {32}; + 32 -> {33}; + 33 -> {34}; + + 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 -> {44 40}; + 40 -> {41}; + 41 -> {42}; + 42 -> {43}; + 43 -> {44}; + 44 -> {45}; + 45 -> {46}; + 46 -> {47}; + 47 -> {48}; + 48 -> {49}; + 49 -> {50}; + 50 -> {55 51}; + 51 -> {52}; + 52 -> {53}; + 53 -> {54}; + 54 -> {55}; + 55 -> {56}; + 56 -> {57}; + 57 -> {58}; + 58 -> {59}; + 59 -> {60}; + 60 -> {61}; + + 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 -> {75 67}; + 67 -> {68}; + 68 -> {69}; + 69 -> {70}; + 70 -> {71}; + 71 -> {72}; + 72 -> {73}; + 73 -> {74}; + 74 -> {88}; + 75 -> {76}; + 76 -> {77}; + 77 -> {78}; + 78 -> {79}; + 79 -> {80}; + 80 -> {81}; + 81 -> {82}; + 82 -> {83}; + 83 -> {84}; + 84 -> {85}; + 85 -> {86}; + 86 -> {87}; + 87 -> {88}; + 88 -> {89}; + 89 -> {90}; + 90 -> {91}; + + 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 -> {112 97}; + 97 -> {98}; + 98 -> {99}; + 99 -> {100}; + 100 -> {101}; + 101 -> {102}; + 102 -> {103}; + 103 -> {104}; + 104 -> {105}; + 105 -> {106}; + 106 -> {107}; + 107 -> {108}; + 108 -> {109}; + 109 -> {110}; + 110 -> {111}; + 111 -> {125}; + 112 -> {113}; + 113 -> {114}; + 114 -> {115}; + 115 -> {116}; + 116 -> {117}; + 117 -> {118}; + 118 -> {119}; + 119 -> {120}; + 120 -> {121}; + 121 -> {122}; + 122 -> {123}; + 123 -> {124}; + 124 -> {125}; + 125 -> {126}; + 126 -> {127}; + 127 -> {128}; } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithCfgTest.kt b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithCfgTest.kt index 82aa553246e..90b7a07115a 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithCfgTest.kt +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithCfgTest.kt @@ -5,18 +5,20 @@ package org.jetbrains.kotlin.fir +import junit.framework.TestCase import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference import org.jetbrains.kotlin.fir.resolve.dfa.FirControlFlowGraphReferenceImpl -import org.jetbrains.kotlin.fir.resolve.dfa.cfg.* +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.CFGNode +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.ControlFlowGraph +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.EdgeKind +import org.jetbrains.kotlin.fir.resolve.dfa.cfg.FirControlFlowGraphRenderVisitor import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase import java.io.File -private const val EDGE = " -> " -private const val INDENT = " " -private const val RED = "red" -private const val BLUE = "blue" + /* * For comfort viewing dumps of control flow graph you can setup external tool in IDEA that opens .dot files @@ -43,122 +45,53 @@ abstract class AbstractFirDiagnosticsWithCfgTest : AbstractFirDiagnosticsTest() super.runAnalysis(testDataFile, testFiles, firFilesPerSession) val allFirFiles = firFilesPerSession.values.flatten() checkCfg(testDataFile, allFirFiles) + checkCfgEdgeConsistency(allFirFiles) } - fun checkCfg(testDataFile: File, firFiles: List) { - val simpleBuilder = StringBuilder() - val dotBuilder = StringBuilder() + private fun checkCfg(testDataFile: File, firFiles: List) { + val builder = StringBuilder() - firFiles.first().accept(FirControlFlowGraphRenderVisitor(simpleBuilder, dotBuilder), null) + firFiles.first().accept(FirControlFlowGraphRenderVisitor(builder), null) - val dotCfgDump = dotBuilder.toString() + val dotCfgDump = builder.toString() val dotExpectedPath = testDataFile.absolutePath.replace(".kt", ".dot") KotlinTestUtils.assertEqualsToFile(File(dotExpectedPath), dotCfgDump) } - private class FirControlFlowGraphRenderVisitor( - private val simpleBuilder: StringBuilder, - private val dotBuilder: StringBuilder - ) : FirVisitorVoid() { - private var indexOffset = 0 - private var clusterCounter = 0 - private var offset = 1 - - override fun visitFile(file: FirFile) { - dotBuilder.appendln("digraph ${file.name.replace(".", "_")} {") - .appendln("${INDENT}graph [splines=ortho nodesep=3]") - .appendln("${INDENT}node [shape=box penwidth=2]") - .appendln("${INDENT}edge [penwidth=2]") - .appendln() - visitElement(file) - dotBuilder.appendln("}") - } + private fun checkCfgEdgeConsistency(firFiles: List) { + firFiles.forEach { it.accept(CfgConsistencyChecker) } + } + private object CfgConsistencyChecker : FirVisitorVoid() { override fun visitElement(element: FirElement) { element.acceptChildren(this) } override fun visitControlFlowGraphReference(controlFlowGraphReference: FirControlFlowGraphReference) { - val controlFlowGraph = (controlFlowGraphReference as? FirControlFlowGraphReferenceImpl)?.controlFlowGraph ?: return - controlFlowGraph.renderToStringBuilder(simpleBuilder) - indexOffset = controlFlowGraph.dotRenderToStringBuilder(dotBuilder) - dotBuilder.appendln() + val graph = (controlFlowGraphReference as? FirControlFlowGraphReferenceImpl)?.controlFlowGraph ?: return + checkConsistency(graph) } - private fun StringBuilder.enterCluster(color: String) { - indent() - appendln("subgraph cluster_${clusterCounter++} {") - offset++ - indent() - appendln("color=$color") - } - - private fun StringBuilder.exitCluster() { - offset-- - indent() - appendln("}") - } - - private fun StringBuilder.indent() { - append(INDENT.repeat(offset)) - } - - fun ControlFlowGraph.dotRenderToStringBuilder(builder: StringBuilder): Int { - with(builder) { - val sortedNodes = sortNodes() - val indices = sortedNodes.indicesMap().mapValues { (_, index) -> index + indexOffset } - - fun CFGNode<*>.splitEdges(): Pair>, List>> = - if (isDead) emptyList>() to followingNodes - else followingNodes.filter { !it.isDead } to followingNodes.filter { it.isDead } - - var color = RED - sortedNodes.forEach { - if (it is EnterNode) { - enterCluster(color) - color = BLUE - } - indent() - append(indices.getValue(it)) - val attributes = mutableListOf() - attributes += "label=\"${it.render().replace("\"", "")}\"" - if (it == enterNode || it == exitNode) { - attributes += "style=\"filled\"" - attributes += "fillcolor=red" - } - if (it.isDead) { - attributes += "style=\"filled\"" - attributes += "fillcolor=gray" - } - appendln(attributes.joinToString(separator = " ", prefix = " [", postfix = "];")) - if (it is ExitNode) { - exitCluster() - } + private fun checkConsistency(graph: ControlFlowGraph) { + for (node in graph.nodes) { + for (to in node.followingNodes) { + checkEdge(node, to) } - appendln() - - sortedNodes.forEachIndexed { i, node -> - if (node.followingNodes.isEmpty()) return@forEachIndexed - - val (aliveEdges, deadEdges) = node.splitEdges() - - fun renderEdges(edges: List>, isDead: Boolean) { - if (edges.isEmpty()) return - indent() - append(i + indexOffset) - append(EDGE) - append(edges.joinToString(prefix = "{", postfix = "}", separator = " ") { indices.getValue(it).toString() }) - if (isDead) { - append(" [style=dotted]") - } - appendln(";") - } - - renderEdges(aliveEdges, false) - renderEdges(deadEdges, true) + for (from in node.previousNodes) { + checkEdge(from, node) } + TestCase.assertTrue(node.followingNodes.isNotEmpty() || node.previousNodes.isNotEmpty()) + } + } - return indexOffset + sortedNodes.size + private fun checkEdge(from: CFGNode<*>, to: CFGNode<*>) { + KtUsefulTestCase.assertContainsElements(from.followingNodes, to) + KtUsefulTestCase.assertContainsElements(to.previousNodes, from) + val fromKind = from.outgoingEdges.getValue(to) + val toKind = to.incomingEdges.getValue(from) + TestCase.assertEquals(fromKind, toKind) + if (from.isDead || to.isDead) { + TestCase.assertEquals(EdgeKind.Dead, fromKind) } } }