I've noticed this bug when reading this forum post:
https://forum.dlang.org/post/[email protected]
Code:
----
void f(int x) {}
void main()
{
f("%i");
}
----
The error message says (DMD 2.086.0):
----
test.d(4): cannot pass argument "1" of type string to parameter int x
----
Instead it should say:
----
test.d(4): cannot pass argument "%i" of type string to parameter int x
----
With `f("%s");` DMD even segfaults.
Fix incoming.
Comment #1 by dlang-bot — 2019-06-15T23:15:07Z
@aG0aep6G created dlang/dmd pull request #10040 "fix issue 19971 - wrong string literals in "cannot pass argument" errors" fixing this issue:
- fix issue 19971 - wrong string literals in "cannot pass argument" errors
https://github.com/dlang/dmd/pull/10040
Comment #2 by dlang-bot — 2019-06-16T02:47:47Z
dlang/dmd pull request #10040 "fix issue 19971 - wrong string literals in "cannot pass argument" errors" was merged into master:
- 4c773323d9b7495e09c2689304921ca18d763a2d by aG0aep6G:
fix issue 19971 - wrong string literals in "cannot pass argument" errors
https://github.com/dlang/dmd/pull/10040