blob: 22d6c442c90b732a86e687de3ecf2904b88a697a (
plain) (
tree)
|
|
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()
}
|