From 1e7f92c5163e0a638c537ac3babb2e5b33dc5ea8 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Thu, 11 Aug 2016 08:30:47 -0500 Subject: [PATCH] Fix StackOverflowError in zip_iteratorsize --- base/iterator.jl | 1 + test/functional.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/base/iterator.jl b/base/iterator.jl index 3d74fd5da57db..09dca34b880e4 100644 --- a/base/iterator.jl +++ b/base/iterator.jl @@ -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 diff --git a/test/functional.jl b/test/functional.jl index b495ddb715847..5ed8f3ce51db8 100644 --- a/test/functional.jl +++ b/test/functional.jl @@ -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