where type in second screenshot is cast as AddEditCatDateEvent
Morgane Soula
09/21/2022, 10:11 AM
Also if your Request class has no parameter, you should consider using a sealed interface instead.
j
Juliane Lehmann
09/21/2022, 10:17 AM
Can you modify the definition of
Request
? 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
Copy code
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()
...
}