www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21184] New: Unimplemented methods of interface are not

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

          Issue ID: 21184
           Summary: Unimplemented methods of interface are not reported as
                    errors during compilation.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: alexandru.ermicioi gmail.com

Example:
--------
import std;

interface Promise {
    int doIt();
}

class Silly {
    int doIt();
}

void main()
{
    return new Silly().doIt();
}
--------

Expected:
To have a compiler error telling us that doIt is not implemented.

Actual:
Compiler happily accepts this, then fails at link time, with error about
missing implementation.

--
Aug 21 2020