Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Fix eltype for chained generators
Browse files Browse the repository at this point in the history
Fixes #90
  • Loading branch information
iamed2 committed Jan 21, 2017
1 parent b332f56 commit ad5a926
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ if VERSION < v"0.5.0-dev+3305"
function iteratorsize(v)
error("Do not call this on older versions")
end

function iteratoreltype(v)
error("Do not call this on older versions")
end
else
import Base: iteratorsize, SizeUnknown, IsInfinite,
HasLength, HasShape
import Base: iteratorsize, iteratoreltype, SizeUnknown, IsInfinite,
HasLength, HasShape, EltypeUnknown
end


Expand Down Expand Up @@ -137,6 +141,7 @@ length(it::Chain{Tuple{}}) = 0
length(it::Chain) = sum(length, it.xss)

eltype{T}(::Type{Chain{T}}) = typejoin([eltype(t) for t in T.parameters]...)
iteratoreltype(c::Chain) = EltypeUnknown()

function start(it::Chain)
i = 1
Expand Down

0 comments on commit ad5a926

Please sign in to comment.