[Issue 5274] New: Impure function call inside impure function nested inside pure function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 24 16:51:55 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5274
Summary: Impure function call inside impure function nested
inside pure function
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic
Severity: minor
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-11-24 16:50:31 PST ---
This D2 code is formally correct because bar() is never called:
import core.stdc.stdio: putchar;
pure void foo() {
static void bar() {
putchar('a');
}
}
void main() {}
DMD 2.050 prints:
test.d(4): Error: pure function 'foo' cannot call impure function 'putchar'
Despite foo() doesn't contain calls to putchar().
Even if I modify this program, adding a call to bar() inside foo(), that
strange error message doesn't change.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list