Introduction to OOP: Chapter 10: Subclasses and Subtypes
Two aspects of reverse polymorphism
There are two specific problems associated with the question of reverse
The problem of identity - can I tell if a value declared as an instance of
a parent class actually holds a value from a subclass.
The task of assignment - can I then assign the value from the parent class
to a variable declared as the subclass.
In some languages mechanisms are provided to address these two problems
together, while in other languages they are separated.