[Issue 11662] New: Template constraint evaluation should not look eponymous template function parameters if it's unnecessary

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 1 21:17:12 PST 2013


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

           Summary: Template constraint evaluation should not look
                    eponymous template function parameters if it's
                    unnecessary
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-12-01 21:17:11 PST ---
Both template functions should work, but doesn't.

template gc_free1(T)
{
    alias Type = T*;
    void gc_free1(Type data) {}
}

template gc_free2(T) if (!is(T == class))
{
    alias Type = T*;
    void gc_free2(Type data) {}
}

void main()
{
    int* p;
    gc_free1!int(p);  // OK
    gc_free2!int(p);  // Error: undefined identifier Type
}

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