Introduction to OOP Chapter 11: Static and Dynamic Behavior: next previous audio real text

Reverse Polymorphism

Polymorphism says we can assign a value from a child class to an instance of the parent class, but can this assignment then be reversed? Under what conditions?

var
	pet : Mammal;
	fido : Dog;
	felice : Cat;
begin
	pet := fido;	// legal
	fido := pet;	// is this legal? 
end;

This is known as the problem of reverse polymorphism.
Intro OOP, Chapter 11, Slide 08