question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sealed interface @Serializable support

See original GitHub issue

I 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. image image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
sandwwraithcommented, Jul 2, 2021

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 supported

1reaction
y9san9commented, Jul 5, 2021

Then the issue is actual, waiting for implementation 🙃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found