www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11411] New: Disallow non pure lazy expressions in pure functions

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

           Summary: Disallow non pure lazy expressions in pure functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-01
19:38:46 MSK ---
As `lazy` expressions are like a `scope delegate` pure functions should reject
inpure `lazy` expressions just like inpure delegates:
---
void f() { }

void g(lazy void p) pure { p; }

void main()
{ g(f()); } // compiles, should fail
---

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