A class extending its inner class throws a NullPointerException

I don’t see how it matters here that top-level statements are involved in the originally posted code

I simply didn’t want to get into the details. Top-level statement are converted to an object, like the one you presented above, so it’s expected that is still fails (it also gives the same warnings under -Ysafe-init-global).
I believe it would be very beneficial from the users perspective that stuff like -Ysafe-init-global would be enabled by default in Scala 3 once they’re stable.

5 Likes