From <https://kotlinlang.org/api/latest/jvm/stdlib...
# kotlin-native
s
From https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-atomic-reference/value.html
The referenced value. Gets the value or sets the new value. If new value is not null, it must be frozen or permanent object.
What is a permanent object? I have not seen that language used elsewhere before
k
I suspect it's an object declared with the
object
keyword, but not certain
s
Ah, that would make sense
May also refer to literal values?
Copy code
val a = false

AtomicReference(a) // throws InvalidMutabilityException

AtomicReference(false) // does not throw exception
Regardless it would be nice to get some clarification from JB on this.
o
Permanent object is compile-time instantiated object, String literals, some boxed integers and few other objects, such as stateless singletons fall into this category.
👍 1