Summary: Unexpected "duplicate union initialization for X"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Denis Shelomovskij <> 2012-10-28 
10:12:15 MSK ---
Should assigning `.init` to a union be allowed or disallowed? At leas current
behavior is inconsistent:

union U { int a, b; }

enum U u0 = U.init;  // No errors
U u1;                // No errors
U u2 = U.init;  // Error: duplicate union initialization for b

void main()
    U u3 = U.init;            // No errors
    immutable U u4 = U.init;  // No errors
    immutable static U u5 = U.init;  // Error: duplicate union...
    static U u6 = u4;      // Error: duplicate union...
    static U u7 = U.init;  // Error: duplicate union...

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to