[Issue 18523] In the language spec, clarify member function vs UFCS lookup semantics

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 21 09:18:47 UTC 2023


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

Bolpat <qs.il.paperinik at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |qs.il.paperinik at gmail.com
         Resolution|---                         |FIXED

--- Comment #1 from Bolpat <qs.il.paperinik at gmail.com> ---
At some point, the spec got refined to:
> A free function can be called like a member function when both:
> 
>   • The member function does not (or cannot) exist for the object expression
>   • The free function's first parameter type matches the object expression

This explains well that the mere existence of an eponymous member makes UFCS
for that name not work.

--


More information about the Digitalmars-d-bugs mailing list