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

Changing order of iterators gives an error #22867

Closed
cossio opened this issue Jul 19, 2017 · 2 comments
Closed

Changing order of iterators gives an error #22867

cossio opened this issue Jul 19, 2017 · 2 comments

Comments

@cossio
Copy link
Contributor

cossio commented Jul 19, 2017

prod([i for j = 1:10 for i in 1:10 if i > 10])
# result = 1

but

prod([i for i in 1:10 if i > 10 for j = 1:10])

ERROR: ArgumentError: argument to Flatten must contain at least one iterator

Something seems wrong here...

Related: https://discourse.julialang.org/t/can-i-type-assert-the-eltype-of-an-iterator/4936

@JeffBezanson
Copy link
Member

An interesting case of #18852. Flatten is able to accept a single empty iterator, but not zero iterators.

@JeffBezanson
Copy link
Member

Dup of #18852.

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

2 participants