Method Inheritance

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Fri May 19 17:30:46 PDT 2006


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



More information about the Digitalmars-d-bugs mailing list