Bug 17330 – [REG 2.072] BigInt's constructor used to be pure

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-04-18T13:11:43Z
Last change time
2018-01-05T13:28:22Z
Assigned to
Jack Stouffer
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2017-04-18T13:11:43Z
Found by Russel Winder who posted to D.learn: http://forum.dlang.org/post/[email protected] This used to work, and it should be made to work again: ---- void main() { import std.bigint: BigInt; auto b = immutable BigInt("123"); } ---- Fails compilation since 2.072.0. Regression was introduced by <https://github.com/dlang/phobos/pull/3876>. The issue is that purity cannot be inferred for the constructor. It used to be explicitly marked `pure` when it wasn't a template. I've previously filed this as a compiler bug, thinking that a templated constructor should infer `pure`. That issue has been closed as WONTFIX. See issue 17309. I'm not sure if this can be fixed satisfactorily. So this may end up as WONTFIX as well. But that would be quite disappointing.
Comment #1 by jack — 2017-04-19T16:09:13Z
Comment #2 by github-bugzilla — 2017-04-20T16:22:53Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/9e342bcc77f05b97fb8e0e176f5d9f5d44205dba Fix Issue 17330 - [REG 2.072] BigInt's constructor used to be pure https://github.com/dlang/phobos/commit/d0bb8bbff7e0e420541244c09c850190dd0c7df4 Merge pull request #5340 from JackStouffer/issue17330 Fix Issue 17330 - [REG 2.072] BigInt's constructor used to be pure merged-on-behalf-of: Jack Stouffer <[email protected]>
Comment #3 by github-bugzilla — 2017-05-29T23:02:12Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/9e342bcc77f05b97fb8e0e176f5d9f5d44205dba Fix Issue 17330 - [REG 2.072] BigInt's constructor used to be pure https://github.com/dlang/phobos/commit/d0bb8bbff7e0e420541244c09c850190dd0c7df4 Merge pull request #5340 from JackStouffer/issue17330
Comment #4 by github-bugzilla — 2018-01-05T13:28:22Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/9e342bcc77f05b97fb8e0e176f5d9f5d44205dba Fix Issue 17330 - [REG 2.072] BigInt's constructor used to be pure https://github.com/dlang/phobos/commit/d0bb8bbff7e0e420541244c09c850190dd0c7df4 Merge pull request #5340 from JackStouffer/issue17330