I think the explicit `is Cat` is better for when y...
# announcements
d
I think the explicit
is Cat
is better for when you later add more subclasses to the sealed class. In that case you will get an "when is not exhaustive", instead of a failed smart-cast in the else. And your if (
if (animal is Cat)
instead of
!is Dog
) would still work just fine.
👍 2