Bug 24151 – std.container.array: Array!string("") does not compile

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-09-19T20:15:22Z
Last change time
2023-11-07T09:55:08Z
Keywords
pull
Assigned to
No Owner
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2023-09-19T20:15:22Z
import std.container.array; auto a = Array!string("test"); stdarr.d(4): Error: none of the overloads of template `std.container.array.Array!string.Array.__ctor` are callable using argument types `!()(string)` /usr/include/dmd/phobos/std/container/array.d(570): Candidates are: `__ctor(U)(U[] values...)` with `U = immutable(char)` must satisfy the following constraint: ` isImplicitlyConvertible!(U, T)` /usr/include/dmd/phobos/std/container/array.d(600): `__ctor(Range)(Range r)` with `Range = string` must satisfy the following constraint: ` isImplicitlyConvertible!(ElementType!Range, T)` See: https://forum.dlang.org/post/[email protected] PR incoming.
Comment #1 by dlang-bot — 2023-09-19T20:18:48Z
@ntrel created dlang/phobos pull request #8818 "Fix Issue 24151 - std.container.array: `Array!string("")` does not compile" fixing this issue: - Fix Issue 24151 - std.container.array: Array!string("") does not compile https://github.com/dlang/phobos/pull/8818
Comment #2 by dlang-bot — 2023-11-07T09:55:08Z
dlang/phobos pull request #8818 "Fix Issue 24151 - std.container.array: `Array!string("")` does not compile" was merged into master: - 0eaa3e25a191db3383e75f76a0073a98df620196 by Nick Treleaven: Fix Issue 24151 - std.container.array: Array!string("") does not compile https://github.com/dlang/phobos/pull/8818