Bug 4759 – Generic matching not working with alias parameters
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-08-29T11:46:00Z
Last change time
2015-02-18T03:40:18Z
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2010-08-29T11:46:41Z
Consider:
struct A(alias pred) {}
void fun(alias pred)(A!(pred) ax) {}
void main()
{
A!("x") a;
fun(a);
}
Result:
Error: template test.fun(alias pred) does not match any function template declaration
Error: template test.fun(alias pred) cannot deduce template function from argument types !()(A!(""))
The code works as expected if the alias is replaced with a type parameter.
Comment #1 by k.hara.pg — 2013-02-20T07:46:35Z
Works in 2.063alpha.
Comment #2 by github-bugzilla — 2014-12-02T18:05:41Z