Zoltan Demant
03/10/2023, 3:47 PM@Stable
in compose when they are primitives? Arent they marked as stable by default already?
@Stable
fun Color.toArgb(): Int {
return (convert(ColorSpaces.Srgb).value shr 32).toInt()
}
@Stable
is explicitly declared everywhere in the Compose public interface, for documentation and ABI stability purposes. if you're not exporting a stable binary interface, that doesn't matter to you, but it does matter to the Compose libraries themselvesZoltan Demant
03/10/2023, 3:55 PMAlbert Chang
03/11/2023, 8:04 AM@Stable
annotation on a function has a different meaning and it is documented:
When applied to a function or a property, theannotation indicates that the function will return the same result if the same parameters are passed in. This is only meaningful if the parameters and results are themselvesStable
,Stable
, or primitive.Immutable