Thread overview
[Issue 13729] [REG2.067a] One not detected case of not purity
Feb 23, 2015
Kenji Hara
Feb 27, 2015
Kenji Hara
February 23, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
            Summary|One not detected case of    |[REG2.067a] One not
                   |not purity                  |detected case of not purity
                 OS|Windows                     |All
           Severity|normal                      |regression

--
February 27, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/4447

--
February 28, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #2 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3a9a56bce0d595fbe538946321e2fb8692711386 fix Issue 13729 - One not detected case of not purity

https://github.com/D-Programming-Language/dmd/commit/8b3bd7381a82dac630f5a8374618caf5a3b8ae98 Merge pull request #4447 from 9rnsr/fix13729

[REG2.067a] Issue 13729 - One not detected case of not purity

--
February 28, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
February 28, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #3 from bearophile_hugs@eml.cc ---
Now this code:

int x;
void main() pure {
    static void foo() {
        x++;
    }
    foo();
}


Gives:

test.d(4,9): Error: pure function 'D main' cannot access mutable static data
'x'


I think a more precise error message should say that the pure function main()
can't call the impure static function foo(), and foo() can't be pure because it
writes static data.


This program shows that foo() doesn't need to be annotated with "pure" for the
code to compile:

int x;
void main() pure {
    static void foo() {
    }
    foo();
}

--
February 28, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #4 from github-bugzilla@puremagic.com ---
Commit pushed to 2.067 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fe6729a9465c628e48712d9c3c7a722d4d100f1d Merge pull request #4447 from 9rnsr/fix13729

[REG2.067a] Issue 13729 - One not detected case of not purity
Conflicts:
    src/expression.c

--
April 11, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #5 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fe6729a9465c628e48712d9c3c7a722d4d100f1d Merge pull request #4447 from 9rnsr/fix13729

--
June 17, 2015
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3a9a56bce0d595fbe538946321e2fb8692711386 fix Issue 13729 - One not detected case of not purity

https://github.com/D-Programming-Language/dmd/commit/8b3bd7381a82dac630f5a8374618caf5a3b8ae98 Merge pull request #4447 from 9rnsr/fix13729

--