← Back to index
|
Original Bugzilla link
Bug 22105 – std.container.array.Array.length setter creates values of init-less types
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-06T05:15:06Z
Last change time
2021-12-28T23:33:40Z
Keywords
accepts-invalid, pull
Assigned to
No Owner
Creator
Vladimir Panteleev
Comments
Comment #0
by dlang-bugzilla — 2021-07-06T05:15:06Z
//////////////////// test.d /////////////////// import std.container.array; struct NonZero { private int n; @disable this(); this(int n) { assert(n != 0); this.n = n; } invariant { assert(n != 0); } @property int value() const { return n; } } void main() { Array!NonZero a; a.length = 5; assert(a[0].n != 0); } /////////////////////////////////////////////// This should not be allowed.
Comment #1
by dlang-bot — 2021-12-28T17:26:29Z
@wolframw created dlang/phobos pull request #8344 "Fix Issue 22105 - std.container.array.Array.length setter creates val…" fixing this issue: - Fix Issue 22105 - std.container.array.Array.length setter creates values of init-less types
https://github.com/dlang/phobos/pull/8344
Comment #2
by dlang-bot — 2021-12-28T23:33:40Z
dlang/phobos pull request #8344 "Fix Issue 22105 - std.container.array.Array.length setter creates val…" was merged into master: - 7b863cadab53e1c4ddffffbab296787372d4d2a1 by wolframw: Fix Issue 22105 - std.container.array.Array.length setter creates values of init-less types
https://github.com/dlang/phobos/pull/8344