summaryrefslogtreecommitdiff
path: root/test/files/neg/t5455.scala
diff options
context:
space:
mode:
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()
+}