[Issue 4525] Regression(2.020) Array member call syntax can't find matches in current class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 31 22:32:44 PST 2012


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


Walter Bright <bugzilla at digitalmars.com> changed:

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


--- Comment #5 from Walter Bright <bugzilla at digitalmars.com> 2012-01-31 22:32:42 PST ---
Further investigation shows that this is not a bug.

    array.func(arguments)

is rewritten to be:

    .func(array, arguments)

Note the leading ., which means look for func() at module scope. Foo.bar() in
the example is not at module scope, hence it is not found. Note that the error
message gives the clue in referring to "mymodule.bar", not just "bar".

This was a deliberate design choice, as universal function call syntax is a
feature meant to be used with global functions, not local ones.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list