[FIR] Fix forgotten level changes during building CFG for !!

This commit is contained in:
Dmitriy Novozhilov
2022-06-20 12:09:53 +03:00
committed by teamcity
parent d835005647
commit ed8187109a
8 changed files with 304 additions and 1 deletions
@@ -44,7 +44,6 @@ class ControlFlowGraphBuilder {
get() = lastNodes.top()
var levelCounter: Int = 0
private set
private val modes: Stack<Mode> = stackOf(Mode.TopLevel)
private val mode: Mode get() = modes.top()
@@ -1147,6 +1146,7 @@ class ControlFlowGraphBuilder {
checkNotNullCall: FirCheckNotNullCall,
callCompleted: Boolean
): Pair<CheckNotNullCallNode, UnionFunctionCallArgumentsNode?> {
levelCounter--
val node = createCheckNotNullCallNode(checkNotNullCall)
if (checkNotNullCall.resultType.isNothing) {
addNodeThatReturnsNothing(node)