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: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@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: -------

Reply via email to