Overloading/Inheritance issue

Charles D Hixson charleshixsn at earthlink.net
Sun Aug 5 16:25:53 PDT 2007


Walter Bright wrote:
> Kirk McDonald wrote:
>>>   alias super.foo foo;
>> That's not a workaround, nor is this considered a problem. This is the 
>> intended behavior.
> 
> Yes, and it took some extra effort to make sure it worked that way! In 
> other words, it is not accidental or incidental behavior.

But perhaps alias isn't the right tool?  Someone below 
suggested that this can cause problems when only one function 
out of several overloaded functions are desired.  This can be 
coded around, but perhaps a more specific importation rule 
could be used.  I can even see justification for co-opting 
import for this usage:
    import package.function(arglist) as localName;
to be used within the class that is inheriting.

Actually, I'd prefer that this be the verb inherit rather than 
import, but that would probably mean adding a new reserved word.



More information about the Digitalmars-d mailing list