Skip to content
Open
Changes from 13 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0074a1f
fix #21399 - error message for multiple character constants
Iskaban10 Dec 16, 2025
abe147f
fix #21399 updated
Iskaban10 Dec 16, 2025
465079c
fail4544.d updated
Iskaban10 Dec 17, 2025
d44d7a7
changed fail4544.d
Iskaban10 Dec 17, 2025
aabadb3
Merge branch 'dlang:master' into improve-error-msg
Iskaban10 Dec 17, 2025
f28104c
fix #21381 for correct location in error message
Iskaban10 Dec 23, 2025
9953faa
Merge branch 'improve-error-msg' of https://github.com/Iskaban10/dmd …
Iskaban10 Dec 23, 2025
5c43e6e
Updated
Iskaban10 Dec 23, 2025
a705fa9
Better Template error messages
Iskaban10 Dec 25, 2025
39df2e2
Updated
Iskaban10 Dec 25, 2025
790aa66
Updated
Iskaban10 Dec 25, 2025
0bab93e
Updated
Iskaban10 Dec 25, 2025
ebb014e
Updated
Iskaban10 Dec 25, 2025
73de5a6
Removed fprintf
Iskaban10 Dec 26, 2025
3c9b4ad
Added message()
Iskaban10 Dec 26, 2025
7700710
Function is @safe and returns const(char)*
Iskaban10 Dec 27, 2025
3457709
buf.ptr replaced with &buf[0]
Iskaban10 Dec 27, 2025
9a3b0b5
Merge branch 'dlang:master' into improve-error-msg
Iskaban10 Dec 31, 2025
70f01fb
Updated fail_compilation tests
Iskaban10 Dec 31, 2025
2dc7f0f
Merge branch 'improve-error-msg' of https://github.com/Iskaban10/dmd …
Iskaban10 Dec 31, 2025
b0a9eaf
Changed \ t /
Iskaban10 Dec 31, 2025
500c1f6
Updated tests
Iskaban10 Jan 1, 2026
f8189de
Updated tests
Iskaban10 Jan 1, 2026
4b8ed8f
Updated tests
Iskaban10 Jan 1, 2026
00af04b
Updated tests
Iskaban10 Jan 1, 2026
64a865a
Updated tests
Iskaban10 Jan 1, 2026
70ea306
Updated tests
Iskaban10 Jan 1, 2026
2d075f0
Updated test
Iskaban10 Jan 1, 2026
7ed3eea
Removed Whitespaces
Iskaban10 Jan 1, 2026
6db2b04
Removed Whitespaces
Iskaban10 Jan 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions compiler/src/dmd/funcsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -2066,18 +2066,27 @@ private void printCandidates(Decl)(Loc loc, Decl declaration, bool showDeprecate
int printed = 0; // number of candidates printed
int count = 0; // total candidates
bool child; // true if inside an eponymous template
const(char)* errorPrefix() @safe
const(char)* errorPrefix() @system
{
static char[128] buf;
if (child)
return " - Containing: ";

// align with blank spaces after first message
enum plural = "Candidates are: ";
enum spaces = " ";
// enum plural = "There are %d candidates: ";
// enum spaces = " ";
if (printed)
return spaces;

return (count == 1) ? "Candidate is: " : plural;
{
snprintf(buf.ptr,buf.length," Candidate %d is: ",printed+1);
return buf.ptr;
}
if(count == 1)
return "Candidate is: ";
else
{
fprintf(stderr,"\tThere are multiple candidates\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All diagnostics have to go via the appropriate machinery, not raw printfs.

For example so that it doesn't mess up diagnostics in json or sarif format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used the fprintf to print just the header for the diagnostic message. Passing it through error() function would require unavailable location parameters for the header message.

return "Candidate 1 is: ";
}
}
bool matchSymbol(Dsymbol s, bool print)
{
Expand Down
Loading