D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23470 - Backticks in diagnostic are confusing with wrong number of arguments passed
Summary: Backticks in diagnostic are confusing with wrong number of arguments passed
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 trivial
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2022-11-07 12:14 UTC by Nick Treleaven
Modified: 2022-11-07 14:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nick Treleaven 2022-11-07 12:14:45 UTC
E.g. this code:

void foo(void delegate(int) dg)
{
    dg();
    //writefln("%s", dg(3));
}

Below due to the backticks it looks like 0 was the argument value passed, not the expected number of arguments.

Error: delegate `dg(int)` is not callable using argument types `()`
       too few arguments, expected `1`, got `0`

Should be:
       too few arguments, expected 1, got 0

PR incoming.
Comment 1 Dlang Bot 2022-11-07 12:15:50 UTC
@ntrel created dlang/dmd pull request #14628 "Fix Issue 23470 - Backticks in diagnostic are confusing with wrong nu…" fixing this issue:

- Fix Issue 23470 - Backticks in diagnostic are confusing with wrong number of arguments passed

https://github.com/dlang/dmd/pull/14628
Comment 2 Dlang Bot 2022-11-07 14:57:32 UTC
dlang/dmd pull request #14628 "Fix Issue 23470 - Backticks in diagnostic are confusing with wrong nu…" was merged into master:

- a5afe3fe6faf89c883a6f06113f38b395843b5de by Nick Treleaven:
  Fix Issue 23470 - Backticks in diagnostic are confusing with wrong number of arguments passed

https://github.com/dlang/dmd/pull/14628