can somebody tell me why this is legal kotlin?
# announcements
g
can somebody tell me why this is legal kotlin?
youtrack 1
🪲 1
k
What does it print?
g
Copy code
java.lang.ClassCastException: class kotlin.Unit cannot be cast to class java.lang.Number
--which is thrown, not printed
k
Then that's clearly a bug simple smile
d
Shouldn't be legal because the
when
is used as an expression, i.e. it should require an else branch. Weird.