diff options
Diffstat (limited to 'test/files/neg/t1672b.scala')
-rw-r--r-- | test/files/neg/t1672b.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/neg/t1672b.scala b/test/files/neg/t1672b.scala index 7d02ddc710..0ccdd03633 100644 --- a/test/files/neg/t1672b.scala +++ b/test/files/neg/t1672b.scala @@ -38,4 +38,15 @@ object Test { ??? } } + + // the `liftedTree` local method will prevent a tail call here. + @annotation.tailrec + def bar(i : Int) : Int = { + if (i == 0) 0 + else 1 + (try { + throw new RuntimeException + } catch { + case _: Throwable => bar(i - 1) + }) + } } |