Skip to content

Commit

Permalink
fix: Issue 14554 - [REG2.066] dmd generate wrong error message for mu…
Browse files Browse the repository at this point in the history
…ltiple template with same name
  • Loading branch information
Kozzi11 committed May 25, 2015
1 parent bb7b196 commit 3bc8756
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 3bc8756

Please sign in to comment.