www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12908] New: [AA] `foreach` by keys and values over

https://issues.dlang.org/show_bug.cgi?id=12908

          Issue ID: 12908
           Summary: [AA] `foreach` by keys and values over associative
                    array in pure function allow impure function calls
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

This code should not compile:
---
void g() {}

void main() pure
{
    foreach(k, v; ["": ""])
        g();
}
---

--
Jun 13 2014