Closed
Description
Compiler version
3.0.0-M3-bin-20201216-c8fb1fa-NIGHTLY-git-c8fb1fa
Minimized code
object A { val x: String = B.y }
object B { val y: String = A.x }
Output
Compiled with both -Yexplicit-nulls
and -Ysafe-init
, both fields are null
:
A.x == null
B.y == null
Expectation
I expected this not to compile. I'm not sure if detecting such cycles is in scope for -Ycheck-init
, but the documentation for explicit nulls suggests that -Ycheck-init
catches the unsoundness caused by null
in initialization.