summaryrefslogtreecommitdiff
path: root/test/files/neg/t5455.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-11 10:50:57 -0400
committerPaul Phillips <paulp@improving.org>2012-03-11 13:23:30 -0400
commit79e937bea265675c73bca753ba74dc1a829b8737 (patch)
tree083a4256daec69d3b874afa47939a295ad854188 /test/files/neg/t5455.scala
parentf1c39dd9816fd48663064307c39e2d9c8c936cd5 (diff)
downloadscala-79e937bea265675c73bca753ba74dc1a829b8737.tar.gz
scala-79e937bea265675c73bca753ba74dc1a829b8737.tar.bz2
scala-79e937bea265675c73bca753ba74dc1a829b8737.zip
Fix for tailcall transform/recognition bugs.
Closes SI-3275, SI-5455.
Diffstat (limited to 'test/files/neg/t5455.scala')
-rw-r--r--test/files/neg/t5455.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/neg/t5455.scala b/test/files/neg/t5455.scala
new file mode 100644
index 0000000000..22d6c442c9
--- /dev/null
+++ b/test/files/neg/t5455.scala
@@ -0,0 +1,16 @@
+trait Test {
+ def root: Test
+
+ @annotation.tailrec final lazy val bar: Thing[Int] = {
+ if (this eq root)
+ Thing(() => System.identityHashCode(bar))
+ else
+ root.bar
+ }
+
+ def f = bar.f()
+}
+
+case class Thing[A](f: () => A) {
+ override def toString = "" + f()
+}