digitalmars.D.bugs - [Issue 19235] New: Repeatedly calling non-pure function in non-pure
- d-bugmail puremagic.com (37/37) Sep 08 2018 https://issues.dlang.org/show_bug.cgi?id=19235
https://issues.dlang.org/show_bug.cgi?id=19235 Issue ID: 19235 Summary: Repeatedly calling non-pure function in non-pure literal nested in pure function is broken Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: johannespfau gmail.com The test case is much simpler than the title: ------------------------------------------------- struct FloatingPointControl { void foo() pure { auto impl = function bool() { setControlState(0); setControlState(0); return 0; }; } private: static void setControlState(uint newState) { } } ------------------------------------------------- dmd -c test.d test.d(7): Error: pure function test.FloatingPointControl.foo cannot call impure function test.FloatingPointControl.setControlState Comment one of the setControlState calls and the test case compiles. --
Sep 08 2018