TY - GEN
T1 - Improving type error messages for generic java
AU - Boustani, Nabil El
AU - Hage, Jurriaan
PY - 2009
Y1 - 2009
N2 - 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.
AB - 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.
KW - Compilers
KW - Error reporting
KW - Java generics
KW - Type Checking
UR - http://www.scopus.com/inward/record.url?scp=67650665755&partnerID=8YFLogxK
U2 - 10.1145/1480945.1480964
DO - 10.1145/1480945.1480964
M3 - Conference contribution
AN - SCOPUS:67650665755
SN - 9781605583273
T3 - Proceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
SP - 131
EP - 140
BT - Proceedings of the 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
T2 - 2009 ACM SIGPLAN Symposium on Partial Evaluation and Program Manipulation, PEPM'09
Y2 - 19 January 2009 through 20 January 2009
ER -