[Issue 21062] New: Compiler produces wildly different diagnostics based on variable names

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 21 07:13:06 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21062

          Issue ID: 21062
           Summary: Compiler produces wildly different diagnostics based
                    on variable names
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrej.mitrovich at gmail.com

DMD 2.093 (also tested with 2.089)

This is OK:

-----
struct S
{
    public time_t time;
    public bool synced;
}
-----

$ dmd -c test.d
> test.d(9,19): Error: undefined identifier `time_t`, did you mean variable `time`?

But look at this:

-----
struct S
{
    public time_t time;
    public bool synchronized;
}
-----

$ dmd -c test.d
> test.d(4): Error: no identifier for declarator bool
> test.d(4): Error: declaration expected following attribute, not ;

There is no mention of `time_t` being undefined.

--


More information about the Digitalmars-d-bugs mailing list