Constraint-Free Type Error Slicing

Constraint-Free Type Error Slicing
复制标题

无约束类型错误切片

DOI:
--
复制
发表时间:
2011
期刊:
Symposium on Trends in Functional Programming
影响因子:
--
通讯作者:
Thomas Schilling
Thomas Schilling
中科院分区:
--
文献类型:
--
作者:
Thomas Schilling

文献摘要

被引文献

相似文献

基于ML的语言的类型错误消息往往会遭受不精确的错误位置的困扰 - 类型检查器仅报告错误的许多可能位置之一。类型错误的概念通过报告所有导致给定错误的程序位置(不再)来纠正此问题。 生产类型错误切片的先前工作需要使用基于约束的类型检查器实现。对于大多数现有系统,这将需要对经过良好测试和微妙的代码进行实质性更改。在这项工作中,我们展示了如何使用未修改的类型检查器生成有用的类型错误切片。其他工具,例如自动校正系统,可以将其分层放在我们的系统之上。 我们已经在格拉斯哥Haskell编译器(GHC)上实施了这项技术,并报告了我们的经验。
Type error messages for ML-based languages tend to suffer from imprecise error locations --- the type checker reports only one of many possible locations of an error. The notion of a type error slice corrects this by reporting all program locations that contribute to a given error (and no more). Previous work on producing type error slices required the use of a constraint-based type checker implementation. For most existing systems this would require substantial changes to well-tested and subtle pieces of code. In this work we show how to produce useful type error slices with an unmodified type checker. Other tools, such as automatic correction systems, can be layered on top of our system. We have implemented this technique on top of the Glasgow Haskell Compiler (GHC) and report our experiences.