by udalov · 11y ago · 0 comments
You can basically consider 'when'-expressions to be syntax sugar over Java's if-else or ternary operator (?:) chains.
So there are no non-exhaustive pattern matches, is what you are saying? i.e. they all must be exhaustive. Except for your enum example
More info in the official reference: https://kotlinlang.org/docs/reference/control-flow.html#when...