Map values cannot be reassigned once they are set
Reproduction:
let map: hmap[] = []
let map[key] = 1
let map[key] = 2
echo @map
Prints key 1
instead of key 2
. Both HashMaps and BTreeMaps are affected.
Expected behaviour:
I'd expect it to work the same way as integer variables work:
let m: int = 0
let m = 1
let m = 2
echo $m # Prints 2
Build information:
rustc -V
: rustc 1.33.0-nightly (4c2be9c97 2019-01-22)
git rev-parse HEAD
: 7e45ae99