Skip to content

Commit

Permalink
Merge pull request #4681 from Kozzi11/Issue_14554
Browse files Browse the repository at this point in the history
fix: Issue 14554 - [REG2.066] dmd generate wrong error message for multiple template with same name
  • Loading branch information
9rnsr committed May 26, 2015
2 parents bb7b196 + 3bc8756 commit 1c2f164
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -8840,7 +8840,7 @@ Expression *CallExp::semantic(Scope *sc)
{
s = ((TemplateExp *)e1)->td;
L2:
f = resolveFuncCall(loc, sc, s, tiargs, NULL, arguments, 2);
f = resolveFuncCall(loc, sc, s, tiargs, NULL, arguments);
if (!f || f->errors)
return new ErrorExp();
if (f->needThis())
Expand Down
30 changes: 30 additions & 0 deletions test/fail_compilation/fail14554.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// REQUIRED_ARGS: -o-

/*
TEST_OUTPUT:
---
fail_compilation/fail14554.d(28): Error: fail14554.issue14554_1.foo called with argument types (int) matches both:
fail_compilation/fail14554.d(17): fail14554.issue14554_1.foo!bool.foo(int j)
and:
fail_compilation/fail14554.d(18): fail14554.issue14554_1.foo!bool.foo(int j)
fail_compilation/fail14554.d(29): Error: fail14554.issue14554_2.foo called with argument types (int) matches both:
fail_compilation/fail14554.d(22): fail14554.issue14554_2.foo!bool.foo(int j)
and:
fail_compilation/fail14554.d(23): fail14554.issue14554_2.foo!bool.foo(int j)
---
*/
struct issue14554_1 {
void foo(T)(int j) {}
static void foo(T)(int j) {}
}

struct issue14554_2 {
static void foo(T)(int j) {}
void foo(T)(int j) {}
}

void test14554()
{
issue14554_1.foo!bool(1);
issue14554_2.foo!bool(1);
}

0 comments on commit 1c2f164

Please sign in to comment.