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

Stream flatten throws StackOverflowException #8100

Closed
scabug opened this issue Dec 24, 2013 · 2 comments
Closed

Stream flatten throws StackOverflowException #8100

scabug opened this issue Dec 24, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 24, 2013

As reported on scala-internals by Matthew Pocock, a Stream[Option[A]] containing mostly (or entirely) None instances will throw a SOE when flattened.

Easy to reproduce via:

Stream.from(0).take(100000).map(_ => None).flatten.length

That should return 0 but will throw a SOE.

@scabug
Copy link
Author

scabug commented Dec 24, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8100?orig=1
Reporter: @non

@scabug
Copy link
Author

scabug commented Dec 24, 2013

@non said:
Here's a PR that fixes the issue: scala/scala#3304

The test suite was taking too long, but I'm pretty sure all the tests will pass.

@scabug scabug closed this as completed Jan 15, 2014
@scabug scabug added this to the 2.11.0-M8 milestone Apr 7, 2017
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