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. © 2012 Springer-Verlag Berlin Heidelberg.
CITATION STYLE
Altidor, J., Reichenbach, C., & Smaragdakis, Y. (2012). Java wildcards meet definition-site variance. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 7313 LNCS, pp. 509–534). Springer Verlag. https://doi.org/10.1007/978-3-642-31057-7_23
Mendeley helps you to discover research relevant for your work.