Bug 24177 – Array literal can implicitly convert to an expected type
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-10-06T14:34:23Z
Last change time
2023-11-08T10:32:37Z
Keywords
pull, spec
Assigned to
No Owner
Creator
Nick Treleaven
Comments
Comment #0 by nick — 2023-10-06T14:34:23Z
The spec should state that an array literal can implicitly convert each of its elements when there is an expected array type available. (This is much safer than casting the literal).
PR incoming.
Comment #1 by dlang-bot — 2023-10-06T14:37:34Z
@ntrel created dlang/dlang.org pull request #3701 "[spec] Array literal can implicitly convert to an expected type" fixing this issue:
- [spec] Array literal can implicitly convert to an expected type
Fix Issue 24177 - Array literal can implicitly convert to an expected type.
Use this feature to avoid casting elements manually in example.
https://github.com/dlang/dlang.org/pull/3701
Comment #2 by dlang-bot — 2023-11-08T10:32:37Z
dlang/dlang.org pull request #3701 "[spec] Array literal can implicitly convert to an expected type" was merged into master:
- f8b63d265ed13baf952e5e326f82a9199269bf52 by Nick Treleaven:
[spec] Array literal can implicitly convert to an expected type
Fix Issue 24177 - Array literal can implicitly convert to an expected type.
Use this feature to avoid casting elements manually in example.
https://github.com/dlang/dlang.org/pull/3701