Skip to content

Commit

Permalink
Fix StackOverflowError in zip_iteratorsize
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Aug 11, 2016
1 parent b066714 commit 1e7f92c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ zip_iteratorsize(a, b) = and_iteratorsize(a,b) # as `and_iteratorsize` but inher
zip_iteratorsize(::HasLength, ::IsInfinite) = HasLength()
zip_iteratorsize(::HasShape, ::IsInfinite) = HasLength()
zip_iteratorsize(a::IsInfinite, b) = zip_iteratorsize(b,a)
zip_iteratorsize(a::IsInfinite, b::IsInfinite) = IsInfinite()


immutable Zip1{I} <: AbstractZipIterator
Expand Down
1 change: 1 addition & 0 deletions test/functional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ end
@test Base.iteratorsize(repeated(0, 5)) == Base.HasLength()
@test Base.iteratoreltype(repeated(0)) == Base.HasEltype()
@test Base.iteratoreltype(repeated(0, 5)) == Base.HasEltype()
@test Base.iteratorsize(zip(repeated(0), repeated(0))) == Base.IsInfinite()


# product
Expand Down

0 comments on commit 1e7f92c

Please sign in to comment.