[Issue 22244] Key tail immutability should allow hashmap to be impl converted from immutable to mutable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 5 12:25:57 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22244
--- Comment #1 from FeepingCreature <default_357-line at yahoo.de> ---
Simpler demonstration of the issue:
```
immutable int[string] foo;
immutable(int)[string] bar = foo;
```
This should work, because if we cast it:
```
immutable int[string] foo;
immutable(int)[string] bar = foo;
bar["foo"] = 5; // cannot modify `immutable` expression `bar["foo"]`
```
we see that the original `foo` is still protected. So the implconv should go
through.
--
More information about the Digitalmars-d-bugs
mailing list