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