Bug 13694 – Typesafe variadic function template overload fails to match to any template
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-07T03:52:00Z
Last change time
2015-02-18T03:39:40Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
alanb
Comments
Comment #0 by alanb — 2014-11-07T03:52:41Z
Below minimal code used to work with DMD 2.064.2 amd64
fails with DMD 2.066.1 amd64
struct S{}
void foo(T)( string A, long E, T[] G ... )
{}
void foo(T)( string A, T[] G ... )
{}
int main()
{
S v;
foo("A", v); // <- OK
foo("A", 0, v); // <- used to be OK but now fails
foo!(S)("A", 0, v); // <- workaround solution
return 0;
}
$ dmd main.d
main.d(13): Error: template main.foo cannot deduce function from argument types !()(string, int, S), candidates are:
main.d(3): main.foo(T)(string A, long E, T[] G...)
main.d(6): main.foo(T)(string A, T[] G...)