Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions compiler/src/dmd/funcsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,7 @@ FuncDeclaration resolveFuncCall(Loc loc, Scope* sc, Dsymbol s,
{
eSink.error(loc, "none of the overloads of `%s` are callable using argument types `%s`",
fd.toErrMsg(), fargsBuf.peekChars());
checkNamedArgErrorAndReportOverload(fd, argumentList, loc);
printCandidates(loc, fd, sc.isDeprecated());
return null;
}
Expand Down
22 changes: 22 additions & 0 deletions compiler/test/fail_compilation/issue21294.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
TEST_OUTPUT:
---
fail_compilation/issue21294.d(18): Error: none of the overloads of `fun` are callable using argument types `(int, int)`
fail_compilation/issue21294.d(18): parameter `a` assigned twice
fail_compilation/issue21294.d(13): Candidates are: `issue21294.fun(int a)`
fail_compilation/issue21294.d(14): `issue21294.fun(int a, int b)`
---
*/

// https://github.com/dlang/dmd/issues/21294

void fun(int a) {}
void fun(int a, int b) {}

void main()
{
fun(
a: 2,
a: 4,
);
}
Loading