Bug 14154 – [e2ir] Error in e2ir at casting to struct
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-02-09T08:35:00Z
Last change time
2015-02-21T09:11:20Z
Keywords
ice, pull
Assigned to
nobody
Creator
ketmar
Comments
Comment #0 by ketmar — 2015-02-09T08:35:45Z
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