KT-16437 Incorrect type inference for some when coerced to Unit

If the result of 'when' is not used in an expression,
this 'when' expression has type 'Unit' despite of whatever FE has inferred.
This commit is contained in:
Dmitry Petrov
2017-02-27 16:21:16 +03:00
parent e2e57e5b6d
commit d0134f2c64
6 changed files with 35 additions and 4 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ CONTENT
1 FUN public fun toString(grade: kotlin.String): kotlin.String
2 GET_VAR 'value-parameter grade: String' type=kotlin.String origin=null
3 VAR IR_TEMPORARY_VARIABLE val tmp0_subject: kotlin.String
4 WHEN type=kotlin.Nothing origin=WHEN
4 WHEN type=kotlin.Unit origin=WHEN
5 GET_VAR 'tmp0_subject: String' type=kotlin.String origin=null
6 CONST String type=kotlin.String value='A'
OUTGOING -> BB 1, 5