Join Slack
Powered by
Is there an issue for making exhaustive when requi...
# announcements
k
karelpeeters
02/21/2018, 11:27 AM
Is there an issue for making exhaustive when requirements a bit smarter? Eg. code like this:
Copy code
val a: Int = ... val sign = when { a > 0 -> 1 a == 0 -> 0 a < 0 -> -1 }
doesn't compile, you'd have to use
else
for the last branch, which makes things a bit less clear.
5
Views
Open in Slack
Previous
Next