Bug 23640 – Nullable range iteration doesn't work with immutable values
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-01-19T07:19:26Z
Last change time
2023-01-20T10:24:05Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2023-01-19T07:19:26Z
import std;
immutable struct S {
int[] a;
}
void main() {
Nullable!S a = Nullable!S(S([3].idup));
writefln!"%s"(a.array);
}
Expected: [S([3])]
Got: Error: none of the overloads of template `std.array.array` are callable using argument types `!()(Nullable!(immutable(S)))`
Comment #1 by dlang-bot — 2023-01-19T08:29:26Z
@FeepingCreature updated dlang/phobos pull request #8668 "Fix issue 23460: Use `Nullable[]` to allow iterating `Nullable` of immutable type." fixing this issue:
- Fix issue 23640: Use `Nullable[]` to allow iterating `Nullable` of immutable type.
https://github.com/dlang/phobos/pull/8668
Comment #2 by dlang-bot — 2023-01-20T10:24:05Z
dlang/phobos pull request #8668 "Fix issue 23640: Use `Nullable[]` to allow iterating `Nullable` of immutable type." was merged into stable:
- 19eaf8a1bd561f186db2c35acbcff49319befb53 by Mathis Beer:
Fix issue 23640: Use `Nullable[]` to allow iterating `Nullable` of immutable type.
https://github.com/dlang/phobos/pull/8668