[Issue 6681] bogus duplicate union initialization or overlapping initialization errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 1 03:58:36 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6681


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com


--- Comment #2 from yebblies <yebblies at gmail.com> 2012-02-01 22:58:33 EST ---
Ok, the first test case reduces to this:

struct V{
    union {
        double[2] cell;
        double x;
    }

    static immutable V zero=V(0,1);
}

The problem being that the struct literal gets turned into:
  this(a, b) { cell = 0; x = 1; }
ie. it passes the first argument to the first member, and the second argument
to the second.

This is sort of what I'd expect to happen, but the error message is completely
valid for what it's trying to do.  If anyone has a better idea of how struct
literals should map to unions, please open another bug report about it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list