[Issue 19365] Allow aliasing templated functions from mixin template to add them to overload set

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 17 20:56:37 UTC 2020


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qs.il.paperinik at gmail.com

--- Comment #4 from Bolpat <qs.il.paperinik at gmail.com> ---
(In reply to Adam D. Ruppe from comment #1)
> That's not a bug, that's by design. It allows you to override an overload
> set from a mixin template while keeping the other things.

This hasn't to do with overload sets. Overload sets work are separated
overloads to search for matches where an ambiguity error occurs when there are
any matches in two or more sets, regardless whether one match is clearly
better.

The symbols inserted by mixin templates are always completely shadowed by
eponymous symbols in the same scope. ALWAYS. The case Dennis describes is where
the mixed-in symbol is the only one that could match. The error isn't an
ambiguity error, so this is not primarily about overload sets, but symbol
shadowing. This is intentional.

The enhancement therefore boils down to proposing against the current way of
shadowing and for overloading sets. Putting the mixed-in symbols in a named
scope like you're suggesting actually creates overloading sets in the first
place.

There is a good reason for the shadowing, so this enhancement probably isn't
going anywhere.

--


More information about the Digitalmars-d-bugs mailing list