[Foundation][SR-3125] Fix Decimal init from (U)Int64 #18486
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR synchronizes the Foundation overlay with the corresponding file in swift-corelibs-foundation by adding changes made in swiftlang/swift-corelibs-foundation#1550 with respect to
Decimal
initialization fromUInt64
andInt64
. (The remainder of that PR is unique to swift-corelibs-foundation.)I was surveying outstanding bugs in
Decimal
and noticed that this one was fixed on Linux but not on Apple platforms. The actual changes here are not mine, and for the sake of synchronyno attempt is made to improve this codeonly minor changes are made because (for some unclear reason) ToT is rejecting the expressionUInt64(abs(value))
.Resolves SR-3125.