[Issue 24169] Confusion between array literal and associative array literal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 29 16:57:26 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24169

--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> ---
> It would be surprising when adding a key to an existing associative array suddenly turns it into an integer array or vice versa.

The change to add associative array literals did exactly that. It silently
switched code from generating an array literal to an associative array literal.
(The penalty is slow access, as array indexing is much faster.)

I discovered this via testing.

--


More information about the Digitalmars-d-bugs mailing list