www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6682] New: Template function that has lazy parameter does not inferred as pure

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6682

           Summary: Template function that has lazy parameter does not
                    inferred as pure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



By fixing bug 5750, the calcLazy should be inferred as pure, but it doesn't.

T calcLazy(T)(lazy T n)
{
    return n;
}
int purefunc() pure
{
    return calcLazy(1);
    // test.d(8): Error: pure function 'purefunc' cannot call impure function
'calcLazy'
}
void main()
{
    auto n = purefunc();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 16 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6682


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 16 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6682


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



14:04:33 PDT ---
https://github.com/D-Programming-Language/dmd/commit/74a94cfb9347164ade633973105aeda1d96a2998

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