76931affc6
Non-exhaustive 'when' without 'else' used in expression is an error regardless of expected type: it can't be an expression, even of type Unit.
7 lines
121 B
Kotlin
Vendored
7 lines
121 B
Kotlin
Vendored
fun foo(x: Int) {
|
|
val y: Unit = <!NO_ELSE_IN_WHEN!>when<!> (x) {
|
|
2 -> {}
|
|
3 -> {}
|
|
}
|
|
return y
|
|
} |