Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@UseSerializers doesn't distinguish between nullable and non-nullable property when choosing KSerializer #984

Closed
edenman opened this issue Aug 17, 2020 · 1 comment · Fixed by JetBrains/kotlin#3906

Comments

@edenman
Copy link
Contributor

edenman commented Aug 17, 2020

Describe the bug
If you have a nullable serializer for a type and a non-nullable serializer for a type and you want to register both of them with @UseSerializers, the nullable one is not chosen for nullable properties.

To Reproduce
master...edenman:nullable-and-nonnullable-serializer

Expected behavior
Choose the correct serializer, either by checking the SerialDescriptor or introspecting the type argument on the KSerializer class.

Environment

  • Kotlin version: 1.4.0
  • Library version: 1.0.0-RC
  • Kotlin platforms: common (tested on jvm)
  • Gradle version: 6.3
@qwwdfsad qwwdfsad assigned qwwdfsad and sandwwraith and unassigned qwwdfsad Aug 24, 2020
shanshin added a commit that referenced this issue Nov 11, 2020
shanshin added a commit that referenced this issue Nov 25, 2020
shanshin added a commit that referenced this issue Dec 23, 2020
@edenman
Copy link
Contributor Author

edenman commented Jan 31, 2021

Forgot to say: thanks for fixing this @shanshin! Was able to clean up a whole bunch of code :)

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

Successfully merging a pull request may close this issue.

3 participants