D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4201 - associative arrays keys property contains corrupted data for keys property for keys of size < size_t
Summary: associative arrays keys property contains corrupted data for keys property fo...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: Sean Kelly
URL:
Keywords:
: 4429 4739 (view as issue list)
Depends on:
Blocks:
 
Reported: 2010-05-17 08:08 UTC by Steven Schveighoffer
Modified: 2014-02-15 02:44 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Steven Schveighoffer 2010-05-17 08:08:49 UTC
This problem exists on 2.046 and is most likely related to bug 4184 which was solved in 2.046.  Note that the bugzilla interface does not allow me to select 2.046.

test case:

void main()
{
    uint[ushort] aa;
    aa[1] = 1;
    aa[2] = 2;
    aa[3] = 3;
    aa[4] = 4;
    aa[5] = 5;
    writefln("%s", aa.keys);
}

outputs:

4 0 1 0 5
Comment 1 Steven Schveighoffer 2010-07-06 04:38:40 UTC
*** Issue 4429 has been marked as a duplicate of this issue. ***
Comment 2 Steven Schveighoffer 2010-07-06 04:39:15 UTC
From bug 4429, reals also have problems as the key type.
Comment 3 Steven Schveighoffer 2010-08-27 07:23:12 UTC
*** Issue 4739 has been marked as a duplicate of this issue. ***
Comment 4 Malte Skarupke 2012-10-27 10:32:09 UTC
This seems fixed in DMD 2.060

The example now prints [4, 1, 5, 2, 3]