On subtyping, wildcards, and existential types

  • Authors:
  • Nicholas Cameron;Sophia Drossopoulou

  • Affiliations:
  • Victoria University of Wellington;Imperial College London

  • Venue:
  • Proceedings of the 11th International Workshop on Formal Techniques for Java-like Programs
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Wildcards are an often confusing part of the Java type system: the behaviour of wildcard types is not fully specified by subtyping, due to wildcard capture, and the rules for type checking are often misunderstood. Their very formulation seems somehow 'different' from the rest of the Java type system, which is based on a simple, nominal hierarchy. We investigate subtyping in models for Java with and without generics and wildcards. We separate subclassing from subtyping, unify subtyping for class and wildcard types using existential types, and show that Java wildcards emerge naturally from the combination of inclusion and parametric polymorphism.