From 31a0aa75cf9739b2ae565d634670f6c0ce89bbc1 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 5 Dec 2012 14:16:27 +0100 Subject: SI-1672 Catches are in tail position without finally. So we can eliminate tail calls within. --- test/files/neg/t1672b.scala | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/files/neg/t1672b.scala (limited to 'test/files/neg/t1672b.scala') diff --git a/test/files/neg/t1672b.scala b/test/files/neg/t1672b.scala new file mode 100644 index 0000000000..7d02ddc710 --- /dev/null +++ b/test/files/neg/t1672b.scala @@ -0,0 +1,41 @@ +object Test { + @annotation.tailrec + def bar : Nothing = { + try { + throw new RuntimeException + } catch { + case _: Throwable => bar + } finally { + bar + } + } + + @annotation.tailrec + def baz : Nothing = { + try { + throw new RuntimeException + } catch { + case _: Throwable => baz + } finally { + ??? + } + } + + @annotation.tailrec + def boz : Nothing = { + try { + throw new RuntimeException + } catch { + case _: Throwable => boz; ??? + } + } + + @annotation.tailrec + def bez : Nothing = { + try { + bez + } finally { + ??? + } + } +} -- cgit v1.2.3