Bug 5465 – AA.keys with char keys

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-01-20T03:18:00Z
Last change time
2011-04-15T09:28:03Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

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.