[Issue 409] New: function resolving with global function if member matches

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 8 11:40:59 PDT 2006


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

           Summary: function resolving with global function if member
                    matches
           Product: D
           Version: 0.166
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de


bool equals( char[] a, char[] b ){
    return a==b;
}

class A{
    bool equals( A other ){
        return this is A;
    }
    void func(){
        char[] a1 = "a";
        a1.equals( "b"[] ); // line 11
    }
}

I get this error:

t.d(11): function t.A.equals (A) does not match argument types (char[],char[])
t.d(11): Error: expected 1 arguments, not 2
t.d(11): cannot implicitly convert expression (a1) of type char[] to t.A


-- 




More information about the Digitalmars-d-bugs mailing list