The worst overload system that actualy works

sighoya sighoya at gmail.com
Mon Dec 21 19:36:22 UTC 2020


On Monday, 21 December 2020 at 13:35:10 UTC, Basile B. wrote:
> Overloads can be confusing because of implict conversions and 
> promotion rules.
> So here are the explicit overloads[1]. Note that there is no 
> plan to propose this for D ;)... destroy.
>
> [1] https://styx-lang.gitlab.io/styx/overload_declaration.html

But they need anyway overload resolution for this.

The advantage is that method could be assigned to more than one 
overloaded set (multi method).

The disadvantage is the manual disambiguation of method names by 
defining their types.
That sucks and they can't always be demangled in meaningful way 
than simply enumerating their param types.

I find explicit implicit converions in D useful, but I didn't 
appreciate how overload resolution handles this that much.


More information about the Digitalmars-d mailing list