Java wildcards meet definition-site variance

Research output: Chapter in Book/Report/Conference proceedingPaper in conference proceeding


Variance is concerned with the interplay of parametric polymorphism (i.e., templates, generics) and subtyping. The study of variance gives answers to the question of when an instantiation of a generic class can be a subtype of another. In this work, we combine the mechanisms of use-site variance (as in Java) and definition-site variance (as in Scala and C#) in a single type system, based on Java. This allows maximum flexibility in both the specification and use of generic types, thus increasing the reusability of code. Our VarJ calculus achieves a safe synergy of def-site and use-site variance, while supporting the full complexities of the Java realization of variance, including F-bounded polymorphism and wildcard capture. We show that the interaction of these features with definition-site variance is non-trivial and offer a full proof of soundness - the first in the literature for an approach combining variance mechanisms.


External organisations
  • University of Massachusetts
  • National and Kapodistrian University of Athens
Research areas and keywords

Subject classification (UKÄ) – MANDATORY

  • Computer Science


  • Type System, Variance Annotation, Type Check, Method Invocation
Original languageEnglish
Title of host publicationECOOP 2012 - Object-Oriented Programming
Subtitle of host publication26th European Conference, Proceedings
Number of pages26
Publication statusPublished - 2012 Dec 1
Publication categoryResearch
Externally publishedYes
Event26th European Conference on Object-Oriented Programming, ECOOP 2012 - Beijing, China
Duration: 2012 Jun 112012 Jun 16

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume7313 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference26th European Conference on Object-Oriented Programming, ECOOP 2012