blob: 6e54335787d5dfca19bb34803c694c2a8145f4d0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()
}
|