Method Inheritance

John Demme me at teqdruid.com
Sat May 20 20:47:28 PDT 2006


In article <e4lnue$s42$1 at digitaldaemon.com>, Bruno Medeiros says...
>
>John Demme wrote:
>> The below code doesn't work unless you uncomment out the alias.  I think 
the
>> reason for this was explained to me at some point, but I don't remember. Or
>> is it a bug?  I think it should be a bug.
>> 
>> ~John Demme 
>> 
>> class A
>> {
>>         void foo (int i)
>>         {}
>> }
>> 
>> class B: A
>> {
>>         void foo (int i, int j)
>>         {}
>> 
>>         /+alias A.foo foo;+/
>> }
>> 
>> void main()
>> {
>>         B b = new B();
>>         b.foo(5,7);
>>         b.foo(7);
>> }
>
>
>It was mentioned in: 
>news://news.digitalmars.com:119/e3knre$2vp1$1@digitaldaemon.com
>
>namely:
>
> > In http://www.digitalmars.com/d/function.html , "Function Inheritance
> > and Overriding" it is said:
> > "However, when doing overload resolution, the functions in the base
> > class are not considered:"
> > If that is the ideal behavior, well, that I'm not sure...
>
>-- 
>Bruno Medeiros - CS/E student
>http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D


Ach!! ... Just a pain in the ass in my opinion-- I have to remember to put in 
aliases for each method.

Thanks for the links.

~John





More information about the Digitalmars-d-bugs mailing list