I agree, something more is going on. I found this from a couple years ago which probably explains it:
In other words, I think
@set a[i].s = 1
is interpreted as : “give me a copy ofa
in which thex
field of thei
-th element is set to 1”. As opposed to “give me a copy ofa[i]
in which thex
field is set to 1” (which would be the desired semantics here).
Container of mutable structs without 100x slowdown? - #5 by ffevotte
It looks like a proposed fix was rejected?