www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20998] New: error in static struct initialization causes


          Issue ID: 20998
           Summary: error in static struct initialization causes wrong
                    position for subsequent members, producing extra
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

struct X {
        void* ptr;
        int x;
X x = { invalid, 2 };
This code correctly produces "Error: undefined identifier invalid" but then
produces an unexpected "Error: cannot implicitly convert expression 2 of type
int to void*". This code should only produce the first error.

This incorrect behaviour appears to have been introduced at some point between
DMD 2.063 and 2.064.

Jul 01 2020