Oleksandr Balan
06/26/2025, 2:39 PMsealed interface
as stable, even if all of its implementations are inferred as stable? 🧵Oleksandr Balan
06/26/2025, 2:40 PMsealed interface StringModel {
data class Res(@StringRes val resId: Int): StringModel
data class Str(val value: String): StringModel
}
Both StringModel.Res
and StringModel.Str
are stable, but when StringModel
is used in some class it is marked as <runtime stability> = Uncertain(StringModel)
However when I change it to the `sealed class`:
sealed class StringModel {
data class Res(@StringRes val resId: Int): StringModel()
data class Str(val value: String): StringModel()
}
Everything is stable as expected 🤔