Skip to main content

Lund University Publications

LUND UNIVERSITY LIBRARIES

Java wildcards meet definition-site variance

Altidor, John ; Reichenbach, Christoph LU orcid and Smaragdakis, Yannis (2012) 26th European Conference on Object-Oriented Programming, ECOOP 2012 In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 7313 LNCS. p.509-534
Abstract

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... (More)

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.

(Less)
Please use this url to cite or link to this publication:
author
; and
publishing date
type
Chapter in Book/Report/Conference proceeding
publication status
published
subject
keywords
Type System, Variance Annotation, Type Check, Method Invocation
host publication
ECOOP 2012 - Object-Oriented Programming : 26th European Conference, Proceedings - 26th European Conference, Proceedings
series title
Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
volume
7313 LNCS
pages
26 pages
conference name
26th European Conference on Object-Oriented Programming, ECOOP 2012
conference location
Beijing, China
conference dates
2012-06-11 - 2012-06-16
external identifiers
  • scopus:84879735450
ISSN
0302-9743
1611-3349
ISBN
9783642310560
DOI
10.1007/978-3-642-31057-7_23
language
English
LU publication?
no
id
8c12b55d-5fe4-4db2-be83-85eabb8b8b2b
date added to LUP
2019-03-29 20:18:34
date last changed
2024-01-01 00:30:48
@inproceedings{8c12b55d-5fe4-4db2-be83-85eabb8b8b2b,
  abstract     = {{<p>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.</p>}},
  author       = {{Altidor, John and Reichenbach, Christoph and Smaragdakis, Yannis}},
  booktitle    = {{ECOOP 2012 - Object-Oriented Programming : 26th European Conference, Proceedings}},
  isbn         = {{9783642310560}},
  issn         = {{0302-9743}},
  keywords     = {{Type System; Variance Annotation; Type Check; Method Invocation}},
  language     = {{eng}},
  month        = {{12}},
  pages        = {{509--534}},
  series       = {{Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)}},
  title        = {{Java wildcards meet definition-site variance}},
  url          = {{http://dx.doi.org/10.1007/978-3-642-31057-7_23}},
  doi          = {{10.1007/978-3-642-31057-7_23}},
  volume       = {{7313 LNCS}},
  year         = {{2012}},
}