void main() { string[string] hash; hash["foo"] = ""; foreach (name; hash.byKey()) { assert(typeid(string) == typeid(name)); // ok } // Error: cannot uniquely infer foreach argument types foreach (string name; hash.byKey()) { } } I'm confused, why can't I specify the type? It ends up being a string if I don't set it..
This compiles and runs with 2.059.
Hmm.. I can't recreate this in 2.057 either. It does crash DMD 2.053 though, so it might have been some kind of lurking bug somewhere.. I'll close it now though.