[Issue 15862] dmd thinks functions are strongly pure despite mutable indirections in the return type
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Oct 3 15:20:44 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=15862
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |bugzilla at digitalmars.com
Resolution|--- |INVALID
--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
This is as designed and intended.
1. Mutable indirections in the return type do not affect purity determination.
Mutability of the parameters does.
2. An early design decision was that calling new() inside a pure function is an
acceptable special case. (Otherwise pure functions would be nearly useless.)
--
More information about the Digitalmars-d-bugs
mailing list