Thread overview
[Issue 6850] New: BigInt opBinary is not marked as pure.
Oct 25, 2011
Chris Dew
Jun 18, 2013
irritate
October 25, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6850

           Summary: BigInt opBinary is not marked as pure.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: cmsdew@gmail.com


--- Comment #0 from Chris Dew <cmsdew@gmail.com> 2011-10-25 04:54:24 PDT ---
The code below illustrates the issue.

Thanks,

Chris.


gcd.d:

import std.stdio;
import std.bigint;

pure BigInt gcd(BigInt a, BigInt b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

int main() {
  BigInt n = "10000000000";
  writefln("%s", gcd(cast(BigInt)48, n));
  return 0;
}

./gcd.d(6): Error: pure function 'gcd' cannot call impure function 'opBinary' Failed: dmd  -v -o- './gcd.d' -I'.' >./gcd.d.deps

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6850


irritate <irritate@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |irritate@gmail.com


--- Comment #1 from irritate <irritate@gmail.com> 2013-06-18 16:15:08 PDT ---
Issue does not occur for me on head revision, DMD v2.064.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 09, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6850


hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |hsteoh@quickfur.ath.cx
         Resolution|                            |WORKSFORME


--- Comment #2 from hsteoh@quickfur.ath.cx 2013-07-08 20:56:15 PDT ---
Seems to have been fixed in git HEAD. Please reopen if problem still occurs in latest release.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------