[Issue 9874] New: Function call syntax disuniformity in template constraints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 4 05:02:06 PDT 2013


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: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 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: -------


More information about the Digitalmars-d-bugs mailing list