aboutsummaryrefslogtreecommitdiff
path: root/tests/run/iterator-iterate-lazy.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/iterator-iterate-lazy.scala')
-rw-r--r--tests/run/iterator-iterate-lazy.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/run/iterator-iterate-lazy.scala b/tests/run/iterator-iterate-lazy.scala
new file mode 100644
index 000000000..92b170062
--- /dev/null
+++ b/tests/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
+ }
+}