[Issue 18866] Overload from opDispatch ignored in WithStatement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 28 12:07:01 UTC 2018


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #3 from RazvanN <razvan.nitu1305 at gmail.com> ---
I'm not sure if this bug report is valid. The current behavior might be a
future.
If this "bug" would be fixed there would be absolutely no way of calling fun1()
from within the WithStatement body and that IMHO is an arbitrary limitation.

As things stand now, the compiler first tries to resolve fun1 as a member of S1
and if that's not possible it goes up the enclosing scope. If the chain of
scopes is over and fun1 still wasn't resolved then opDispatch is called. In my
opinion this makes a lot more sense then calling opDispatch for every method
that is not defined in the struct.

--


More information about the Digitalmars-d-bugs mailing list