Skip to content

A list of dogs is not a list of animals

Dog extends Animal, yet most languages refuse to let a List<Dog> be used where a List<Animal> is expected.

Why is that refusal correct?