diff options
author | Paul Phillips <paulp@improving.org> | 2009-03-16 17:46:58 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-03-16 17:46:58 +0000 |
commit | 67c3c68da5de6284c5e37ef4b5f907d0079f0490 (patch) | |
tree | 0db5a40f781f2f9edb21fd4c20ce6608c8a5c147 /test/files/neg/tailrec.check | |
parent | 00d196adeeb3aa88f2afedcb5d7eb51f0fc19896 (diff) | |
download | scala-67c3c68da5de6284c5e37ef4b5f907d0079f0490.tar.gz scala-67c3c68da5de6284c5e37ef4b5f907d0079f0490.tar.bz2 scala-67c3c68da5de6284c5e37ef4b5f907d0079f0490.zip |
The birth of the @switch and @tailrec annotations.
They are located in package scala.annotation. Also in this patch:
* numerous test cases for both annotations
* addition of @tailrec and @switch in a few strategic locations
* fixes for critical section NewScanners methods which were not being
compiled into switches, immediately proving the value of @switch
* tail recursive implementations for Iterator.{ dropWhile, drop}
and List.dropWhile tagged with @tailrec, closing bug #1376
Diffstat (limited to 'test/files/neg/tailrec.check')
-rw-r--r-- | test/files/neg/tailrec.check | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/tailrec.check b/test/files/neg/tailrec.check new file mode 100644 index 0000000000..22d70e82a0 --- /dev/null +++ b/test/files/neg/tailrec.check @@ -0,0 +1,10 @@ +tailrec.scala:6: error: could not optimize @tailrec annotated method + def facfail(n: Int): Int = + ^ +tailrec.scala:42: error: could not optimize @tailrec annotated method + @tailrec def fail1(x: Int): Int = fail1(x) + ^ +tailrec.scala:45: error: could not optimize @tailrec annotated method + @tailrec def fail2[T](xs: List[T]): List[T] = xs match { + ^ +three errors found |