-
Notifications
You must be signed in to change notification settings - Fork 624
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
polymorphicDefault is never invoked #1585
Comments
kotlinx.serialization/core/commonMain/src/kotlinx/serialization/modules/SerializersModule.kt Line 184 in d489d96
and kotlinx.serialization/core/commonMain/src/kotlinx/serialization/modules/SerializersModule.kt Lines 140 to 151 in d489d96
It is mainly designed to support handling unknown inputs from a network, not to circumvent the module system. |
Yep, it's only invoked on deserialization, but it seems there are several use-cases where it may be useful on serialization too (see similar #1317) |
This is inconsistent and assymmetric. Should work the same in both directions |
Describe the bug
A serializer lookup lambda registered via
polymorphicDefault
in a module is never used.To Reproduce
Expected behavior
I expect
polymorphicDefault
to be invoked in this case with serial namekotlin.Float
.So it should print the following instead of a crash:
Environment
The text was updated successfully, but these errors were encountered: