typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Kotlin deserialization name clash with enum variants and structs

Open LuminaSapphira opened this issue 1 year ago • 1 comments

We keep running into situations where an enum variant in Rust is named the same as a struct. When these get run through typeshare, they both get translated into data class types in Kotlin. An enum variant becomes a data class variant of a sealed class, while a struct becomes a data class. As both are data classes, they both occupy the same namespace and make it impossible for the deserializer to disambiguate them.

This relates to the Kotlinx deserializer but we may be able to provide some relief from our end as well. More investigation needed.

LuminaSapphira avatar Apr 07 '23 20:04 LuminaSapphira

This might be a duplicate of #48.

snowsignal avatar Apr 09 '23 06:04 snowsignal