www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13734] New: Weird linker error?

https://issues.dlang.org/show_bug.cgi?id=13734

          Issue ID: 13734
           Summary: Weird linker error?
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: czdanol gmail.com

Hey, try this code (tested under dmd 2.066.1 win32):

module test;

struct Container( T ) {

private:
    T[] array;

public:
    int opApply( int delegate( ref T ) func )    {
        return 0;
    }


}

class C {

}


class D {

    mixin( {
        foreach( memberName; __traits( allMembers, typeof( this ) ) ) {
            static if( __traits( compiles, __traits( getOverloads, typeof( this
), memberName )[ 0 ] ) ) {

                } }

                return "";
                } () );

    Container!C cont_;

void asd() {
    foreach( l; cont_ ) {

    }
}

}

void main() {

}

It gives me quite weird linker error:

Error 42: Symbol Undefined
_D4test23__T9ContainerTC4test1CZ9Container7opApplyMFNaNbNiNfDFKC4test1CZiZi

This seems to be minimal test case.

--
Nov 14 2014