https://issues.dlang.org/show_bug.cgi?id=19822
Issue ID: 19822
Summary: 2.086 regression wrt. union initializers
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This assertion fails since 2.086.0-beta.1: https://run.dlang.io/is/YvQvyE
struct Quat
{
static struct Vec { int x; }
union
{
Vec v;
struct { float x; }
}
static Quat identity()
{
Quat q;
q.x = 1.0f;
return q;
}
}
struct QuatContainerWithIncompatibleInit
{
Quat q = Quat.identity;
}
void main()
{
QuatContainerWithIncompatibleInit c;
assert(c.q.x == 1.0f); // fails
}
--