kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

serializer function requires useless parameters for abstract and sealed classes

Open shanshin opened this issue 4 years ago • 1 comments

Describe the bug serializer function expects generic type serializer but not use it inside

To Reproduce

    @Serializable
    abstract class TypedAbstractClass<T>

and when trying to get the serializer its need to specify one argument TypedAbstractClass.serializer(SomeClass.serializer)

Same for sealed class.

Expected behavior serializer function without parameters

Environment

  • Kotlin version: 1.4.30-M1
  • Library version: 1.0.1
  • Kotlin platforms: all

shanshin avatar Dec 23 '20 18:12 shanshin

Related: #1531

sandwwraith avatar Dec 16 '24 18:12 sandwwraith