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

           Summary: Function call syntax disuniformity in template
                    constraints
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-04-04 05:02:04 PDT ---
It seems inside the template constraints functions must be called with a
trailing (), unlike from other functions:


bool foo() {
    return true;
}
void bar1(T)(T) if (foo()) {} // OK
void bar2(T)(T) if (foo)   {} // error
void main() {
    foo;                      // OK
    bar1(0);
    bar2(0);
}



dmd 2.063alpha gives:

temp.d(5): Error: constraint foo is not constant or does not evaluate to a bool

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

Reply via email to