2012
DOI: 10.1007/978-3-642-31057-7_23
|View full text |Cite
|
Sign up to set email alerts
|

Java Wildcards Meet Definition-Site Variance

Abstract: 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 r… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
20
0

Year Published

2012
2012
2016
2016

Publication Types

Select...
4
2

Relationship

2
4

Authors

Journals

citations
Cited by 9 publications
(20 citation statements)
references
References 19 publications
0
20
0
Order By: Relevance
“…Scala uses the syntax T <: U to specify that T has an upper bound of U or that T must be subtype of U. Accordingly, T >: L is used to specify that T has a lower bound of L. Despite it is possible to write a compiler that automatically derives which type of access is used in a certain expression [AHS11], most languages offer particular variance annotations to let programmers choose if a type constructor is used invariantly, covariantly or contravariantly. Altogether, there are two main approaches to support variance annotations:…”
Section: Parametric Typesmentioning
confidence: 99%
“…Scala uses the syntax T <: U to specify that T has an upper bound of U or that T must be subtype of U. Accordingly, T >: L is used to specify that T has a lower bound of L. Despite it is possible to write a compiler that automatically derives which type of access is used in a certain expression [AHS11], most languages offer particular variance annotations to let programmers choose if a type constructor is used invariantly, covariantly or contravariantly. Altogether, there are two main approaches to support variance annotations:…”
Section: Parametric Typesmentioning
confidence: 99%
“…The entailment relation for X must respect the interpretation of (a) C(f = t) as a finite tree with root labeled with C, ith branch labeled with f i and leading to t i , and (b) t.f as selection of the child labeled f for the tree t. 2 Equality is reflexive, symmetric, transitive, and a congru-…”
Section: Constraint Systemmentioning
confidence: 99%
“…Scala [38] and C [12], by contrast, support definition-site variance annotations, which address many of the usability concerns of wildcards [26], but can often result in complicated or duplicated code to create invariant, covariant, and contravariant versions of a library class. Altidor et al [2] propose a framework for combining definitionand use-site variance in a Java-like language. Encoding this framework in FXG is an interesting area for future work.…”
Section: Related Workmentioning
confidence: 99%
“…FOO is inspired by Featherweight Java (FJ) [10]: it is also a class-based formalism and emphasizes inheritance. Indeed, the motivation for FOO stems from our own past language modeling efforts [2,[7][8][9] which were based on FJ. We found that the language features that are most pertinent to our language extensions had little to do with key elements of Featherweight Java, such as casts, fields, or constructors.…”
Section: Introductionmentioning
confidence: 99%