Type Inference for Java 5

We consider the problem of type checking for Java 5 with generics and wildcard types. Java supports type inference for methods with type parameters, but its presentation in the Java Language Specification lacks both clarity and a sense for how inference fits into the larger picture of Java’s type system. We show, in contrast, how this type inference can be cleanly integrated with subtyping of wildcard types, justifying the intuitions of programmers and logicians alike. In addition, we examine the decidability of Java typechecking and identify key points in the subtyping relation that both lead to undecidability and suggest a decidable conservative approximation.

[1]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[2]  Frank Pfenning,et al.  On the Undecidability of Partial Polymorphic Type Reconstruction , 1993, Fundam. Informaticae.

[3]  Benjamin C. Pierce,et al.  Bounded quantification is undecidable , 1992, POPL '92.

[4]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[5]  Luca Cardelli,et al.  An Extension of System F with Subtyping , 1991, TACS.

[6]  Mirko Viroli,et al.  On Variance-Based Subtyping for Parametric Types , 2002, ECOOP.

[7]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 1999, OOPSLA '99.

[8]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[9]  Wild FJ , 2004 .

[10]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[11]  Giorgio Ghelli,et al.  Divergence of F< Type Checking , 1995, Theor. Comput. Sci..