Ink
09/21/2022, 9:54 AMdata
is a Request sealed class
and inside that class there 3 classes Opened, Success, NotSigned
How I can cast data
to have access to data.openedFrom
value? I want to avoid invoking 3 times navigate()
functionMorgane Soula
09/21/2022, 10:06 AMMorgane Soula
09/21/2022, 10:07 AMMorgane Soula
09/21/2022, 10:07 AMMorgane Soula
09/21/2022, 10:11 AMJuliane Lehmann
09/21/2022, 10:17 AMRequest
? Because it seems to me that well, if all the subtypes have a common openedFrom
property, then that should also be reflected in their supertype. Something like
sealed class Request {
abstract val openedFrom: Instant
data class Opened(override val openedFrom: Instant, foo: Int, bar: String) : Request()
data class Success(override val openendFrom: Instant, baz: Long) : Request()
...
}