summaryrefslogtreecommitdiff
path: root/test/files/run/streams.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-10-05 16:48:02 +0000
committermichelou <michelou@epfl.ch>2007-10-05 16:48:02 +0000
commit41865ed00183a049d6fbaebc97897eebd2956d68 (patch)
tree4d88344154774c1a95046f8f22771d6f7a5f0e72 /test/files/run/streams.scala
parent6761dc14b707667b453455aa6cecb0c82babeed3 (diff)
downloadscala-41865ed00183a049d6fbaebc97897eebd2956d68.tar.gz
scala-41865ed00183a049d6fbaebc97897eebd2956d68.tar.bz2
scala-41865ed00183a049d6fbaebc97897eebd2956d68.zip
fixed ticket #153
Diffstat (limited to 'test/files/run/streams.scala')
-rw-r--r--test/files/run/streams.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/run/streams.scala b/test/files/run/streams.scala
index cd1185344b..408affe306 100644
--- a/test/files/run/streams.scala
+++ b/test/files/run/streams.scala
@@ -21,4 +21,9 @@ object Test extends Application {
println(s2.drop(-1))
println(s2.dropWhile(_ > 0))
println
+
+ // ticket #153
+ def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None
+ val s3 = Stream.range(1, 100000)
+ println(s3.flatMap(powers).reverse.head)
}