[Issue 2832] pure function too pure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 22 07:40:26 PDT 2010


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


Tomash Brechko <tomash.brechko at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomash.brechko at gmail.com


--- Comment #7 from Tomash Brechko <tomash.brechko at gmail.com> 2010-09-22 07:39:43 PDT ---
Note that (with dmd 2.049)

pure int f(int i)
{
  return ++i;
}

doesn't compile, yet

pure auto f(int i)
{
  return ++i;
}

does work (int return type is replaced with auto).

Also http://www.digitalmars.com/d/2.0/function.html section "Pure Functions"
gives an example of assignment to parameter,

  i = y;    // ok, reading immutable global state

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