Closed
Description
When running the following code with -Ycheck-init
, no warning or error is emitted:
class Foo(val opposite: Foo)
case object A extends Foo(B)
case object B extends Foo(A)
object Test {
def main(args: Array[String]): Unit = {
println(A.opposite)
println(B.opposite)
}
}
But A ends being used when it's uninitialized:
B
null
I'm not sure if this is a bug or outside the scope of safe initialization?