[Issue 12166] New: Template Argument Pattern Matching Fails for Struct With Multiple Nested Template Arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 14 21:15:06 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12166

           Summary: Template Argument Pattern Matching Fails for Struct
                    With Multiple Nested Template Arguments
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monkeyworks12 at hotmail.com


--- Comment #0 from monkeyworks12 at hotmail.com 2014-02-14 21:15:01 PST ---
struct Zero    {}
struct Succ(a) {}

struct Nil {}
struct Cons(a, b) {}

alias list1 = Cons!(Three, Cons!(Two, Cons!(Four, Cons!(One, Nil))));

alias numlHead(L: Cons!(a, b), a, b) = a;

alias numlTail(L: Cons!(a, b), a, b) = b;

void main()
{
    //Error: template instance numlHead!(list1) does not 
    //match template declaration numlHead(L : Cons!(a, b), a, b)
    pragma(msg, numlHead!list1);
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list