Support multiple nested try blocks
This commit is contained in:
committed by
TeamCityServer
parent
ad6ba0cf11
commit
c3b0c9c6b2
@@ -728,14 +728,13 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map
|
|||||||
for (catchBlock in expression.catches) {
|
for (catchBlock in expression.catches) {
|
||||||
if (exception.isSubtypeOf(catchBlock.catchParameter.type.classOrNull!!.owner)) {
|
if (exception.isSubtypeOf(catchBlock.catchParameter.type.classOrNull!!.owner)) {
|
||||||
catchBlock.interpret().check { return it }
|
catchBlock.interpret().check { return it }
|
||||||
break
|
return Next
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return Exception
|
||||||
} finally {
|
} finally {
|
||||||
expression.finallyExpression?.interpret()?.check { return it }
|
expression.finallyExpression?.takeIf { (it as? IrBlock)?.statements?.isEmpty() != true }?.interpret()?.check { return it }
|
||||||
}
|
}
|
||||||
|
|
||||||
return Next
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun interpretCatch(expression: IrCatch): ExecutionResult {
|
private fun interpretCatch(expression: IrCatch): ExecutionResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user