Bug 23436 – Spec falsely states mutable references in struct .init are forbidden
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-10-25T17:23:13Z
Last change time
2022-10-26T06:36:01Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0 by snarwin+bugzilla — 2022-10-25T17:23:13Z
The section of the language spec on default struct initialization [1] contains the following statement:
> The default initializers may not contain references to mutable data.
However, this statement is false. References to mutable data are allowed in default initializers of struct fields, and have been since at least DMD 2.060 (the oldest compiler available on run.dlang.io).
[1] https://dlang.org/spec/struct.html#default_struct_init
Comment #1 by dlang-bot — 2022-10-25T17:26:00Z
@pbackus created dlang/dlang.org pull request #3447 "Fix 23436 - Spec falsely states mutable references in struct .init ar…" fixing this issue:
- Fix 23436 - Spec falsely states mutable references in struct .init are forbidden
https://github.com/dlang/dlang.org/pull/3447
Comment #2 by dlang-bot — 2022-10-26T06:36:01Z
dlang/dlang.org pull request #3447 "Fix 23436 - Spec falsely states mutable references in struct .init ar…" was merged into master:
- 4a0af0866a28d7f196406d9266971ea93e45ff61 by Paul Backus:
Fix 23436 - Spec falsely states mutable references in struct .init are forbidden
https://github.com/dlang/dlang.org/pull/3447