From e63feffe063987df54cb9a5916003eb400c0b49d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 17 Nov 2014 17:08:26 +0100 Subject: Moved pending tests that work into pos and neg. One test (t2613) required lifting a hard recursion limit in findMember (used for debug only, will be removed in the future). The same test also requires -Yno-deep-subtypes to be reset, so it's in pos_special instead of pos. --- tests/pos/tailcall/t1672.scala | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/pos/tailcall/t1672.scala (limited to 'tests/pos/tailcall') diff --git a/tests/pos/tailcall/t1672.scala b/tests/pos/tailcall/t1672.scala new file mode 100644 index 000000000..77a86db22 --- /dev/null +++ b/tests/pos/tailcall/t1672.scala @@ -0,0 +1,36 @@ +// moved to pending. +/* Tail calls translates this program to: + +final lazy object Test1672: Test1672$ = new Test1672$() + final class Test1672$() extends Object() { this: Test1672$.type => + @tailrec def bar: (x: Int)(y: Int)Nothing = { + def tailLabel2: ($this: Test1672$.type)(x: Int)(y: Int)Nothing = { + try { + throw new scala.package.RuntimeException() + } catch { + def $anonfun: (x$1: Throwable)Nothing = + x$1 match { + case _: scala.package.Throwable => + tailLabel2($this)(x)(y) + } + closure($anonfun) + } + } + tailLabel2(Test1672$.this)(x)(y) + } + } + +Note the tail call to taillabel2 from the local method $anonfun. +LambdaLift doe snot know how to deal wioth this. +*/ + +object Test1672 { + @annotation.tailrec + def bar(x: Int)(y: Int) : Nothing = { + try { + throw new RuntimeException + } catch { + case _: Throwable => bar(x)(y) + } + } +} -- cgit v1.2.3