-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[JSONSerialization] Always use reference numeric types to match Darwin behavior #1634
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
Conversation
/cc @johnno1962 |
@swift-ci please test |
@johnno1962 Whoops, looks like we did the same thing. Sorry! |
Pinch my PR will you 😀!. Yours is better, run with it. Don’t forget to cherry pick into swift-4.2-branch |
Looks good to me. I'm assuming we can do this now because of the bridging improvements? |
Yes, this is following through on #1443 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes here specifically LGTM. I wonder if now that we can finally make use of bridging whether we should move off Int
as the primary integer type to Int64
and add support for UInt64
to get the full range of integer values as we do on Darwin.
@itaiferber Certainly a good idea; I'll keep this PR limited to the changes here, and that can be a follow-on improvement. As I mention, we still have some discrepancies in that department with respect to Darwin support for 128-bit integers. |
@swift-ci Please test and merge |
@xwu Now that this is merged, please also cherry pick into swift-4.2-branch |
This PR removes the undocumented internal serialization option
useReferenceNumericTypes
and aligns behavior with Darwin Foundation. (Note: there remains a divergence between platforms when it comes to 128-bit integers.)The parsing logic is simplified and tests are expanded to ensure that
"[10]"
is deserialized to a value that can be cast toInt
orDouble
.