Bug 4296 – Reduce parasitic error messages

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-06-08T11:34:00Z
Last change time
2014-02-15T02:46:33Z
Keywords
diagnostic
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2010-06-08T11:34:05Z
The test case below generates many spurious error messages. In the beta of 2.047, they have references to type _error. Now that there is a distinct error type, it is straightforward to eliminate them all. Most occur in expression.c. For example, all the checkXXX() functions should start with: if (type == Type::terror) return new ErrorExp(); Likewise cases such as: void BinExp::incompatibleTypes() { + if (e1->type == Type::terror || e2->type == Type::terror) + return; -------------- TEST CASES -------------- void error_message_tests() { int x = y * 1; x = 4 + y; int *p = *y; x = y++; x = 7 - y; x = y[3]; x = ++y; x = y ? 2 : 3; x = null[y]; x = p[y..y]; y += y; x = y/1; // and where the heck did those two divs by 0 come from???? x = y ~ y; x ~= y; x = !y; x = 3 in y; x = y is 2; x = y ^^ 2; x ^^= y; }
Comment #1 by bugzilla — 2010-06-09T13:00:26Z