Bug 9779 – Improperly implemented interface methods should emit a better diagnostic

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-21T10:25:03Z
Last change time
2024-12-13T18:05:05Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: dmd#18541 →

Comments

Comment #0 by andrej.mitrovich — 2013-03-21T10:25:03Z
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**'
Comment #1 by bearophile_hugs — 2013-03-21T11:48:07Z
This seems a nice idea.
Comment #2 by andrej.mitrovich — 2013-03-21T11:50:20Z
(In reply to comment #1) > This seems a nice idea. The same idea can be extended for overrides: class B { void foo(int count, int** ptr) { } } class C : B { override void foo(int count, float** ptr) { } }
Comment #3 by robert.schadek — 2024-12-13T18:05:05Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18541 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB