Exact type parameterization and ThisType support

  • Authors:
  • Hyunik Na;Sukyoung Ryu;Kwangmoo Choe

  • Affiliations:
  • KAIST, Daejeon, South Korea;KAIST, Daejeon, South Korea;KAIST, Daejeon, South Korea

  • Venue:
  • TLDI '12 Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

We propose language support for binary methods and generic factory methods using ThisType. We present three new language features: (1) exact type capture which relaxes the restriction of earlier static approaches to binary methods that the run-time type of a binary method's receiver should be statically fixed, (2) named wildcards which allow more binary method invocations and more precise typing results, and (3) virtual constructors which support method definitions with return types of ThisType. We formalize these features with a core calculus CoreThisJava and prove its type soundness, exact type match and algorithmic subtyping. A modified notion of ThisType and exact type parameterization with bidirectional F-bound property form the basis of the above features. We also show that "inheritance makes subtypes" with our notion of ThisType and existential types as object types.