Non-conflicting derived class overload shadows base class method

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 20 13:23:43 PDT 2017


On Monday, March 20, 2017 20:13:12 Adam D. Ruppe via Digitalmars-d wrote:
> On Monday, 20 March 2017 at 19:57:03 UTC, H. S. Teoh wrote:
> > Is this a bug?
>
> No, that's intentional, you have to merge the overload sets with
> alias, same as if you imported them from two separate modules.
>
> http://dlang.org/hijack.html

Yeah. Creating new overloads for functions from a base class gets annoying
fast. It's probably great from the standpoint of avoiding function hijacking
bugs, but as with many of the restrictions that we get as part of the
attempts to avoid function hijacking in D, the result can be a bit annoying
in practice.

- Jonathan M Davis



More information about the Digitalmars-d mailing list