digitalmars.D.learn - AA's with dstring key
- H. S. Teoh (17/17) Feb 15 2012 Why does the following code throw a RangeError?
Why does the following code throw a RangeError?
void main() {
int[dstring] map = ["abc"d: 123];
writeln(map["abc"d]);
}
Worse yet:
void main() {
int[dstring] map = ["abc"d: 123];
foreach (key, val; map) {
assert(map[key] == val); // throws RangeError ?!
}
}
Everything works fine if dstring is replaced with string.
I'm finding that AA's appear to be riddled with bugs. :(
T
--
Gone Chopin. Bach in a minuet.
Feb 15 2012








"H. S. Teoh" <hsteoh quickfur.ath.cx>