summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-06-26 11:11:34 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-06-26 11:11:34 -0700
commit040830d87f7f6ceb2815b9c69f0679ba6b30753d (patch)
tree2c24762b421c6c98ba1904b72404098e07d472be /test
parent07fc7bb2f718f335058ea84700778827747a6314 (diff)
parent57a644786197dd4fbf8721796ff40d744b99f1f5 (diff)
downloadscala-040830d87f7f6ceb2815b9c69f0679ba6b30753d.tar.gz
scala-040830d87f7f6ceb2815b9c69f0679ba6b30753d.tar.bz2
scala-040830d87f7f6ceb2815b9c69f0679ba6b30753d.zip
Merge pull request #2675 from soc/SI-7599
SI-7599 Modify methods to be non-tail-callable ...
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6308.scala20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/files/run/t6308.scala b/test/files/run/t6308.scala
index bcd89359b0..d23cd6e13e 100644
--- a/test/files/run/t6308.scala
+++ b/test/files/run/t6308.scala
@@ -1,21 +1,25 @@
import scala.{specialized => sp}
+// NOTE: `{ val c = caller; print(""); c }` is used instead of a simple `caller`,
+// because we want to prevent tail-call optimization from eliding the stack-
+// frames we want to inspect.
+
object Test {
def caller = new Exception().getStackTrace()(1).getMethodName
- def f1[@sp(Int) A](a: A, b: Any) = caller
- def f2[@sp(Int) A, B](a: A, b: String) = caller
- def f3[B, @sp(Int) A](a: A, b: List[B]) = caller
- def f4[B, @sp(Int) A](a: A, b: List[(A, B)]) = caller
+ def f1[@sp(Int) A](a: A, b: Any) = { val c = caller; print(""); c }
+ def f2[@sp(Int) A, B](a: A, b: String) = { val c = caller; print(""); c }
+ def f3[B, @sp(Int) A](a: A, b: List[B]) = { val c = caller; print(""); c }
+ def f4[B, @sp(Int) A](a: A, b: List[(A, B)]) = { val c = caller; print(""); c }
- def f5[@sp(Int) A, B <: Object](a: A, b: B) = caller
+ def f5[@sp(Int) A, B <: Object](a: A, b: B) = { val c = caller; print(""); c }
// `uncurryTreeType` calls a TypeMap on the call to this method and we end up with new
// type parameter symbols, which are not found in `TypeEnv.includes(typeEnv(member), env)`
// in `specSym`. (One of `uncurry`'s tasks is to expand type aliases in signatures.)
type T = Object
- def todo1[@sp(Int) A, B <: T](a: A, b: String) = caller
- def todo2[@sp(Int) A, B <: AnyRef](a: A, b: String) = caller
- def todo3[B <: List[A], @specialized(Int) A](a: A, b: B) = caller
+ def todo1[@sp(Int) A, B <: T](a: A, b: String) = { val c = caller; print(""); c }
+ def todo2[@sp(Int) A, B <: AnyRef](a: A, b: String) = { val c = caller; print(""); c }
+ def todo3[B <: List[A], @specialized(Int) A](a: A, b: B) = { val c = caller; print(""); c }
def main(args: Array[String]) {
val s = ""