summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-15 12:08:42 -0800
committerPaul Phillips <paulp@improving.org>2013-01-15 12:08:42 -0800
commit6f3ea77870ab5e17805ef0fc338c251e87870b8c (patch)
treedee9b5a1cd15f1f6d346b36551f9dff47a6e0c68 /test/files/pos
parent621f7a56c21686ebbd39b8ffe9282f917fe1f128 (diff)
parent9cc61f310ef5f80e598956bee20156b7bc472e84 (diff)
downloadscala-6f3ea77870ab5e17805ef0fc338c251e87870b8c.tar.gz
scala-6f3ea77870ab5e17805ef0fc338c251e87870b8c.tar.bz2
scala-6f3ea77870ab5e17805ef0fc338c251e87870b8c.zip
Merge pull request #1892 from retronym/ticket/6479
SI-6479 Don't lift try exprs in label arguments.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t6479.scala56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/files/pos/t6479.scala b/test/files/pos/t6479.scala
new file mode 100644
index 0000000000..c463bc5ab0
--- /dev/null
+++ b/test/files/pos/t6479.scala
@@ -0,0 +1,56 @@
+object TailrecAfterTryCatch {
+
+ @annotation.tailrec
+ final def good1() {
+ 1 match {
+ case 2 => {
+ try {
+ // return
+ } catch {
+ case e: ClassNotFoundException =>
+ }
+ good1()
+ }
+ }
+ }
+
+ @annotation.tailrec
+ final def good2() {
+ //1 match {
+ // case 2 => {
+ try {
+ return
+ } catch {
+ case e: ClassNotFoundException =>
+ }
+ good2()
+ // }
+ //}
+ }
+
+ @annotation.tailrec
+ final def good3() {
+ val 1 = 2
+ try {
+ return
+ } catch {
+ case e: ClassNotFoundException =>
+ }
+ good3()
+ }
+
+ @annotation.tailrec
+ final def bad() {
+ 1 match {
+ case 2 => {
+ try {
+ return
+ } catch {
+ case e: ClassNotFoundException =>
+ }
+ bad()
+ }
+ }
+ }
+
+} \ No newline at end of file