Description
julia> collection_of_iterators = [Iterators.map(identity, 3), Iterators.map(sqrt, 3)];
julia> Base.IteratorSize.(collection_of_iterators)
2-element Vector{Base.HasShape{0}}:
Base.HasShape{0}()
Base.HasShape{0}()
julia> Base.IteratorSize(eltype(collection_of_iterators)) # incorrect, hits the fallback method
Base.HasLength()
There are two correct options for the return type here:
HasShape{0}
: precise and accurateSizeUnknown
: imprecise, but still accurate
The fix should be simple, this is the relevant method, just need to relax the dispatch:
Line 101 in 772745b
NB: This is perhaps part of a wider issue of HasLength
not being a correct fallback, but that's a separate topic.