Bug 12131 – Struct assign purity error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-10T09:55:00Z
Last change time
2014-02-23T12:54:04Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-02-10T09:55:43Z
This comes from reduction of code that uses BigInt, I don't understand this problem: import std.internal.math.biguintcore; struct Foo { BigUint a; } void main() pure { BigUint x; x = BigUint(); // OK Foo y; y = Foo(); // Error } DMD 2.065beta3 gives: test.d(7): Error: pure function 'D main' cannot call impure function 'test.Foo.opAssign'
Comment #1 by k.hara.pg — 2014-02-19T22:44:33Z
Comment #2 by github-bugzilla — 2014-02-21T17:54:57Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/83803c4cdfc2f44ec9b0e45943d0486891d90fce fix Issue 12131 - Struct assign purity error https://github.com/D-Programming-Language/dmd/commit/046b22ca767c359e7a28b8c778168921af5b3d63 Merge pull request #3301 from 9rnsr/fix12131 Issue 12131 - Struct assign purity error