← Back to index
|
Original Bugzilla link
Bug 21202 – [REG2.093] std.algorithm.mutation.moveEmplace cannot deduce purity and errors
Status
CLOSED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-27T20:46:42Z
Last change time
2021-08-22T21:16:22Z
Keywords
industry, pull
Assigned to
No Owner
Creator
johanengelen
Depends on
21850
Comments
Comment #0
by johanengelen — 2020-08-27T20:46:42Z
This code no longer works since dlang 2.093: ``` struct Strukt2 { this(int* _block) { } } struct Strukt { int* block; Strukt2 foo() { return Strukt2(null); } alias foo this; } void johan() { Strukt a; Strukt b; import std.algorithm.mutation: moveEmplace; moveEmplace(a, b); } ``` Error: `pure` function `std.algorithm.mutation.moveEmplace!(Strukt).moveEmplace` cannot call impure function `std.algorithm.mutation.moveEmplaceImpl!(Strukt).moveEmplaceImpl` Can be fixed by annotating `moveEmplaceImpl` with `pure`.
Comment #1
by dlang-bot — 2020-10-20T13:21:02Z
@JohanEngelen updated dlang/phobos pull request #7670 "Help compiler deduce `pure` for moveEmplaceImpl" fixing this issue: - whitespace fix Fixes issue 21202
https://github.com/dlang/phobos/pull/7670
Comment #2
by razvan.nitu1305 — 2021-08-17T16:35:24Z
*** This issue has been marked as a duplicate of issue 21850 ***