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


Kenji Hara <k.hara...@gmail.com> changed:

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


--- Comment #6 from Kenji Hara <k.hara...@gmail.com> 2012-01-31 22:51:48 PST ---
(In reply to comment #5)
> 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.

The original bug issue against paired the change is bug 2344. But finding UFCS
property/member function from global scope causes problems like this issue.

And the finding rule is not work against function local import, see bug 6185.

My suggestion is here:
http://d.puremagic.com/issues/show_bug.cgi?id=6185#c6

- The UFCS lookup should start *from most inside scope*, not module scope.
- Until reaching to module scope, UFCS lookup should not raise errors against
mismatches of invalid function call, instead *ignore* them silently.
- Finally, if there is no match in all scopes, raise an error.

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

Reply via email to