Multiple dispatch uses run-time multi-methods that gives programmer more flexibility in programming, and consequently allows a cow be an animal even the cow redefines its food type to plant food.
The problem of narrowing an interface is solved by keeping the original interface (invariance) parallel to the added specialized interface, and the selection is done by run-time dispatch. Though the invariant interface does not exist explicitly in a subclass, the resolution algorithm will consider the one defined in superclass as if it were declared in subclasses. The redefined eat method in Cow does not override the eat method defined in its superclass. Instead, it overloads to the superclass's eat method. A cow will in fact have two eat methods:
class Cow is Animal
proc eat (food: AnyFood);
proc eat (food: PlantFood);
end;
Consider:
animal: Animal;
...
animal.eat (meat);
If the variable animal refers to a cow, the actual called method will be eat(AnyFood), not eat(PlantFood).
However, there are efficiency problems with multiple dispatch. Multiple run-time dispatch must check the exact type of the animal as well as the exact type of the food in order to determine which eat method should be called.
The question is whether a run-time type check is necessary for this case. Should a cow have more than one eat method: one dealing with the food it can eat, and another dealing with the food it cannot eat?
If we have an animal, say a pig, that can eat various food that does not fall into any food classification, we may have different eat method for this animal depending on what kind of food types it's going to eat. But if we can classify animals into herbivores and carnivores by the sub food classes of plant food and flesh food, why should we include a flesh-eating method in a herbivore animal or vise versa?