Hey guys, I was going through the compose compiler...
# compose
r
Hey guys, I was going through the compose compiler metrics of my project found an issue. I have a very simple data class which looks like this
Copy code
@Stable
data class RemindersScreenState(
    val reminders: ImmutableList<Reminder> = persistentListOf(),
    val isLoading: Boolean = false,
    val infoMessage: String? = null
)
Here is the output from Compose Compiler Metrics
Copy code
stable class RemindersScreenState {
  runtime val reminders: ImmutableList<Reminder>
  stable val isLoading: Boolean
  stable val infoMessage: String?
}
The Compose compiler cannot infer that variable
reminders
is stable even though I have used
ImmutableList
and the
Reminder
class is considered stable. Does
runtime val
means that the stability will be inferred at runtime?
Copy code
stable class Reminder {
  stable val agencyLaunchAttemptCount: Int?
  stable val agencyLaunchAttemptCountYear: Int?
  stable val failreason: String?
  stable val holdreason: String?
  stable val id: String
  stable val image: String?
  stable val infographic: String?
  stable val lastUpdated: String?
  stable val launchServiceProvider: LaunchServiceProvider?
  stable val locationLaunchAttemptCount: Int?
  stable val locationLaunchAttemptCountYear: Int?
  stable val mission: Mission?
  stable val name: String?
  stable val net: String
  stable val netPrecision: NetPrecision?
  stable val orbitalLaunchAttemptCount: Int?
  stable val orbitalLaunchAttemptCountYear: Int?
  stable val pad: Pad?
  stable val padLaunchAttemptCount: Int?
  stable val padLaunchAttemptCountYear: Int?
  stable val probability: String?
  stable val rocket: Rocket?
  stable val slug: String?
  stable val status: Status?
  stable val url: String?
  stable val webcastLive: Boolean?
  stable val windowEnd: String?
  stable val windowStart: String?
  <runtime stability> = Stable
}
I found this issue but it's mentioned that it is resolved in the newer versions but I'm using Compose Compiler v1.5.0 which was released way after when this issue was said to be resolved.
🧵 2