From 38c3ca67563a68e8f30fd84282b1b9c4cebadeaa Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 27 Oct 2009 10:23:01 +0000 Subject: fixed bug in Stream::flatMap (still optimised a... fixed bug in Stream::flatMap (still optimised as it was needed for correctness --> added regression tests for corresponding tickets) --- test/files/run/t498.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/files/run/t498.scala (limited to 'test/files/run/t498.scala') diff --git a/test/files/run/t498.scala b/test/files/run/t498.scala new file mode 100644 index 0000000000..50be317c4c --- /dev/null +++ b/test/files/run/t498.scala @@ -0,0 +1,5 @@ +object Test extends Application { +// the function passed to flatMap produces lots of empty streams, but this should not overflow the stack + val res = Stream.from(1).flatMap(i => if (i < 3000) Stream.empty else List(1)) + println(res take 42 force) +} \ No newline at end of file -- cgit v1.2.3