Hi everyone, just started migrating my library and...
# serialization
z
Hi everyone, just started migrating my library and I have a couple questions. First, how do I set an implementation for a serializable class that has a member which is an interface?
Copy code
// How do I specify a concrete type for SomeInterface?
@Serializable
data class MyClass(val member: SomeInterface)
Second, how do I serialize object singletons? It’s an issue for when they’re used in sealed classes along side data classes.
Copy code
sealed class MySealedClass {
    data class TypeOne(val member: String) : MySealedClass()
    
    // How do I serialize this?
    object TypeTwo : MySealedClass()
}
🤔 1