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

--- Comment #0 from 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() {
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:
------- You are receiving this mail because: -------

Reply via email to