On Subtyping and Matching

  • Martin Abadi ,
  • Luca Cardelli

European Conference on Object-Oriented Programming (ECOOP), Lecture Notes in Computer Science |

Published by ACM Press

A relation between recursive object types, called matching , has been proposed as a generalization of subtyping. Unlike subtyping, matching does not support subsumption, but it does support inheritance of binary methods. We argue that matching is a good idea, but that it should not be regarded as a form of F-bounded subtyping (as was originally intended). We show that a new interpretation of matching as higher-order subtyping has better properties. Matching turns out to be a third-order construction, possibly the only one to have been proposed for general use in programming.