myanmarking
09/14/2021, 5:16 PMval
is considered stable by the compiler then ?CLOVIS
09/14/2021, 5:47 PM@Stable
CLOVIS
09/14/2021, 5:49 PM@Stable // safe
data class A(
val a: Set<String>
)
@Stable // Dangerous! Do not do this
data class B(
val a: MutableSet<String>
)
etcmyanmarking
09/14/2021, 6:48 PMmyanmarking
09/14/2021, 6:49 PMdata class A(val a: Int)
. does this need the annotation ?hfhbd
09/14/2021, 6:54 PMCLOVIS
09/14/2021, 9:58 PMAlbert Chang
09/15/2021, 12:15 AMMichael Paus
09/15/2021, 8:34 AMAlbert Chang
09/15/2021, 8:37 AMMichael Paus
09/15/2021, 8:42 AMAlbert Chang
09/15/2021, 8:45 AMMichael Paus
09/15/2021, 9:11 AMAlbert Chang
09/15/2021, 9:14 AMCLOVIS
09/15/2021, 11:36 AMMichael Paus
09/15/2021, 11:39 AMdimsuz
09/16/2021, 12:39 AM@Immutable
from compose.runtime
artifact and having them in something like compose.annotation
dimsuz
09/16/2021, 12:42 AMIn that case you have to create wrappers in your current moduleI wonder will wrapping in an annotated value class count? E.g.
@Immutable
value class Wrapped(val value: MyTypeFromNonComposeModule)
data class ReadOnlyState(val value: Wrapped)
// ^^^ inferred as immutable?
Albert Chang
09/16/2021, 12:45 AMAlbert Chang
09/16/2021, 12:45 AMdimsuz
09/16/2021, 12:49 AMvalue
classes are treated differently, because... well.. they are removed in bytecode or at some stage of compilation where compose plugin may not see this annotation (speculating here)Albert Chang
09/16/2021, 12:51 AM