diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-04-13 22:51:04 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-04-13 22:51:04 +0000 |
commit | d95eb2a8f979b9f9db98a0e097ef3793674e57ab (patch) | |
tree | 6e11ba6e02cdd30c53861d42e6e52d5ce34b8d95 /test/files/run/infiniteloop.scala | |
parent | c272bbfb64b1d0522e09daa0981a4942f63607a4 (diff) | |
download | scala-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/infiniteloop.scala')
-rw-r--r-- | test/files/run/infiniteloop.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/infiniteloop.scala b/test/files/run/infiniteloop.scala new file mode 100644 index 0000000000..f15674a676 --- /dev/null +++ b/test/files/run/infiniteloop.scala @@ -0,0 +1,13 @@ +/** Tests the optimiser (not to loop on 'reverse'). */ + +object Test extends Application { + def foo { + val s3 = Stream.range(1, 1000) //100000 (ticket #153: Stackoverflow) + + // ticket #153 + def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None + println(s3.flatMap(powers).reverse) + } + + foo +} |