How to check stability of a class inferred by Compose compiler?

Viewed 369

There are @Immutable and @Stable annotations available for developers to mark their classes with. But I'm not quite sure when you need to annotate your classes and when it is inferred automatically. E.g. deeply-immutable data classes seems to be recognized as immutable by default. But you cannot be quite sure unless you log all @Composable calls and see how it behaves. And not knowing what is actually going on is somewhat infuriating for me as a programmer.

I wonder if there are more reasonable ways to see what immutability/stability Compose compiler infers for custom classes?

And if there are no clever ways to check it, what would be the rule of thumb for using @Immutable and @Stable annotations?

1 Answers
Related