Wildcards need witness protection

Kevin Bierhoff
DOI: https://doi.org/10.1145/3563301
2022-10-31
Proceedings of the ACM on Programming Languages
Abstract:In this paper, we show that the unsoundness discovered by Amin and Tate (2016) in Java’s wildcards is avoidable, even in the absence of a nullness-aware type system. The key insight of this paper is that soundness in type systems that implicitly introduce existential types through subtyping hinges on still making sure there are suitable witness types when introducing existentially quantified type variables. To show that this approach is viable, this paper formalizes a core calculus and proves it sound. We used a static analysis based on our approach to look for potential issues in a vast corpus of Java code and found
What problem does this paper attempt to address?