Not sure if it is useful to post here, but I think...
# compiler
d
b
I can't speak definitively to the issue, as the JVM backend team should take a look, but it looks like a duplicate of this issue: https://youtrack.jetbrains.com/issue/KT-67222/Kotlin-object-is-null-incorrect-static-initialization. It looks like a cyclic initialization issue. To access the
MySealedClass.One
singleton, the outer class needs to be loaded as well, which triggers the initialization of
TEST_LIST
, which causes a cycle. Based on the information in the other ticket, I suspect your list actually contains a
null
value as the first element, which doesn't match any of the
when
branches.
d
Thanks for the link to that issue, it does look like the same thing.
And the first item in the array is
null
, as you suspected.