diesieben07
02/19/2019, 11:46 AMis 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.