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: nob...@puremagic.com
        ReportedBy: cms...@gmail.com


--- Comment #0 from Chris Dew <cms...@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: -------

Reply via email to