summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-12-10 12:19:43 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-12-10 12:19:43 -0800
commit84eff4d144e1523f1a51ffca77eb983a29eccd72 (patch)
tree09f26a6add77fa574a53c95b6814e62fd8a6bbc7 /test/files/run
parent6f121da8902ea0b7a778f1ae1e690490330ba2ca (diff)
parent8434922d6f0ead95a2109a5e41f4db4136449e93 (diff)
downloadscala-84eff4d144e1523f1a51ffca77eb983a29eccd72.tar.gz
scala-84eff4d144e1523f1a51ffca77eb983a29eccd72.tar.bz2
scala-84eff4d144e1523f1a51ffca77eb983a29eccd72.zip
Merge pull request #1711 from retronym/ticket/1672
SI-1672 Catches are in tail position without finally.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t1672.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/run/t1672.scala b/test/files/run/t1672.scala
new file mode 100644
index 0000000000..ee025b9031
--- /dev/null
+++ b/test/files/run/t1672.scala
@@ -0,0 +1,28 @@
+object Test {
+ @annotation.tailrec
+ def bar(i : Int) : Int = {
+ if (i == 0) 0
+ else try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar(i - 1)
+ }
+ }
+
+ @annotation.tailrec
+ def nestedTry1(i : Int) : Int = {
+ if (i == 0) 0
+ else try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable =>
+ try { ??? } catch { case _: Throwable => nestedTry1(i - 1) }
+ }
+ }
+
+ def main(args: Array[String]) {
+ assert(bar(2) == 0)
+
+ assert(nestedTry1(2) == 0)
+ }
+}