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
My guess is that tuples were overlooked when non-integer indexing of vectors was removed.
$ ~/julia0.4/bin/julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.7 (2016-09-18 16:17 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> [1,2][1.0]
WARNING: Indexing with non-Integer Reals is deprecated. It may be that your index arose from an integer division of the form i/j, in which case you should consider using i÷j or div(i,j) instead.
in depwarn at deprecated.jl:73
in to_index at deprecated.jl:447
in getindex at array.jl:283
while loading no file, in expression starting on line 0
1
julia> (1,2)[1.0]
1