http://d.puremagic.com/issues/show_bug.cgi?id=10183
Summary: Eponymous template instance fails to match in
parameter list of other templates
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Jakob Ovrum <[email protected]> 2013-05-27 03:57:40 PDT
---
Code:
----
struct A(T, Unused)
{
T t;
}
template B(T)
{
alias B = A!(T, void);
}
void foo(T)(A!T a) {}
void main()
{
auto b = B!int(42); // OK, works
foo(b); // NG - causes error
}
----
Output:
----
test.d(18): Error: template test.foo does not match any function template
declaration. Candidates are:
test.d(12): test.foo(T)(A!(T) a)
test.d(18): Error: template test.foo(T)(A!(T) a) cannot deduce template
function from argument types !()(A!(int, void))
----
Could be a duplicate, but I don't know what to search for. Does not appear to
be a regression.
The call to `foo` works when the second template parameter of A is removed.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------