Paul Woitaschek
11/15/2023, 12:58 PMJoshua Hansen
11/15/2023, 6:45 PM@Serializable
sealed interface Person {
val name: String
}
data class PersonWithAge(
override val name: String,
val age: Int,
) : Person
A compiler error here wouldn't really be appropriate, since the above code represents a case where you specifically don't want a particular subclass to be serializable.
Perhaps a warning would be more appropriate, forcing the developer to explicity annotate their intention to have this subclass remain unserializable in order to suppress the warning.Paul Woitaschek
11/15/2023, 6:46 PM