What kind of inheritance is this? I see it in Compose docs, but can't find its usage on Kotlin docs. Can a subclass (object) be defined inside the parent class?
👌 1
Mehdi Haghgoo
03/23/2021, 12:29 PM
Copy code
sealed class Screen(val route: String, @StringRes val resourceId: Int) {
  object Profile : Screen("profile", R.string.profile)
  object FriendsList : Screen("friendslist", R.string.friends_list)
}
m
Marc Knaup
03/23/2021, 1:16 PM
It’s normal inheritance.
The only difference is that you can be sure that