Files
kotlin-fork/compiler/testData/ir/irText/expressions/whenCoercedToUnit.kt
T
Dmitry Petrov d0134f2c64 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.
2017-03-01 09:25:38 +03:00

8 lines
73 B
Kotlin
Vendored

// WITH_RUNTIME
fun foo(x: Int) {
when (x) {
0 -> 0
}
}