Attempt to access Tuple{Float64, Bool} at index [0]

The syntax for elt in coll iterates on the elements of the collection. Therefore, in your example i takes in turn the values 1.0 (which, by chance, happens to be a valid index) and false (which is seen as 0 and is not a valid index).

TLDR: you can iterate directly on elements in the tuple:

julia> a = (1.0,false::Bool)
(1.0, false)

julia> for ai in a
           @show ai
       end
ai = 1.0
ai = false

Or you can use eachindex to iterate on valid indices:

julia> for i in eachindex(a)
           @show a[i]
       end
a[i] = 1.0
a[i] = false
3 Likes