Bug 16165 – Show expected number of function arguments on mismatch
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-12T00:11:12Z
Last change time
2021-04-02T05:45:22Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Jonathan Marler
Comments
Comment #0 by johnnymarler — 2016-06-12T00:11:12Z
Currently when a function call has mismatched argument types from the function definition, an error message like this will get printed when compiling with dmd:
Error: function myfunction(...) is not callable using argument types (...)
When a function has more than a couple arguments (like most Windows functions), it can take a bit of effort to figure out which argument is incorrect. Adding extra information like this: "Cannot convert argument 3 'message' from int to string" or "you've called myfunction with 10 arguments but it only has 9", would help developers save time trying to figure out what actually went wrong.
Comment #1 by nick — 2017-12-30T17:34:27Z
*** This issue has been marked as a duplicate of issue 15613 ***
dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" was merged into dmd-cxx:
- a90f4ffcbb0df03f4421617cdf9bf3435d143539 by Nick Treleaven:
[dmd-cxx] Fix Issue 16165 - Show expected number of function arguments on mismatch
https://github.com/dlang/dmd/pull/12339