Bug 9360 – Bad error message with non-const template method
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-20T14:00:00Z
Last change time
2017-07-02T14:47:05Z
Keywords
diagnostic
Assigned to
nobody
Creator
rswhite4
Comments
Comment #0 by rswhite4 — 2013-01-20T14:00:35Z
struct A {
public:
void test()() {
}
}
void main() {
const A[4] as;
foreach (index; 0 .. 4) {
as[index].test();
}
}
This prints:
/home/c895/c892.d(15): Error: template c892.A.test does not match any function template declaration. Candidates are:
/home/c895/c892.d(5): c892.A.test()()
/home/c895/c892.d(15): Error: template c892.A.test()() cannot deduce template function from argument types !()()
It's not easy to understand that you try to call a non-const template method.
Comment #1 by dlang-bugzilla — 2017-07-02T14:47:05Z