www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13848] New: overlapping initialization for r

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

          Issue ID: 13848
           Summary: overlapping initialization for r
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: deadalnix gmail.com

Sample code below:

module a;

template MixinTpl(P) {

    union {
        A a;
    }

    P p;

    auto fun() {
        return SS(a, p);
    }

    struct SS {

        union {
            A a;
            ulong r;
        }

        P p;
    }
}

struct A {}

union P {}

struct S {
    mixin MixinTpl!P;    
}

--
Dec 10 2014