I have two questions about the following experiment:
- Why are there so many more possibilities with
AbstractArray
? Is it correct? - Why doesn’t it return unique results? Maybe it should.
julia> Base.return_types(iterate, Tuple{AbstractArray{Int,1}})
11-element Array{Any,1}:
Union{Nothing, Tuple{Any,Int64}}
Union{Nothing, Tuple{Any,Any}}
Union{Nothing, Tuple{Any,Any}}
Union{Nothing, Tuple{Any,Any}}
Any
Any
Union{Nothing, Tuple{Int64,Int64}}
Union{Nothing, Tuple{Any,Int64}}
Union{Nothing, Tuple{Int64,Tuple{Int64,UInt64}}}
Union{Nothing, Tuple{Any,Union{Tuple{Int64,Any}, Tuple{Int64,Any,Any}}}}
Any
julia> Base.return_types(iterate, Tuple{Array{Int,1}}) |> unique
1-element Array{Any,1}:
Union{Nothing, Tuple{Int64,Int64}}