We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
IteratorSize
Generator
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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}
SizeUnknown
The fix should be simple, this is the relevant method, just need to relax the dispatch:
julia/base/generator.jl
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.
HasLength
The text was updated successfully, but these errors were encountered:
relax dispatch for the IteratorSize method for Generator
8fa5909
Fixes JuliaLang#58109
nsajko
Successfully merging a pull request may close this issue.
There are two correct options for the return type here:
HasShape{0}
: precise and accurateSizeUnknown
: imprecise, but still accurateThe fix should be simple, this is the relevant method, just need to relax the dispatch:
julia/base/generator.jl
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.The text was updated successfully, but these errors were encountered: