Bug 4836 – "duplicated union initialization" without a union

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2010-09-07T12:49:00Z
Last change time
2012-01-06T06:09:18Z
Keywords
diagnostic
Assigned to
nobody
Creator
i.kasiuk

Comments

Comment #0 by i.kasiuk — 2010-09-07T12:49:28Z
The following compilation error does not seem to make sense: $ cat test.d class C { string s = null; mixin template M() { } mixin M!() m1; // line 4 mixin template M(T) { } // line 5 mixin M!(int) m2; } $ dmd -c test test.d(1): Error: class test.C duplicated union initialization for s $ Interestingly, the file compiles without error if line 4 and 5 are swapped. Tested with DMD v2.048
Comment #1 by i.kasiuk — 2010-09-08T11:06:48Z
Also, line 6 seems to have no influence, so the following still does not compile: class C { string s = null; mixin template M() { } mixin M!() m1; mixin template M(T) { } } On the other hand, when replacing "string s = null" by "int i = 0" it compiles without error.
Comment #2 by braddr — 2011-02-06T15:40:17Z
Mass migration of bugs marked as x86-64 to just x86. The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
Comment #3 by hoganmeier — 2012-01-06T06:09:18Z
Compiles now.