Can someone gie me a hint what is missing: ```val ...
# android
l
Can someone gie me a hint what is missing:
Copy code
val router: Router<Route> = rememberSaveable {
	Router(Route.Status).apply { isSingleTop = true } // using apply does not work here
}
As far as I set
apply
, android studio complains:
Required: Router<Dashboard.Route>
Found: Router<Dashboard.Route.Status>
Route
is a sealed class, signature of
Router
is:
Copy code
class Router<T : Any>(private val backStack: List<T>) : RouterActions<T>
j
Can you post the sealed class?
l
Sure.
Copy code
sealed class Route(val label: String, val icon: ImageVector) {
        object Status : Route("Information", <http://Icons.Filled.Info|Icons.Filled.Info>)
        object Configuration : Route("Configuration", Icons.Filled.LocalShipping)
    }
j
if you indicate in Router the type it still fails?
l
Ah nice this works
Copy code
Router<Route>(Route.Status).apply { isSingleTop = true }
Thanks Javier
j
Not sure if you should create a ticket in YouTrack, maybe the type inference can be improved here
l
Gooid point