julia
julia copied to clipboard
Assume :nothrow in iterating over tuples
On master,
julia> Base.infer_effects(iterate, (Tuple{Int,Int,Int}, Int))
(+c,+e,!n,+t,+s,+m,+u)
Since the indexing is only carried out for valid indices, it should be safe to mark this as nothrow.
After this PR,
julia> Base.infer_effects(iterate, (Tuple{Int,Int,Int}, Int))
(+c,+e,+n,+t,+s,+m,+u)
Is is also valid to annotate iterate for Array with this?
Not Array in general, as there may be uninitialized values that will cause it to throw. But maybe if the element type isbits?