https://issues.dlang.org/show_bug.cgi?id=13748
--- Comment #1 from Steven Schveighoffer <schvei...@yahoo.com> --- Found the issue. The following code tests the problem (adding as a unit test), but is highly dependent on the AA implementation: void main() { int[int] aa; // make all values go into the last bucket (int hash is simply the int) foreach(i; 0..16) { aa[3 + i * 4] = 1; assert(aa.keys.length == i+1); } // now force a rehash, but with a different hash value (lower than current // first used bucket) aa[0] = 1; assert(aa.keys.length == 17); } PR: https://github.com/D-Programming-Language/druntime/pull/1025 --