Bug 22965 – assocArray does not automatically select non-immutable types even if they're easily reachable.

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-04-01T07:04:41Z
Last change time
2024-12-01T16:39:59Z
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: phobos#9839 →

Comments

Comment #0 by default_357-line — 2022-04-01T07:04:41Z
Consider the following code: immutable int a; auto b = [tuple(a, a)].assocArray; assocArray should be able to see that while it gets an immutable int as value, it can trivially convert that to int, which is allowed. Unfortunately, it instead complains that "assocArray: value type must be mutable", forcing the awkward `tuple!(int, int)(a, a)`.
Comment #1 by robert.schadek — 2024-12-01T16:39:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9839 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB