```julia julia> x = [1,2] 2-element Vector{Int64}: 1 2 julia> x[2],x[1] = x 2-element Vector{Int64}: 1 1 ``` This is caused by mutating the iterator as it is being iterated: i.e. it is being lowered to ```julia julia> x = [1,2] 2-element Vector{Int64}: 1 2 julia> x[2], state = iterate(x) (1, 2) julia> x[1], state = iterate(x, state) (1, 3) julia> x 2-element Vector{Int64}: 1 1 ``` From @simeonschaub on Slack: > For a non-trivial lhs, we should probably always assign the rhs to temporary variables first and only then call setindex! etc. cc: @JeffBezanson @vtjnash