-
Notifications
You must be signed in to change notification settings - Fork 620
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
throw exception when i put a jsonobject into jsonobject #759
Comments
i can put JsonPrimitive into JsonObject. the diff between JsonPrimitive and JsonObject is JsonObject inherit Map<String, JsonElement> and delegate by |
I'd believe this is due to downcasting to |
I know what the problem is. In IOS,JsonObject is not declared as a class. If you use JsonObject in the function signature, the compiler compiles it to NSDictionary type, but in the internal logic JsonObject is treated as JsonElement type, so when the return value of the function is declared JsonObject and the returned instance type is also JsonObject, it will report an error on IOS, but on Android is fine.
|
Seems JetBrains/kotlin-native#3991, which I mentioned in your other issue, is also the case here. |
I'm converting some android libraries to MPP libraries. There's some logic that puts a jsonobject inside a jsonobject. When i rewirte it with kx.serialization, i got cast error in IOS
error info:
Could not cast value of type 'SharedCodeKMapAsNSDictionary' (0x10460cee8) to 'SharedCodeKotlinx_serialization_runtimeJsonElement' (0x10460c4e8).
The text was updated successfully, but these errors were encountered: