D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4296 - Reduce parasitic error messages
Summary: Reduce parasitic error messages
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2010-06-08 11:34 UTC by Don
Modified: 2014-02-15 02:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2010-06-08 11:34:05 UTC
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 Walter Bright 2010-06-09 13:00:26 UTC
http://www.dsource.org/projects/dmd/changeset/528