blob: 6e54335787d5dfca19bb34803c694c2a8145f4d0 (
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()
}
|