class A(x: => A) { lazy val a = x} object Main extends App { def a: A = new A(b) def b: A = new A(a) println(a) println(b)}
Standard input is empty
A@1da77f5 A@5d484a
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!