diff options
author | Paul Phillips <paulp@improving.org> | 2010-09-15 23:12:32 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-09-15 23:12:32 +0000 |
commit | 8562015759b9f99547a78886e28da79e588eaf18 (patch) | |
tree | 5cfa349c03dac668e40bcf56e3f075d4d170727a /test | |
parent | e595d0a130df434ee006911476f087277158308e (diff) | |
download | scala-8562015759b9f99547a78886e28da79e588eaf18.tar.gz scala-8562015759b9f99547a78886e28da79e588eaf18.tar.bz2 scala-8562015759b9f99547a78886e28da79e588eaf18.zip |
Stream gets a specialized, extra-lazy Iterator ...
Stream gets a specialized, extra-lazy Iterator so it can iterate as
lazily as it traverses. Patch submitted by "Eastsun": probably not
his real name, but that's what we call him. Closes #3273, review by
prokopec.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/bug3273.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/bug3273.scala b/test/files/run/bug3273.scala new file mode 100644 index 0000000000..379a8a29c1 --- /dev/null +++ b/test/files/run/bug3273.scala @@ -0,0 +1,10 @@ +object Test { + val num1: Stream[Int] = 1 #:: num1.map(_ + 1) + val num2: Stream[Int] = 1 #:: num2.iterator.map(_ + 1).toStream + + def main(args: Array[String]): Unit = { + val x1 = (num1 take 10).toList + val x2 = (num2 take 10).toList + assert(x1 == x2) + } +} |