[gnu.g++] On relaxing an unnecessary restrict

johnson@p.cs.uiuc.edu (12/17/89)

William Cook wrote a paper in the 1989 ECOOP that does a good job
of describing the issue in type systems for object-oriented languages.
The main purpose of the paper was to describe a flaw in the Eiffel
type system (he also showed how to fix it), but the paper also argued
that it is usually not very useful for a function in a subclass to
have a different return type or argument type that in a superclass.
This is because polymorphic routines that can take an object of either
the subclass or superclass have to assume the most general, i.e. the
superclass.  He also argued that what is really needed in those cases
when you want to change the return type or argument type is to
parameterize the class with the type.

Thus, the problem with C++ is not so much that you can't change the
types of functions in subclasses, it is that C++ doesn't have
parameterized classes (yet).

Ralph Johnson -- U. of Illinois at Urbana-Champaign