Returning the default initializer of the value type when the key
doesn't exist is a bad idea. Consider an integer, it's .init value is
0. If I want to check if a value of a key is zero I could easily end
up with a silent bug:

int[string] aa;
aa["foobar"] = 5;
if (aa["fobar"] == 0) { }  // will always be true
else { }

Reply via email to