[Issue 15416] UFCS does not attempt to derefence (but should it?)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Oct 24 13:00:02 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=15416
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |razvan.nitu1305 at gmail.com
Resolution|--- |WONTFIX
--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
The pointer is automatically dereferenced only in the presence of the dot (.)
operator when a field is queried or a method is invoked. In this situation
(`d.foo`) neither of those situations is encountered. Therefore, UFCS is tried
and it seems that foo is called with argument d. As you have noticed this is
not a situation where D automatically dereferences.
Changing this behavior will lead to massive breakages and it doesn't seem to
buy us anything.
--
More information about the Digitalmars-d-bugs
mailing list