Bug 24872 – Assigning non-copyable value to array has no effect

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-11-22T18:42:38Z
Last change time
2024-11-29T13:18:44Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus

Comments

Comment #0 by snarwin+bugzilla — 2024-11-22T18:42:38Z
As of DMD 2.109.1, the following program produces an assertion failure when run: --- struct S { int n; @disable this(this); } void main() { import std.stdio; S[1] arr = [S(123)]; arr = S(456); assert(arr[0].n == 456); // fail } --- The error message is --- [email protected](13): 123 != 456 --- This shows that the new value of S(456) is not assigned to arr[0].
Comment #1 by dlang-bot — 2024-11-22T19:05:57Z
@pbackus created dlang/dmd pull request #17083 "Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect" fixing this issue: - Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect https://github.com/dlang/dmd/pull/17083
Comment #2 by schveiguy — 2024-11-22T19:48:42Z
*** Issue 24433 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bot — 2024-11-22T21:51:08Z
dlang/dmd pull request #17083 "Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect" was merged into stable: - 36c2e531ab76e0c1099a3f9b293d255f82265c3f by Paul Backus: Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect https://github.com/dlang/dmd/pull/17083
Comment #4 by dlang-bot — 2024-11-29T13:18:44Z
dlang/dmd pull request #17098 "Merge stable" was merged into master: - 4c645bbaf970985f9d30e25a4b8f7bdd39b765ef by Paul Backus: Fix Bugzilla 24872 - Assigning non-copyable value to array has no effect https://github.com/dlang/dmd/pull/17098