Bug 10969 – Variadic template parameter re-use in function signature
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-05T02:31:00Z
Last change time
2013-10-01T04:19:06Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
john.loughran.colvin
Comments
Comment #0 by john.loughran.colvin — 2013-09-05T02:31:58Z
template A(T, U...)
{
alias A = T;
}
void foo(T, U...)(A!(T, U) a){}
foo!(int, float)(3);
/d53/f246.d(9): Error: template D main.foo does not match any function template declaration.
Candidates are: /d53/f246.d(7): f246.main.foo(T, U...)(A!(T, U) a)
/d53/f246.d(9): Error: template f246.main.foo(T, U...)(A!(T, U) a) cannot deduce template function from argument types !(int, float)(int)
/d53/f246.d(9): Error: template instance foo!(int, float) errors instantiating template
This also fails:
template A(T, U)
{
alias A = T;
}
void foo(T, U...)(A!(T, U[0]) a){}
foo!(int, float)(3);
/d746/f639.d(9): Error: template D main.foo does not match any function template declaration.
Candidates are: /d746/f639.d(7): f639.main.foo(T, U...)(A!(T, U[0]) a)
/d746/f639.d(9): Error: template f639.main.foo(T, U...)(A!(T, U[0]) a) cannot deduce template function from argument types !(int, float)(int)
/d746/f639.d(9): Error: template instance foo!(int, float) errors instantiating template