www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - AA's with dstring key

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