Bug 14554 – [REG2.066] dmd generate wrong error message for multiple template with same name
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-07T12:04:00Z
Last change time
2015-06-17T21:05:26Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
kozzi11
Comments
Comment #0 by kozzi11 — 2015-05-07T12:04:40Z
// test.d
struct S {
void foo(T)(int j) {}
static void foo(T)(int j) {}
}
void main()
{
S.foo!bool(1);
}
2.067:
test.d(8): Error: need 'this' for 'foo' of type '(int j)'
2.066:
test.d(8): Error: need 'this' for 'foo' of type 'pure nothrow @nogc @safe void(int j)'
2.063:
test.d(8): Error: template test.S.foo matches more than one template declaration, test.d(2):foo(T)(int j) and test.d(3):foo(T)(int j)
test.d(8): Error: need 'this' for 'foo' of type 'pure nothrow @safe void(int j)'
// test2.d
struct S {
static void foo(T)(int j) {}
void foo(T)(int j) {}
}
void main()
{
S.foo!bool(1);
}
2.067:
test2.d(8): Error: need 'this' for 'foo' of type '(int j)'
2.066:
test2.d(8): Error: test2.S.foo called with argument types (int) matches both:
test2.d(2): test2.S.foo!bool.foo(int j)
and:
test2.d(3): test2.S.foo!bool.foo(int j)
2.063:
test2.d(8): Error: template test2.S.foo matches more than one template declaration, test2.d(2):foo(T)(int j) and test2.d(3):foo(T)(int j)
some more info:
http://forum.dlang.org/post/[email protected]
Comment #1 by dlang-bugzilla — 2015-05-07T14:40:07Z