Why do I need to mark a top-level `const val` as `...
# kotlin-native
r
Why do I need to mark a top-level
const val
as
@SharedImmutable
? I mean… Can it not be?
Or maybe that’s not what the error I get is talking about.
Copy code
kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
Doesn’t say which top level value
d
It's because of how Immutability works in K/N atm: https://kotlinlang.org/docs/reference/native/immutability.html