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 ***
Comment #2 by nick — 2018-01-02T13:31:27Z
Reopening for when argument count doesn't match parameters: https://github.com/dlang/dmd/pull/7584
Comment #3 by github-bugzilla — 2018-12-01T23:19:38Z
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 by dlang-bot — 2021-04-02T05:45:22Z
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