www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13729] New: One not detected case of not purity


          Issue ID: 13729
           Summary: One not detected case of not purity
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

This compiles with no errors, but main() is not pure:

int x;
void main() pure {
    static void foo() {

This correctly gives an error:

int x;
void bar() {
void main() pure {
    bar(); // Error

Nov 13 2014