Fix for 'getNthResult' in IfThenElse expression impl

This commit is contained in:
Michael Bogdanov
2016-09-19 11:44:02 +03:00
committed by Dmitry Petrov
parent f4aee6cab5
commit fe51c35298
@@ -45,7 +45,16 @@ class IrIfThenElseImpl(
if (n == 0) condition else null
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) {
if (n == 0) condition = expression