Bug 22107 – [scope][dip1000] Can't .dup an array of structs with impure copy constructor

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-06T15:16:19Z
Last change time
2021-07-07T01:40:57Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2021-07-06T15:16:19Z
Not sure if this is a druntime bug or a compiler bug: //////////////// test.d /////////////// @safe unittest { static int i; @safe struct S { this(this) { i++; } } void fun(scope S[] values...) @safe { values.dup; } } /////////////////////////////////////// $ dmd -o- -unittest -preview=dip1000 test.d test.d(11): Error: scope variable `values` assigned to non-scope parameter `a` calling object.dup!(S).dup
Comment #1 by dlang-bot — 2021-07-06T15:19:09Z
@CyberShadow created dlang/druntime pull request #3509 "Fix Issue 22107 - [scope][dip1000] Can't .dup an array of structs wit…" fixing this issue: - Fix Issue 22107 - [scope][dip1000] Can't .dup an array of structs with impure copy constructor https://github.com/dlang/druntime/pull/3509
Comment #2 by dlang-bot — 2021-07-07T01:40:57Z
dlang/druntime pull request #3509 "Fix Issue 22107 - [scope][dip1000] Can't .dup an array of structs wit…" was merged into master: - f61c94ab1fb955cd0f288bd1ee0ea577a5ba7736 by Vladimir Panteleev: Fix Issue 22107 - [scope][dip1000] Can't .dup an array of structs with impure copy constructor https://github.com/dlang/druntime/pull/3509