D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16165 - Show expected number of function arguments on mismatch
Summary: Show expected number of function arguments on mismatch
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2016-06-12 00:11 UTC by Jonathan Marler
Modified: 2021-04-02 05:45 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan Marler 2016-06-12 00:11:12 UTC
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 Nick Treleaven 2017-12-30 17:34:27 UTC

*** This issue has been marked as a duplicate of issue 15613 ***
Comment 2 Nick Treleaven 2018-01-02 13:31:27 UTC
Reopening for when argument count doesn't match parameters:
https://github.com/dlang/dmd/pull/7584
Comment 3 github-bugzilla 2018-12-01 23:19:38 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b14d8f83d8194867f24aa823aa3a1ff9891f015a
Fix Issue 16165 - Show count of arguments vs parameters on mismatch

https://github.com/dlang/dmd/commit/f35640a7a5aa264c7f7588c4e3ac3b24fd8d225a
Merge pull request #7584 from ntrel/count-args

 Fix Issue 16165 - Show expected number of function arguments on mismatch
Comment 4 Dlang Bot 2021-04-02 05:45:22 UTC
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