From 79e937bea265675c73bca753ba74dc1a829b8737 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 11 Mar 2012 10:50:57 -0400 Subject: Fix for tailcall transform/recognition bugs. Closes SI-3275, SI-5455. --- test/files/neg/t5455.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/neg/t5455.scala (limited to 'test/files/neg/t5455.scala') 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() +} -- cgit v1.2.3