Comment #0 by bearophile_hugs — 2011-01-20T03:18:09Z
Similar code used to work in D1 (printing "aehilmpstx "), but with DMD 2.051 it prints a wrong output:
import std.stdio;
void main() {
string text = "this is a text example";
int[char] aa;
foreach (c; text)
aa[c]++;
writeln(aa.keys);
}
Generated printout:
t1@
Expected printout, something like:
['t', 'h', ' ', 'x', 'p', 'l', 'i', 'a', 'e', 'm', 's]
Comment #1 by clugdbug — 2011-01-20T08:19:41Z
It started doing that in 2.046, and still failed in 2.051. But it's working in my local copy of DMD, so should be fixed in the next release.
Comment #2 by pedro — 2011-04-15T06:31:27Z
I've tested with version 2.052 and obtained the following output:
th xpliaems
So it's probably fixed now.