1Password / typeshare

Typeshare is the ultimate tool for synchronizing your type definitions between Rust and other languages for seamless FFI.
Apache License 2.0
2.37k stars 95 forks source link

Kotlin deserialization name clash with enum variants and structs #91

Open LuminaSapphira opened 1 year ago

LuminaSapphira commented 1 year ago

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.

snowsignal commented 1 year ago

This might be a duplicate of #48.