Operator overloading through UFCS doesn't work

Timon Gehr timon.gehr at gmx.ch
Wed Oct 17 03:46:37 PDT 2012


On 10/15/2012 01:00 PM, Artur Skawina wrote:
> ...
>
> An overloaded operator is just another normal method; you get the same type of
> problems when dealing with "normal" methods - eg in types having an "alias this" -
>   an UFCS "method" must take precedence over one reachable via the alias - just like
> in the overloaded op case. The only sane alternative would be disallowing UFCS
> for types with an "alias this" (which would be a severe limitation).
> ...

Just no. Why make symbol lookup even more complicated just in order to
add an strange exception to the language that either enables new forms
of hijacking or would be a severe limitation?


More information about the Digitalmars-d-learn mailing list