[Issue 19680] New: [REG2.085.0-beta.1] Uda inside union breaks default initialization
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 16 16:09:38 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19680
Issue ID: 19680
Summary: [REG2.085.0-beta.1] Uda inside union breaks default
initialization
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: zero at vec4.xyz
Code:
----
struct MyInnerStruct {
union {
@("BRAKE_ME") int[2] v = 0;
struct { int x, y; }
}
this(int vx, int vy) {
x = vx; y = vy;
}
}
struct MyStruct {
MyInnerStruct inner = MyInnerStruct(1, 2);
}
void main()
{
{
MyStruct ok = MyStruct();
assert(ok.inner.v == [1, 2]);
}
{
MyStruct err;
assert(err.inner.v == [1, 2]);
}
}
---
run.dlang.io:
https://run.dlang.io/is/fzj0IM
--
More information about the Digitalmars-d-bugs
mailing list