www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9874] New: Function call syntax disuniformity in template constraints

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Apr 04 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9874


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1837

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 04 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9874




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a61b4a4ee539d137db69a6d2c7e2557f81e96b5b
fix Issue 9874 - Function call syntax disuniformity in template constraints

https://github.com/D-Programming-Language/dmd/commit/1afa14822650f02a608cecda4a5c53cdb219a7a3


Issue 9874 - Function call syntax disuniformity in template constraints

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 07 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9874


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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