November 13, 2014 [Issue 13729] New: One not detected case of not purity | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=13729 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() { x++; } foo(); } This correctly gives an error: int x; void bar() { x++; } void main() pure { bar(); // Error } -- |
Copyright © 1999-2021 by the D Language Foundation