www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12422] New: Templated nested function is inferred as `pure` even if it calls impure functions

https://d.puremagic.com/issues/show_bug.cgi?id=12422

           Summary: Templated nested function is inferred as `pure` even
                    if it calls impure 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> 2014-03-20
14:51:06 MSK ---
This code shouldn't compile:
---
int i;
void f() { ++i; }

void main() pure
{
    void g()() { f(); }
    g();
}
---

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