[Issue 5006] 'pure' unenforced in a nested function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 21 11:44:08 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5006


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm at gmail.com


--- Comment #5 from kennytm at gmail.com 2011-02-21 11:41:26 PST ---
Looks like this is fixed in v2.052 or earlier.

Now bearophile's 1st program gives:

x.d(4): Error: pure function 'bar' cannot access mutable static data 'z'
x.d(5): Error: pure nested function 'bar' cannot access mutable data 'x'
x.d(5): Error: pure function 'bar' cannot access mutable static data 'z'

and Lewis' program gives:

x.d(8): Error: pure function 'leapYear' cannot call impure function 'writeln'

as expected, although I think 'bar' should be able to access 'x' in
bearophile's 1st program.

On the other hand, bearophile's 2nd program now result in ICE (at least on Mac
OS X)

Internal error: ../ztc/machobj.c 1805

-- 
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