Fix for 'getNthResult' in IfThenElse expression impl
This commit is contained in:
committed by
Dmitry Petrov
parent
f4aee6cab5
commit
fe51c35298
+10
-1
@@ -45,7 +45,16 @@ class IrIfThenElseImpl(
|
|||||||
if (n == 0) condition else null
|
if (n == 0) condition else null
|
||||||
|
|
||||||
override fun getNthResult(n: Int): IrExpression? =
|
override fun getNthResult(n: Int): IrExpression? =
|
||||||
if (n == 0) thenBranch else null
|
when (n) {
|
||||||
|
0 -> {
|
||||||
|
thenBranch
|
||||||
|
}
|
||||||
|
1 -> {
|
||||||
|
elseBranch
|
||||||
|
}
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun putNthCondition(n: Int, expression: IrExpression) {
|
override fun putNthCondition(n: Int, expression: IrExpression) {
|
||||||
if (n == 0) condition = expression
|
if (n == 0) condition = expression
|
||||||
|
|||||||
Reference in New Issue
Block a user