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
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(x: Int) {
when (x) {
0 -> 0
}
}