Fix CFG problem for 'when' in Konan

If type of 'when' expression is 'Nothing', it should be kept that way
even if the expression itself is implicitly coerced to Unit.
This commit is contained in:
Dmitry Petrov
2017-06-21 15:27:13 +03:00
parent 1f34dfabd5
commit 2b3043bf9f
3 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -2,10 +2,10 @@ FILE /whenReturn.kt
FUN public fun toString(grade: kotlin.String): kotlin.String
VALUE_PARAMETER value-parameter grade: kotlin.String
BLOCK_BODY
BLOCK type=kotlin.Unit origin=WHEN
BLOCK type=kotlin.Nothing origin=WHEN
VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.String
GET_VAR 'value-parameter grade: String' type=kotlin.String origin=null
WHEN type=kotlin.Unit origin=WHEN
WHEN type=kotlin.Nothing origin=WHEN
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'tmp0_subject: String' type=kotlin.String origin=null