inherit, override, overload

Frank Benoit (keinfarbton) benoit at tionex.removethispart.de
Sun Dec 10 10:24:14 PST 2006


I posted about that on Nov. 13th already in "override and overload". But
I did not got any response. Apologies for posting again.

Since I first read about the mechanism, how D resolves overloads and
override, I think this is not the best solution.

See http://www.digitalmars.com/d/function.html
.... To consider the base class's functions in the overload resolution
process, use an AliasDeclaration

I want to suggest the following:
1.) change the overloading rule, so it does not hide the derived methods
in every case.
2.) make keyword "override" required for all overriding methods. Throw a
compiler error if the "override" keyword is missing.
3.) For consistency, require also "override" if implementing a interface
or abstract method.

Now overloading is possible without doing the alias and the code is more
 telling about which methods are used polymorph.

What do you think?




More information about the Digitalmars-d mailing list