The Kotlin compiler allows when without else when it's used as a statement.
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.
We should therefore exclude switch which are not statements.
Does not apply to Kotlin (see comments)
Applies to Ruby