Skip to content

Add @JvmStatic to generated serializer() in Companion #3185

Description

@cdprete

What is your use-case and why do you need this feature?

The serializer() method that gets added/generated in a companion object of a class is not marked with @JvmStatic.
While it works with no issues in Kotlin, in Java its UX is very unpleasant since we've to do MyType.Companion.serializer() all the time.

Describe the solution you'd like

Mark the generated method with @JvmStatic so that MyType.serializer() is enough also when the library is used in a Java project.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions