I create a StructArray and want to manipulate the field value of one element.
julia> using StructArrays
julia> mutable struct Test
a
b
end
julia> arr = [Test(1,1), Test(2,2)]
2-element Array{Test,1}:
Test(1, 1)
Test(2, 2)
julia>
julia> sarr = StructArray(arr)
2-element StructArray{Test,1,NamedTuple{(:a, :b),Tuple{Array{Any,1},Array{Any,1}}}}:
Test(1, 1)
Test(2, 2)
julia>
julia> sarr[1].a = 5
5
julia>
julia> sarr.a
2-element Array{Any,1}:
1
2
Why does this not work?