http://d.puremagic.com/issues/show_bug.cgi?id=10937
Summary: struct inside union gives uninitialized error in CTFE
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Adam D. Ruppe <[email protected]> 2013-08-31
18:29:57 PDT ---
===
struct Test {
union {
ubyte[1] a;
struct {
ubyte b;
}
}
this(ubyte B) {
this.b = B; // this triggers the error below
// this.a[0] = B; // this works
}
}
enum test = Test(0); // test30.d(9): Error: uninitialized variable 'b' cannot
be returned from CTFE
===
Both constructor lines work fine at runtime.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------