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: [email protected]
Reporter: [email protected]
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
--