-
Notifications
You must be signed in to change notification settings - Fork 635
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
Shows "java.lang.IllegalAccessError: failed to access class ..." in KMP JVM target, when inheriting custom KSerializer #2495
Comments
I've had a look at the bytecode (btw. the second version fails too on my system). The problem is the way the plugin references the serializer. In
This however uses the private type |
Please also consider the JPMS boundaray🥰 #2429 |
@pdvrieze, thanks for the research! For such cases, we can rewrite the getting of the serializer using a companion (if the serializable class has a companion), for the rest of the cases, leave it as it is. |
When a custom serializer is specified on a type and this type is used in a property of another serializable class, then on the JVM this leads to an error accessing the custom serializer class - because it is private and located in another package. Fixes Kotlin/kotlinx.serialization#2495
When a custom serializer is specified on a type and this type is used in a property of another serializable class, then on the JVM this leads to an error accessing the custom serializer class - because it is private and located in another package. Fixes Kotlin/kotlinx.serialization#2495
When a custom serializer is specified on a type and this type is used in a property of another serializable class, then on the JVM this leads to an error accessing the custom serializer class - because it is private and located in another package. Fixes Kotlin/kotlinx.serialization#2495
Describe the bug
I implemented a general abstract KSerializer class, which converted the class into the Map, which caused the following error.
The MultiplierSerializer cannot be private after being inherited from MapifySerializer.
To Reproduce
See here, https://github.com/Omico/issue-kotlinx-serialization-2495
Expected behavior
Environment
The text was updated successfully, but these errors were encountered: