D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14554 - [REG2.066] dmd generate wrong error message for multiple template with same name
Summary: [REG2.066] dmd generate wrong error message for multiple template with same name
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2015-05-07 12:04 UTC by Daniel Kozak
Modified: 2015-06-17 21:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Daniel Kozak 2015-05-07 12:04:40 UTC
// 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/lyieypbmuyfumvccsxes@forum.dlang.org
Comment 1 Vladimir Panteleev 2015-05-07 14:40:07 UTC
Introduced in https://github.com/D-Programming-Language/dmd/pull/2417
Comment 3 github-bugzilla 2015-05-26 03:19:16 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3bc87563d4c276015848c216e799133fafd46f18
fix: Issue 14554 - [REG2.066] dmd generate wrong error message for multiple template with same name

https://github.com/D-Programming-Language/dmd/commit/1c2f164a91fe384c1905ad871e7f38f89b7505b7
Merge pull request #4681 from Kozzi11/Issue_14554

fix: Issue 14554 - [REG2.066] dmd generate wrong error message for multiple template with same name
Comment 4 github-bugzilla 2015-06-17 21:05:26 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3bc87563d4c276015848c216e799133fafd46f18
fix: Issue 14554 - [REG2.066] dmd generate wrong error message for multiple template with same name

https://github.com/D-Programming-Language/dmd/commit/1c2f164a91fe384c1905ad871e7f38f89b7505b7
Merge pull request #4681 from Kozzi11/Issue_14554