[Issue 14154] New: [e2ir] Error in e2ir at casting to struct

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Feb 9 00:35:45 PST 2015


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

          Issue ID: 14154
           Summary: [e2ir] Error in e2ir at casting to struct
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ketmar at ketmar.no-ip.org

mixin template XTypedef (T, string name, T init=T.init) {
  mixin(`static struct `~name~q{{
    public alias k_8_i_m_p_l this;
    private T k_8_i_m_p_l=init;
  }});
}


void test () {
  mixin XTypedef!(ubyte, `uint8`);
  mixin XTypedef!(int, `MyInt`);
  MyInt mi;
  ubyte t = cast(uint8)mi;
}


zzbug.d(13): Error: e2ir: cannot cast mi.k_8_i_m_p_l of type int to type uint8

--


More information about the Digitalmars-d-bugs mailing list