diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/tailcalls.check | 1 | ||||
-rw-r--r-- | test/files/run/tailcalls.scala | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/tailcalls.check b/test/files/run/tailcalls.check index e913f2a061..7670962db2 100644 --- a/test/files/run/tailcalls.check +++ b/test/files/run/tailcalls.check @@ -51,3 +51,4 @@ test TailCall.b1 was successful test TailCall.b2 was successful test FancyTailCalls.tcTryLocal was successful test FancyTailCalls.differentInstance was successful +test PolyObject.tramp was successful diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index 1340e8d532..73bc1427a3 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -194,6 +194,15 @@ object FancyTailCalls { val f2 = new FancyTailCalls } +object PolyObject extends Application { + def tramp[A](x: Int): Int = + if (x > 0) + tramp[A](x - 1) + else + 0 +} + + class FancyTailCalls { def tcTryLocal(x: Int, v: Int): Int = { @@ -370,7 +379,9 @@ object Test { val FancyTailCalls = new FancyTailCalls; check_success("FancyTailCalls.tcTryLocal", FancyTailCalls.tcTryLocal(max, max), max) check_success("FancyTailCalls.differentInstance", FancyTailCalls.differentInstance(max, 42), 42) + check_success("PolyObject.tramp", PolyObject.tramp[Int](max), 0) } + } //############################################################################ |