www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1522] New: multiple TypeInfo definitions


           Summary: multiple TypeInfo definitions
           Product: D
           Version: 2.004
          Platform: PC
               URL: http://mainia.de/classinfoex-0.10.d
        OS/Version: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jascha mainia.de

compiling the example from the doc-comment makes the linker complain about
multiple defined symbols. on windows this does not happen.

the "mixin Reflect;" creates static constructors and saves the TypeInfos for
all functions of the class in a static assoc array. this includes opEqual and
opCmp that both are of type FC6ObjectZi and thus have the same TypeInfo. in
this case the _D20TypeInfo_FC6ObjectZi6__initZ is defined twice (or more
often), which provokes the linker error.

Sep 20 2007