Incorrect behaviour of "+=" operator with int-value HashMaps
Submitted by David Paleino
Link to original bug (#631787)
Description
map["key"] = map["key"] + 1
works, while map["key"] += 1
not (nor ++
).
void main () {
var map = new Gee.HashMap<string, int> ();
map["foo"] = 1;
// map["foo"]++; // segfault at compile time
map["foo"] += 1;
assert (map["foo"] == 2); // assertion fails
}
Edited by Rico Tzschichholz