Skip to content
Merged
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
3 changes: 3 additions & 0 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -6798,6 +6798,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, tf, null, exp.type, exp.argumentList, f, exp.type, exp.argprefix))
return setError();
exp.names = null;

exp.member = f.isCtorDeclaration();
assert(exp.member);
Expand Down Expand Up @@ -6911,6 +6912,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, tf, null, exp.type, exp.argumentList, f, exp.type, exp.argprefix))
return setError();
exp.names = null;

exp.member = f.isCtorDeclaration();
assert(exp.member);
Expand Down Expand Up @@ -8515,6 +8517,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
exp.arguments = new Expressions();
if (functionParameters(exp.loc, sc, cast(TypeFunction)t1, ethis, tthis, exp.argumentList, exp.f, exp.type, argprefix))
return setError();
exp.names = null;

if (!exp.type)
{
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/fail_compilation/named_arguments_error.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fail_compilation/named_arguments_error.d(42): missing argument for parame
fail_compilation/named_arguments_error.d(34): `named_arguments_error.g(int x, int y, int z = 3)` declared here
fail_compilation/named_arguments_error.d(44): Error: no named argument `element` allowed for array dimension
fail_compilation/named_arguments_error.d(45): Error: no named argument `number` allowed for scalar
fail_compilation/named_arguments_error.d(46): Error: cannot implicitly convert expression `g(x: 3, y: 4, z: 5)` of type `int` to `string`
fail_compilation/named_arguments_error.d(46): Error: cannot implicitly convert expression `g(3, 4, 5)` of type `int` to `string`
fail_compilation/named_arguments_error.d(47): Error: template `tempfun` is not callable using argument types `!()(int, int)`
fail_compilation/named_arguments_error.d(47): argument `1` goes past end of parameter list
fail_compilation/named_arguments_error.d(50): Candidate is: `tempfun(T, U)(T t, U u)`
Expand All @@ -43,7 +43,7 @@ void main()

auto g0 = new int[](element: 3);
auto g1 = new int(number: 3);
string s = g(x: 3, y: 4, z: 5);
string s = g(z: 5, x: 3, y: 4);
enum x = tempfun(u: 0, 1);
}

Expand Down
Loading