[Issue 17142] New: Empty statement warnings conflicts with type inference errors

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Feb 4 03:07:52 PST 2017


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

          Issue ID: 17142
           Summary: Empty statement warnings conflicts with type inference
                    errors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

Pretty contrived examples pulled from mechanically reduced code (was reducing
another bug).


//  Warning: use '{ }' for an empty statement, not a ';'
static tokenText = { ; };


//  Error: cannot infer type from struct initializer
static tokenText = { {} };


//  Warning: use '{ }' for an empty statement, not a ';'
static tokenText = { {}; };


Perhaps another warning for missing '()' would be better here, as it seems
pretty dubious to infer {;} as a lambda.

--


More information about the Digitalmars-d-bugs mailing list