Comment #0 by pro.mathias.lang — 2015-02-08T15:50:03Z
The following code:
string[string] cpAA(in string[string] ctx) { return ctx.dup; }
Gives this error:
bug.d(1): Error: cannot implicitly convert expression (dup(ctx)) of type const(string)[string] to string[string]
Tested with 2.066 & master (b9c8ded)
Comment #1 by lio+bugzilla — 2020-11-27T16:36:06Z
I'm running into this as well. I suppose the issue is that AArray.dup does a "shallow dup", but in the case of values this should result in copies that can be mutated.
Comment #2 by default_357-line — 2022-02-18T09:56:33Z
Just ran into this again. A workaround: `ctx.byPair.assocArray`.
Comment #3 by robert.schadek — 2024-12-13T18:40:13Z