D1/D2: How to check if a method has been overridden
bearophile
bearophileHUGS at lycos.com
Tue Sep 7 14:31:02 PDT 2010
klickverbot:
> class A {
> void foo( float a ) {}
> void foo( int a ) {}
>
> final void bar() {
> // Determine whether this.foo( 1 ) and this.foo( 1f ) really refer
> // to A.foo( float ) and A.foo( int ) or if they point to a subclass
> // implementation how?
> }
> }
>
> class B : A {
> override void foo( float a ) {}
> }
>
> class C : A {
> override void foo( int a ) {}
> }
>
> class D : B {
> override void foo( int a ) {}
> }
Have you tried to compile that code with -w?
See also:
http://d.puremagic.com/issues/show_bug.cgi?id=4216
Bye,
bearophile
More information about the Digitalmars-d
mailing list