Affiliation:
1. Hong Kong University of Science and Technology, Hong Kong, China
2. University of Tübingen, Tübingen, Germany
Abstract
Creating good type error messages for constraint-based type inference systems is difficult. Typical type error messages reflect implementation details of the underlying constraint-solving algorithms rather than the specific factors leading to type mismatches. We propose using subtyping constraints that capture data flow to classify and explain type errors. Our algorithm explains type errors as faulty data flows, which programmers are already used to reasoning about, and illustrates these data flows as sequences of relevant program locations. We show that our ideas and algorithm are not limited to languages with subtyping, as they can be readily integrated with Hindley-Milner type inference. In addition to these core contributions, we present the results of a user study to evaluate the quality of our messages compared to other implementations. While the quantitative evaluation does not show that flow-based messages improve the localization or understanding of the causes of type errors, the qualitative evaluation suggests a real need and demand for flow-based messages.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference29 articles.
1. Compiler Error Messages Considered Unhelpful
2. Stephen Dolan . 2017 . Algebraic Subtyping: Distinguished Dissertation 2017. BCS , Swindon, GBR. isbn:1780174152 https://dl.acm.org/doi/book/10.5555/3180976 Stephen Dolan. 2017. Algebraic Subtyping: Distinguished Dissertation 2017. BCS, Swindon, GBR. isbn:1780174152 https://dl.acm.org/doi/book/10.5555/3180976
3. Polymorphism, subtyping, and type inference in MLsub
4. The black box inside the glass box: presenting computing concepts to novices
Cited by
2 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献