Inheritance is not subtyping

  • Authors:
  • William R. Cook;Walter Hill;Peter S. Canning

  • Affiliations:
  • Hewlett-Packard Laboratories, P.O. Box 10490, Palo Alto CA;Hewlett-Packard Laboratories, P.O. Box 10490, Palo Alto CA;Hewlett-Packard Laboratories, P.O. Box 10490, Palo Alto CA

  • Venue:
  • POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

In typed object-oriented languages the subtype relation is typically based on the inheritance hierarchy. This approach, however, leads either to insecure type-systems or to restrictions on inheritance that make it less flexible than untyped Smalltalk inheritance. We present a new typed model of inheritance that allows more of the flexibility of Smalltalk inheritance within a statically-typed system. Significant features of our analysis are the introduction of polymorphism into the typing of inheritance and the uniform application of inheritance to objects, classes and types. The resulting notion of type inheritance allows us to show that the type of an inherited object is an inherited type but not always a subtype.