www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17142] New: Empty statement warnings conflicts with type

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 puremagic.com
          Reporter: ibuclaw 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.

--
Feb 04