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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 16 02:27:15 PDT 2006


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


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #3 from bugzilla at digitalmars.com  2006-10-16 04:27 -------
It's working as designed. a1.equals("b"[]) is first rewritten as
equals(a1,"b"[]), because a1 is an array. Then, "equals" is looked for in the
enclosing scopes. The first one found is A.equals. The arguments are (a1,"b"[])
which are types (char[],char[]), which do not match (A), the argument types for
A.equals. Hence the error message.

If A.equals is removed, then the global equals is found, which does match the
argument types.

Not a bug.


-- 




More information about the Digitalmars-d-bugs mailing list