F-bounded polymorphism for object-oriented programming
FPCA '89 Proceedings of the fourth international conference on Functional programming languages and computer architecture
Putting type annotations to work
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Making the future safe for the past: adding genericity to the Java programming language
Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Unifying Genericity - Combining the Benefits of Virtual Types and Parameterized Classes
ECOOP '99 Proceedings of the 13th European Conference on Object-Oriented Programming
On Variance-Based Subtyping for Parametric Types
ECOOP '02 Proceedings of the 16th European Conference on Object-Oriented Programming
Adding wildcards to the Java programming language
Proceedings of the 2004 ACM symposium on Applied computing
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley))
Practical type inference for arbitrary-rank types
Journal of Functional Programming
HMF: simple type inference for first-class polymorphism
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
A Model for Java with Wildcards
ECOOP '08 Proceedings of the 22nd European conference on Object-Oriented Programming
Java type inference is broken: can we fix it?
Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
On subtyping, wildcards, and existential types
Proceedings of the 11th International Workshop on Formal Techniques for Java-like Programs
On the Decidability of Subtyping with Bounded Existential Types
APLAS '09 Proceedings of the 7th Asian Symposium on Programming Languages and Systems
Towards a semantic model for Java wildcards
Proceedings of the 12th Workshop on Formal Techniques for Java-Like Programs
Java wildcards meet definition-site variance
ECOOP'12 Proceedings of the 26th European conference on Object-Oriented Programming
Hi-index | 0.00 |
Wildcards have become an important part of Java's type system since their introduction 7 years ago. Yet there are still many open problems with Java's wildcards. For example, there are no known sound and complete algorithms for subtyping (and consequently type checking) Java wildcards, and in fact subtyping is suspected to be undecidable because wildcards are a form of bounded existential types. Furthermore, some Java types with wildcards have no joins, making inference of type arguments for generic methods particularly difficult. Although there has been progress on these fronts, we have identified significant shortcomings of the current state of the art, along with new problems that have not been addressed. In this paper, we illustrate how these shortcomings reflect the subtle complexity of the problem domain, and then present major improvements to the current algorithms for wildcards by making slight restrictions on the usage of wildcards. Our survey of existing Java programs suggests that realistic code should already satisfy our restrictions without any modifications. We present a simple algorithm for subtyping which is both sound and complete with our restrictions, an algorithm for lazily joining types with wildcards which addresses some of the shortcomings of prior work, and techniques for improving the Java type system as a whole. Lastly, we describe various extensions to wildcards that would be compatible with our algorithms.