...
【24h】

Taming wildcards in Java's type system

机译:在Java类型系统中驯服通配符

获取原文
获取原文并翻译 | 示例
   

获取外文期刊封面封底 >>

       

摘要

Wildcards have become an important part of Java's type system since their introduction 7 years ago. Yet there are still many open problems with Java's wildcards. For example, there are no known sound and complete algorithms for subtyping (and consequently type checking) Java wildcards, and in fact subtyping is suspected to be undecidable because wildcards are a form of bounded existential types. Furthermore, some Java types with wildcards have no joins, making inference of type arguments for generic methods particularly difficult. Although there has been progress on these fronts, we have identified significant shortcomings of the current state of the art, along with new problems that have not been addressed. In this paper, we illustrate how these shortcomings reflect the subtle complexity of the problem domain, and then present major improvements to the current algorithms for wildcards by making slight restrictions on the usage of wildcards. Our survey of existing Java programs suggests that realistic code should already satisfy our restrictions without any modifications. We present a simple algorithm for subtyping which is both sound and complete with our restrictions, an algorithm for lazily joining types with wildcards which addresses some of the shortcomings of prior work, and techniques for improving the Java type system as a whole. Lastly, we describe various extensions to wildcards that would be compatible with our algorithms.
机译:自7年前问世以来,通配符已成为Java类型系统的重要组成部分。但是,Java的通配符仍然存在许多未解决的问题。例如,没有已知的声音和完整的算法可用于Java通配符的子类型化(并因此进行类型检查),并且实际上,由于通配符是有界生存类型的一种形式,因此怀疑子类型化是不确定的。此外,某些带有通配符的Java类型没有联接,这使得为通用方法推断类型参数特别困难。尽管在这些方面已经取得了进展,但我们已经发现了当前技术水平的重大缺陷,以及尚未解决的新问题。在本文中,我们将说明这些缺点如何反映问题域的细微复杂性,然后通过对通配符的使用进行一些限制,对当前的通配符算法进行重大改进。我们对现有Java程序的调查表明,现实的代码应该已经满足我们的限制,而无需进行任何修改。我们提出了一个简单的子类型化算法,该算法既合理又完善,并具有我们的限制;一种用于将类型与通配符延迟连接的算法,可以解决先前工作中的某些缺点;以及一种用于整体改进Java类型系统的技术。最后,我们描述了通配符的各种扩展,这些扩展将与我们的算法兼容。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号