Return Unit value from block if statements count is equal to zero

This commit is contained in:
Ivan Kylchik
2020-08-07 21:36:39 +03:00
committed by TeamCityServer
parent 13ab7eafca
commit a084dabdde
@@ -448,6 +448,7 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map
}
private fun interpretStatements(statements: List<IrStatement>): ExecutionResult {
if (statements.isEmpty()) return Next.apply { stack.pushReturnValue(Common(irBuiltIns.unitClass.owner)) }
var executionResult: ExecutionResult = Next
for (statement in statements) {
when (statement) {