diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-11-26 18:58:03 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-11-26 18:58:03 +0000 |
commit | b31dcbdcf503b96536ed4b538d5a3eb14431f785 (patch) | |
tree | a45e7e61e6d898c386c6b8e9fef111f539868522 /test | |
parent | ed4693400b490334a90490d3557198cb10e3d923 (diff) | |
download | scala-b31dcbdcf503b96536ed4b538d5a3eb14431f785.tar.gz scala-b31dcbdcf503b96536ed4b538d5a3eb14431f785.tar.bz2 scala-b31dcbdcf503b96536ed4b538d5a3eb14431f785.zip |
Fixed 1541.
Diffstat (limited to 'test')
-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) } + } //############################################################################ |