Summary: 'pure' unenforced in a nested function
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-10-06 14:08:53 PDT ---
This D2 code compiles and runs with no errors with dmd 2.049, and it ignores
the "pure" attribute:

int z = 1000;
int foo(int x) {
    pure int bar(int y) {
        return x + y + z;
    return bar(x * x);
void main() {
    assert(foo(10) == 1111);

I expect this code to not compile.

Is DMD missing unit tests for this?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to