Skip to content
New issue

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

collect does not play well with enumerate/zip/etc #13773

Closed
my-little-repository opened this issue Oct 26, 2015 · 2 comments
Closed

collect does not play well with enumerate/zip/etc #13773

my-little-repository opened this issue Oct 26, 2015 · 2 comments

Comments

@my-little-repository
Copy link

There is a problem when trying to collect the result of a method returning an enumerator, this was alluded in #13772.

 julia>  collect(take(countfrom(),1))
  1-element Array{Int64,1}:
   1

julia>  collect(enumerate(take(countfrom(),1)))
ERROR: MethodError: `length` has no method matching length(::Base.Take{Base.Count{Int64}})
 in collect at array.jl:253
 in collect at array.jl:272

julia> collect(zip(take(countfrom(),1),take(countfrom(),1)))
ERROR: MethodError: `length` has no method matching length(::Base.Take{Base.Count{Int64}})
 in collect at array.jl:253
 in collect at array.jl:272

The problem probably also exists for methods that expect length to be defined for their arguments.

@JeffBezanson
Copy link
Member

Dup of #12009

@KristofferC
Copy link
Member

Also works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants