D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4836 - "duplicated union initialization" without a union
Summary: "duplicated union initialization" without a union
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2010-09-07 12:49 UTC by Ivo Kasiuk
Modified: 2012-01-06 06:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ivo Kasiuk 2010-09-07 12:49:28 UTC
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 Ivo Kasiuk 2010-09-08 11:06:48 UTC
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 Brad Roberts 2011-02-06 15:40:17 UTC
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 Trass3r 2012-01-06 06:09:18 UTC
Compiles now.