Attaching Second-Order Types to Methods in an Object-Oriented Language

  • Authors:
  • Yves Caseau;Laurent Perron

  • Affiliations:
  • -;-

  • Venue:
  • ECOOP '93 Proceedings of the 7th European Conference on Object-Oriented Programming
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper proposes an extension of the notion of method as it is currently used in most object-oriented languages. We define polymethods as methods that we can attach directly to types, as opposed to classes and that we can describe with a second-order type. Two benefits result from this extension; first, the expressive power of the language is improved with better modeling abilities. Next, second-order types yield a more powerful (precise) type inference, which extends the range of static type checking in a truly extensible object-oriented language. We first show that extensible object-oriented languages present many difficulties for static type-checking and that second-order types are necessary to get stronger type-checking. We illustrate how to combine polymethods through type inheritance and propose a technique based on abstract interpretation to derive a second-order type for new polymethods.