Abstract
Since version 1.5, generics (parametric polymorphism) are part of the Java language. However, adding parametric polymorphism to a language that is built on inclusion polymorphism can be confusing to a novice programmer, because the typing rules are suddenly different and, in the case of Generic Java, quite complex. Indeed, the main Java compilers, Eclipse's EJC compiler and Sun's JAVAC, do not even accept the same set of programs. Moreover, experience with these compilers shows that the error messages provided by them leave more than a little to be desired. To alleviate the latter problem, we describe how to adapt the type inference process of Java to obtain better error diagnostics for generic method invocations. The extension has been implemented into the JastAdd extensible Java compiler.
Original language | English |
---|---|
Title of host publication | Proceedings of the 2009 ACM SIGPLAN workshop on Partial evaluation and program manipulation |
Subtitle of host publication | PEPM '09 |
Publisher | Association for Computing Machinery |
Pages | 131-140 |
Number of pages | 10 |
ISBN (Print) | 9781605583273 |
DOIs | |
Publication status | Published - 19 Jan 2009 |
Keywords
- Compilers
- Error reporting
- Java generics
- Type Checking