www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19767] New: Classes that inherit from an interface can

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

          Issue ID: 19767
           Summary: Classes that inherit from an interface can override
                    static interface methods
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: edi33416 gmail.com

This directly contradicts the interface
[spec](https://dlang.org/spec/interface.html), pt. 8:

"Classes that inherit from an interface may not override final or static
interface member functions."

interface D
{
    void bar();
    static void foo() { }
}

class C : D
{
    void bar() { } // ok
    void foo() { } // BUG: this is ok, but should error because we cannot
override static D.foo()
}

--
Mar 27 2019