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.
pubs.doc.ic.ac.uk: built & maintained by Ashok Argent-Katwala.