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 --- core.exception.AssertError@bug.d(13): 123 != 456 --- This shows that the new value of S(456) is not assigned to arr[0].
@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
*** Issue 24433 has been marked as a duplicate of this issue. ***
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
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