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?

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

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