3 ms·
Maybe I wasn't clear enough. Kotlin checks exhaustivity of when only if it is used as an expression, not as a statement. https://kotlinlang.org/docs/reference
by kod 7y ago
Maybe I wasn't clear enough.
Kotlin checks exhaustivity of when only if it is used as an expression, not as a statement.
https://kotlinlang.org/docs/reference/control-flow.html#when-expression https://kotlinlang.org/docs/reference/control-flow.html#when...
Kotlin doesn't allow destructuring in when:
https://discuss.kotlinlang.org/t/destructuring-in-when/2391 https://discuss.kotlinlang.org/t/destructuring-in-when/2391
This is just straight up weak coming from any reasonable ML derived language with real pattern matching.