Overloading/Inheritance issue
Walter Bright
newshound1 at digitalmars.com
Sat Aug 4 09:55:40 PDT 2007
Bruno Medeiros wrote:
> Walter Bright wrote:
>> I agree that this example is a problem. There's no way to detect it at
>> compile time, so it should throw a runtime exception. The way to
>> accomplish that is to stuff D's vtbl[] entry for B.set(int) with a
>> dummy function that throws the exception.
>
> There is a problem the moment the D subclass doesn't override all
> overloads, so that can be detected at compile time and an error issued
> right there.
I'm not sure that's the right thing to do.
More information about the Digitalmars-d
mailing list