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
*** Issue 4429 has been marked as a duplicate of this issue. ***
From bug 4429, reals also have problems as the key type.
*** Issue 4739 has been marked as a duplicate of this issue. ***
This seems fixed in DMD 2.060 The example now prints [4, 1, 5, 2, 3]