miqbaldc
09/10/2019, 3:31 AM// BaseResponse.kt
@Serializable
open class BaseResponse(val createdAt: String?, val updatedAt: String?)
// MovieResponse.kt
@Serializable
data class MovieResponse(val description: String, val title: String) : BaseResponse()
Does inheritance currently unsupported? I've tried the above code with no succeed
After awhile researching
// BaseResponse.kt
@Serializable
sealed class BaseResponse(val createdAt: String?, val updatedAt: String?) {
@Serializable
data class MovieResponse(val description: String, val title: String)
}
This is the recommended ways to use inheritance with sealed class instead.