[Issue 2565] New: Interface methods need to be implemented even if base class already have them impelemented

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 7 12:35:39 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2565

           Summary: Interface methods need to be implemented even if base
                    class already have them impelemented
           Product: D
           Version: 2.023
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: 2korden at gmail.com


interface IFoo
{
        int foo();
}

class FooImpl : IFoo
{
        int foo() {
                return 42;
        }
}

class Foo : public FooImpl, public IFoo
{
}

void main()
{
        Foo foo = new Foo();
}

Error: class A.Foo interface function IFoo.foo is not implemented

I believe the following code sample should just work. Otherwise, one have to
explicitly override all the interface methods, which is redundant and adds
runtime cost.

It could be related to bug 2539.


-- 



More information about the Digitalmars-d-bugs mailing list