Join Slack
Powered by
You can be sure you covered all direct subclasses,...
# announcements
k
karelpeeters
12/20/2018, 10:55 AM
You can be sure you covered all
direct
subclasses, and so you `when`s definitely stay exhaustive.
d
Dias
12/20/2018, 11:05 AM
hmm, wouldn't it make sense to restrict all subclasses? given that sealed supposed to be an "enum on steroids"
d
Dominaezzz
12/20/2018, 11:14 AM
You can restrict all subclasses if you wish.
k
karelpeeters
12/20/2018, 11:16 AM
Well think about
https://en.wikipedia.org/wiki/Liskov_substitution_principle
, it should matter that you get a subclass because they should still behave as the parent class.
2
Views
Open in Slack
Previous
Next