[Issue 9779] New: Improperly implemented interface methods should emit a better diagnostic

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 21 10:25:03 PDT 2013


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

           Summary: Improperly implemented interface methods should emit a
                    better diagnostic
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-21 10:25:03 PDT ---
interface I
{
    void foo(int count, int** ptr);
}

class C : I
{
    void foo(int count, float** ptr) { }
}

void main()
{
}

$ dmd test.d
> (6): Error: class test.C interface function 'void foo(int count, int** ptr)' is not implemented

If there is a name match between an implementation method and an interface
method, the diagnostic should list the implemented method as a partial match,
and should probably show why it doesn't implement the interface method:

> (6): Error: class test.C interface function 'void foo(int count, int** ptr)' is not implemented
> (8): Partial match: 'void foo(int count, float** ptr)'
> (8):     : Parameter #2: 'float**' does not match interface parameter 'int**'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list