From 45e3ff972c7562bca5634aa7fe80d9e4c8f5a89d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 28 Apr 2010 20:30:48 +0000 Subject: Fixed bug in Iterator.iterate which would lead ... Fixed bug in Iterator.iterate which would lead to a runtime exception under some circumstances due to inadequate laziness in calculating the next element. No review. --- test/files/run/iterator-iterate-lazy.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/files/run/iterator-iterate-lazy.scala (limited to 'test') diff --git a/test/files/run/iterator-iterate-lazy.scala b/test/files/run/iterator-iterate-lazy.scala new file mode 100644 index 0000000000..73886f192b --- /dev/null +++ b/test/files/run/iterator-iterate-lazy.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + Iterator.iterate(1 to 5 toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList + } +} -- cgit v1.2.3