D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2530 - "Previous definition different" error on using template class with inner struct
Summary: "Previous definition different" error on using template class with inner struct
Status: RESOLVED DUPLICATE of issue 1629
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: link-failure
Depends on:
Blocks:
 
Reported: 2008-12-21 08:16 UTC by Koroskin Denis
Modified: 2015-06-09 01:20 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 Koroskin Denis 2008-12-21 08:16:01 UTC
Here is a cut-down code sample that reproduces the error:

// File A.d
module A;
import B;

// File B.d
module B;
import A;

class T(int i)
{
    struct Inner
    {
    }
}

class B
{
    T!(0) t;
}

void main()
{
}

compilation options:
# dmd A.d -c
# dmd B.d -c
# dmd A.obj B.obj

Error 1: Previous Definition Different : _D1B9__T1TVi0Z1T5Inner6__initZ

Note that this is a regression since D1.037/D2.021 used to compile this code just fine. Both D1.038 and D2.022 are affected.

Could it be related to this one:
http://d.puremagic.com/issues/show_bug.cgi?id=2500 (fixed recently)?
Comment 1 Bill Baxter 2008-12-22 02:35:05 UTC
Maybe related to bug 1629 too:
http://d.puremagic.com/issues/show_bug.cgi?id=1629
(error message is the same anyway)
Comment 2 Don 2009-09-04 07:03:36 UTC
This was a duplicate of bug 1629 and was fixed in DMD1.041.

*** This issue has been marked as a duplicate of issue 1629 ***