Towards Taming Java Wildcards and Extending Java with Interval Types

by   Moez A. AbdelGawad, et al.
Rice University

Of the complex features of generic nominally-typed OO type systems, wildcard types and variance annotations are probably the hardest to fully grasp. As demonstrated when adding closures (a.k.a., lambdas) and when extending type inference in Java, wildcard types and variance annotations make the development and progress of OO programming languages, and of their type systems in particular, a challenging and delicate task. In this work we build on our concurrent work, in which we model Java subtyping using a partial graph product, to suggest how wildcard types in Java can be generalized, and simplified, to interval types. In particular, interval types correspond to endpoints of paths in the Java subtyping graph. In addition to being a simple and more familiar notion, that is easier to grasp than wildcard types, interval types are strictly more expressive than wildcard types. As such, we believe interval types, when developed and analyzed in full, will be a welcome addition to Java and other similar generic nominally-typed OO programming languages.


page 1

page 2

page 3

page 4


Java Subtyping as an Infinite Self-Similar Partial Graph Product

Due to supporting variance annotations, such as wildcard types, the subt...

Towards a Java Subtyping Operad

The subtyping relation in Java exhibits self-similarity. The self-simila...

Towards a Java Subtyping Operad (extended version)

The subtyping relation in Java exhibits self-similarity. The self-simila...

Global Type Inference for Featherweight Generic Java

Java's type system mostly relies on type checking augmented with local t...

Fast Random Integer Generation in an Interval

In simulations, probabilistic algorithms and statistical tests, we often...

Asymptotic Experiments with Data Structures: Bipartite Graph Matchings and Covers

We consider instances of bipartite graphs and a number of asymptotic per...

User-driven Design and Evaluation of Liquid Types in Java

Bugs that are detected earlier during the development lifecycle are easi...

Please sign up or login with your details

Forgot password? Click here to reset