summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-06-21 17:20:39 +0000
committerPaul Phillips <paulp@improving.org>2011-06-21 17:20:39 +0000
commit5c416166c22abfb5ca0a595b468844708dcdaa45 (patch)
treec8156556a6dd02a0645886f1f29591dcb4c1d8c5 /test/files/run
parentd4f8dc660a9b17b30b7c6b909b5a15d028ce7c37 (diff)
downloadscala-5c416166c22abfb5ca0a595b468844708dcdaa45.tar.gz
scala-5c416166c22abfb5ca0a595b468844708dcdaa45.tar.bz2
scala-5c416166c22abfb5ca0a595b468844708dcdaa45.zip
Routed Stream.+: through cons to avoid some tru...
Routed Stream.+: through cons to avoid some truly pathological performance. Closes #4697, no review.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/bug4697.check1
-rw-r--r--test/files/run/bug4697.scala8
2 files changed, 9 insertions, 0 deletions
diff --git a/test/files/run/bug4697.check b/test/files/run/bug4697.check
new file mode 100644
index 0000000000..b9d569380c
--- /dev/null
+++ b/test/files/run/bug4697.check
@@ -0,0 +1 @@
+50005000
diff --git a/test/files/run/bug4697.scala b/test/files/run/bug4697.scala
new file mode 100644
index 0000000000..95592172e0
--- /dev/null
+++ b/test/files/run/bug4697.scala
@@ -0,0 +1,8 @@
+object Test {
+ var st = Stream(0)
+ for (i <- 1 to 10000) st = i +: st
+
+ def main(args: Array[String]): Unit = {
+ println(st.take(10000).sum)
+ }
+}