Type-safe convariant specialization with generalized matching

  • Authors:
  • Ran Rinat

  • Affiliations:
  • Department of Computer Science, Johns Hopkins University, Baltimore, MD

  • Venue:
  • Information and Computation - FOOL VII
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

Matching is a relation between object types originally designed to support type-safe subclassing with binary methods. In this paper we generalize it to deal with general covariance by allowing field and method parameter types to change covariantly in matching types. In addition, object types may explicitly contain virtual types which can also change covariantly. The result is a significant increase in the flexibility of subclassing. The new definition is accompanied by appropriate machinery, allowing the loss of subsumption to be compensated by match-bounded parameterization and hash types. We define a language LGM supporting generalized matching, its typing rules, and its operational semantics and establish a subject reduction theorem showing the soundness of the system.