summaryrefslogtreecommitdiff
path: root/test/files/run/iterator-iterate-lazy.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/iterator-iterate-lazy.scala')
-rw-r--r--test/files/run/iterator-iterate-lazy.scala5
1 files changed, 5 insertions, 0 deletions
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
+ }
+}