Bug 23470 – Backticks in diagnostic are confusing with wrong number of arguments passed

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-11-07T12:14:45Z
Last change time
2022-11-07T14:57:32Z
Keywords
pull
Assigned to
No Owner
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2022-11-07T12:14:45Z
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 by dlang-bot — 2022-11-07T12:15:50Z
@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 by dlang-bot — 2022-11-07T14:57:32Z
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