scala/scala — pull request #3304 by non (2013-12-24 21:00:22+00:00)
Title: SI-8100 - prevent possible SOE during Stream#flatten.

This commit changes stream flatten to avoid allocating a
stack frame for every stream item. Previously, flattening
a stream whose elements are mostly empty would result in
a StackOverflowException.

This commit also adds a test demonstrating the problem.