From 6869ae1c18f4c7008d7ea3f600c317fb7e5dd24c Mon Sep 17 00:00:00 2001 From: denizyuret Date: Tue, 8 Jan 2019 00:07:31 -0500 Subject: [PATCH] fixing #30643 Not sure what the previous definition of IteratorSize was trying to do, but it was wrong for IsInfinite. Not sure what the correct answer is for HasShape. --- base/iterators.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/iterators.jl b/base/iterators.jl index b329a6c6f9eff..cbb9b0a8e7996 100644 --- a/base/iterators.jl +++ b/base/iterators.jl @@ -1089,10 +1089,9 @@ end @inline peek(s::Stateful, sentinel=nothing) = s.nextvalstate !== nothing ? s.nextvalstate[1] : sentinel @inline iterate(s::Stateful, state=nothing) = s.nextvalstate === nothing ? nothing : (popfirst!(s), nothing) -IteratorSize(::Type{Stateful{VS,T}} where VS) where {T} = - isa(IteratorSize(T), SizeUnknown) ? SizeUnknown() : HasLength() +IteratorSize(::Type{Stateful{T,VS}}) where {T,VS} = IteratorSize(T) eltype(::Type{Stateful{T, VS}} where VS) where {T} = eltype(T) -IteratorEltype(::Type{Stateful{VS,T}} where VS) where {T} = IteratorEltype(T) +IteratorEltype(::Type{Stateful{T,VS}}) where {T,VS} = IteratorEltype(T) length(s::Stateful) = length(s.itr) - s.taken end