'final' function implementations in interface definition

grauzone none at example.net
Sun Jun 7 20:51:52 PDT 2009


> What about this?
> 
> interface A {
>   void foo();
>   final int fun() { return 1; }
> }
> 
> interface B {
>   void bar();
>   final int fun() { return 2; }
> }
> 
> class C : B, A {
> }
> 
> (new C).fun();
> 
> What does that do?

Simple: overriding final methods is illegal.



More information about the Digitalmars-d mailing list