www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21062] New: Compiler produces wildly different diagnostics

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 puremagic.com
          Reporter: andrej.mitrovich 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. --
Jul 21 2020