Looking at the documentation for when: <https://ko...
# getting-started
d
Looking at the documentation for when: https://kotlinlang.org/docs/reference/control-flow.html#when-expression it says that
if when is used as an expression, the else branch is mandatory unless the compiler can prove that all possible cases are covered with branch conditions
I believe the reason that you're getting no complaints about the when not being exhaustive is because the when statement is not returning anything. Because of this it is treated as a statement and does not need to be exhaustive.
👍 1