On Problems in Polymorphic Object-Oriented Languages With Self Types and Matching

  • Authors:
  • Michael Winter

  • Affiliations:
  • Department of Computer Science, Brock University, St. Catharines, Ontario, Canada, L2S 3A1. E-mail: mwinter@brocku.ca

  • Venue:
  • Fundamenta Informaticae
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Subtyping is a basic concept in object-oriented languages. It supports subsumption but, unfortunately, it does not support inheritance of binary methods, i.e., methods taking another argument of type Self? - the same type as the object itself. For this reason, a relation, called matching, on recursive object types has been proposed. This relation does not support subsumption but it allows to inherit binary methods. Two different definitions of matching, called F-bounded and higher-order subtyping, have been proposed and discussed. It was shown that the higher-order interpretation has better theoretical properties, i.e., it leads to a reflexive and transitive matching relation. In this paper we concentrate on two problems in languages with self types and matching based on the higher-order interpretation. We show that the flexibility of self types may not allow the programmer to define certain classes and/or methods which are based on constant values. Furthermore, the higher-order interpretation, especially in the context of bounded quantification, is too restrictive. We argue that a language should be based on both versions of matching and a notion of a type This distinguished from the type Self.