Sealed interface @Serializable support
See original GitHub issueI don’t know if it is a bug but just wanted to ask, why can I do abstract val
stuff with sealed classes but can’t do the same thing with interfaces.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Kotlin sealed interface serialization - json - Stack Overflow
Kotlin sealed interface serialization seems to be broken, unless using an explicitly registered serialization module.
Read more >SealedClassSerializer - Kotlin
This class provides support for multiplatform polymorphic serialization of sealed classes. In contrary to PolymorphicSerializer, all known subclasses with ...
Read more >Sealed Classes - Oracle Help Center
This document describes changes to the Java Language Specification to support sealed classes and interfaces, a preview feature of Java SE 15.
Read more >kotlinx.serialization
This class provides support for multiplatform polymorphic serialization for interfaces and abstract classes. class PolymorphicSerializer<T : Any> ...
Read more >Moshi Polymorphic Adapter & Sealed Classes | by Britt Barak
While I was trying to serialize and deserialize sealed classes, ... easy for me to discover the solution and an example — hope...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sealed interfaces are currently treated as regular interfaces (can’t have serializable annotation and require serializers module). In the future, yes,
@Serializable
annotation on sealed interfaces would be supportedThen the issue is actual, waiting for implementation 🙃