[Issue 2530] New: "Previous definition different" error on using template class with inner struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 21 06:16:02 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2530

           Summary: "Previous definition different" error on using template
                    class with inner struct
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: 2korden at gmail.com


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)?


-- 



More information about the Digitalmars-d-bugs mailing list