The view
doc says
The behavior is undefined if the shape of the parent array is changed after view is called
because there is no bound check for the parent array; e.g., it may cause a
segmentation fault.
but it doesn’t mention what will happen if I change the index (rather than the parent array).
julia> ind = [1]
1-element Vector{Int64}:
1
julia> vals = [10]
1-element Vector{Int64}:
10
julia> v = view(vals, ind)
1-element view(::Vector{Int64}, [1]) with eltype Int64:
10
julia> ind[1] = 2
2
julia> v[1]
0
What happened here? Is this undefined behavior?