[Issue 10183] New: Eponymous template instance fails to match in parameter list of other templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 27 03:57:41 PDT 2013


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: nobody at puremagic.com
        ReportedBy: jakobovrum at gmail.com


--- Comment #0 from Jakob Ovrum <jakobovrum at gmail.com> 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: -------


More information about the Digitalmars-d-bugs mailing list