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

           Summary: Template Overloading or Pattern Matching Failure
           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 [email protected] 2014-03-27 15:28:24 PDT ---
I'm not sure which is failing here, but this doesn't work (and I'm pretty sure
it should).

struct Zero    {}
struct Succ(a) {}

alias One = Succ!Zero;

struct Less    {}
struct Equal   {}
struct Greater {}

struct Cmp(x: Zero,   y: Zero,      c: Equal)   {}
struct Cmp(x: Zero,   y: Succ!n, n, c: Less)    {}
struct Cmp(x: Succ!n, y: Zero,   n, c: Greater) {}

void main()
{
    assert(is(Cmp!(Zero, Zero, Equal)));   //Ok
    assert(is(Cmp!(Zero, One,  Less)));    //Fails
    assert(is(Cmp!(One,  Zero, Greater))); //Fails
}

The error message given in both cases is:

Error: struct Cmp does not match any template declaration

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

Reply via email to