【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 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号