【24h】

Improving type error messages for generic java

机译:改进通用Java的类型错误消息

获取原文

摘要

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.
机译:自版本1.5,泛型(参数多态)是Java语言的一部分。但是,将参数多态添加到基于包含多态性的语言中可能会对新手程序员混淆,因为键入规则突然不同,并且在通用Java的情况下,非常复杂。实际上,主要的Java编译器,Eclipse的EJC编译器和Sun的Javac,甚至没有接受相同的程序集。此外,对这些编译器的经验表明,它们提供的错误消息留下了一点才能。为了缓解后一种问题,我们介绍了如何调整Java的类型推断过程,以获取更好的泛型方法调用诊断。扩展已在Jastadd可扩展Java编译器中实现。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号