? Will this property transfer to the wrapped class and be understood accordingly by the Compose runtime later on?
j
jim
07/13/2021, 5:22 PM
I could be mistaken, but I think we already/automatically treat value classes as immutable. Maybe only if the underlying value type is immutable though.
While it is strongly desirable for `@Immutable`objects to only reference other `@Immutable`classes, there is no such restriction currently enforced, so the property will not be applied transitively.
d
dimsuz
07/13/2021, 5:40 PM
yeah, I mean that if I know that my collection will be treated as immutable here, could I go from this
Copy code
@Immutable
data class UserList(val users: Map<UserId, User>)
to this
Copy code
@Immutable
value class UserList(val users: Map<UserId, User>)
?
(or substitute Map for any effectively immutable custom