www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22232] New: implementing interface function by inheriting

https://issues.dlang.org/show_bug.cgi?id=22232

          Issue ID: 22232
           Summary: implementing interface function by inheriting from
                    other class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: animuspexus protonmail.com

asked at Discord and at Forum, but nobody could tell if this is a bug:
```D
interface Int
{
    void coolFunc();
}

class C1
{
    void coolFunc()
    {
        return;
    }
}

class C2 : C1, Int
{

}

void main()
{
    auto c = new C2;
}
```
dmd ends with error:
t.d(14): Error: class t.C2 interface function void coolFunc() is not
implemented

--
Aug 22 2021