[Issue 4759] New: Generic matching not working with alias parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 29 11:46:55 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4759

           Summary: Generic matching not working with alias parameters
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2010-08-29 11:46:41 PDT ---
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.

-- 
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