Finding the source of type errors

Finding the source of type errors
复制标题

查找类型错误的根源

DOI:
10.1145/512644.512648
复制
发表时间:
1986
期刊:
ACM Computing Surveys (CSUR)
影响因子:
--
通讯作者:
M. Wand
M. Wand
中科院分区:
--
文献类型:
--
作者:
M. Wand

文献摘要

被引文献

相似文献

不言而喻的是,大多数错误只能在距离其来源很远的地方被检测到。尽管像ML中的那些多态类型检查系统在编译时检测潜在的运行时类型错误有很大帮助,但这样的系统对于定位类型错误的来源仍然没有多大帮助。通常,只有当类型检查器无法继续时,才会报告错误,即使程序员的实际错误可能在文本中发生得更早。我们描述了一个算法,该算法似乎对隔离和解释类型错误的来源非常有帮助。该算法的工作原理是跟踪<i>原因</i>检查员对变量类型进行推断。
It is a truism that most bugs are detected only at a great distance from their source. Although polymorphic type-checking systems like those in ML help greatly by detecting potential run-time type errors at compile-time, such systems are still not very helpful for locating the source of a type error. Typically, an error is reported only when the type-checker can proceed no further, even though the programmer's actual error may have occurred much earlier in the text. We describe an algorithm which appears to be quite helpful in isolating and explaining the source of type errors. The algorithm works by keeping track of the <i>reasons</i> the checker makes deductions about the types of variables.