After having some recomposition problems with a List I started to look into the Compose Compiler reports and even though I have changed every single list to ImmutableList the reporting still gives me a weird result. A
Post
is (in theory) stable but a ImmutableList of Post is not... Am I missing something?
stable class Post {
stable val id: String
stable val title: String
stable val subtitle: String
stable val description: String
stable val tags: ImmutableList<String>
stable val imageUrl: String
stable val type: PostType
<runtime stability> =
}
the strange thing is the empty “<runtime stability>”
then I wrap this into a sealed with 3 states (this is for extra context but not directly related)
stable class Content {
stable val showError: Boolean
stable val tags: ImmutableList<Tag>
unstable val posts: ImmutableList<Post> <------- ?¿?¿?¿
}
the Compose result is:
restartable scheme("[androidx.compose.ui.UiComposable, [_]]") fun DiscoverList(
stable scrollState: LazyGridState
unstable items: ImmutableList<Post> <-------- ?¿?¿
stable onItemViewed: Function2<Post, Int, Unit>
stable onItemClicked: Function2<Post, Int, Unit>
stable header: Function2<Composer, Int, Unit>
)
Post is a simple data class… is it because it has a List of Strings?