summaryrefslogtreecommitdiff
path: root/test/files/run/streamWithFilter.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2010-04-13 22:51:04 +0000
committerIulian Dragos <jaguarul@gmail.com>2010-04-13 22:51:04 +0000
commitd95eb2a8f979b9f9db98a0e097ef3793674e57ab (patch)
tree6e11ba6e02cdd30c53861d42e6e52d5ce34b8d95 /test/files/run/streamWithFilter.scala
parentc272bbfb64b1d0522e09daa0981a4942f63607a4 (diff)
downloadscala-d95eb2a8f979b9f9db98a0e097ef3793674e57ab.tar.gz
scala-d95eb2a8f979b9f9db98a0e097ef3793674e57ab.tar.bz2
scala-d95eb2a8f979b9f9db98a0e097ef3793674e57ab.zip
Made the icode reader more resilient to errors.
symbol does not cause any crashes, but the method using an unknown symbol will not be used for inlining. Resurrected tests, removed spec-matrix for the moment. No review.
Diffstat (limited to 'test/files/run/streamWithFilter.scala')
-rw-r--r--test/files/run/streamWithFilter.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/streamWithFilter.scala b/test/files/run/streamWithFilter.scala
new file mode 100644
index 0000000000..cb919d4f55
--- /dev/null
+++ b/test/files/run/streamWithFilter.scala
@@ -0,0 +1,11 @@
+object Test {
+ val nums = Stream.from(1)
+ def isFizz(x: Int) = x % 3 == 0
+ def isBuzz(x: Int) = x % 5 == 0
+ // next line will run forever if withFilter isn't doing its thing.
+ val fizzbuzzes = for (n <- nums ; if isFizz(n) ; if isBuzz(n)) yield n
+
+ def main(args: Array[String]): Unit = {
+ fizzbuzzes take 5 foreach println
+ }
+}