Skip to content

Conversation

@sabiwara
Copy link
Contributor

@sabiwara sabiwara commented Mar 2, 2025

Close #14306

Copying explanation from #14306 (comment)

  • we reach this point when the first enumerable is empty
  • we try to close the remaining enums, that is our Stream.cycle, with {:halt, []}
  • this causes a {:halted, []} explicitly guarded against here

I couldn't find or write any test that fails if we remove this guard.

@sabiwara
Copy link
Contributor Author

sabiwara commented Mar 2, 2025

OK it doesn't work, I found a way it should raise and now doesn't:

File.stream!("/tmp/empty") |> Stream.cycle() |> Enum.take(1)

Closing this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Enum.zip([], Stream.cycle(1..10)) returns error

2 participants