feat(minor): Make fractionalDigitCount public - #8
Merged
Merged
Conversation
Formatting and parsing code outside the module needs the number of fractional digits to size fraction lengths, quantums and exponents, and had to hard-code 8 or keep a local patch of this file. The accessor is a constant, so it is also @inlinable; the storage layout is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request changes the access level of fractionalDigitCount in FixedPointDecimal from internal to public and marks it as @inlinable. This allows external modules to access the fractional digit count directly for formatting and parsing. There are no review comments, and I have no feedback to provide.
|
Pull request had an unknown failure |
axelandersson
approved these changes
Sep 21, 2026
supersonicbyte
approved these changes
Sep 21, 2026
…the DocC topics Review feedback on #8: the doc comment states what the value is for rather than why it was made public, and the DocC constants group links the newly public property. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FixedPointDecimal.fractionalDigitCountbecomespublic(it was@usableFromInline internal), with@inlinablesince it is a constant.Code that formats or parses
FixedPointDecimalvalues from another module needs the number of fractional digits to size fraction lengths, quantums and exponents, and today has to hard-code 8. A downstream consumer that vendors these sources into a library-evolution module has carried exactly this one-line change as a local patch since the 2.2.0 vendoring; upstreaming it means the next re-vendor no longer reverts it (sc-38636). The vendored copy differs from upstream in nothing else beyond formatter output.Nothing else changes: the storage layout, the arithmetic and the internal uses of the constant are untouched, and
BasicTestsalready asserts the value is 8.Verification:
swift buildandswift teston this branch, 634 tests in 18 suites passing. The CI failures on the first push are two pre-existing workflow defects that hit every PR in this repository and are fixed separately: the benchmark comparison step runs underbash -e, so any threshold deviation aborts the step before its exit-code mapping and reports an unknown failure (it has failed on all eight runs in the workflow's history), and the coverage export looks forFixedPointPackageTests.xctestalthough the package is named FixedPointDecimal and theswift:latestcontainer has moved to 6.4, where no.xctestfile is produced for a Swift Testing-only package. A local run of the benchmark comparison shows only wall-clock noise, including on the Foundation Decimal benchmarks this change cannot touch, and one 5% instruction deviation with a p50 to p75 spread wider than the difference.Codex (gpt-6-astra) found nothing blocking in either pass; its two nits, a usage-oriented doc comment and a DocC topics entry, are taken. Its suggestion of an ordinary-import client compile test against a library-evolution build is not taken: that compile happens in the vendoring consumer, and this repository has no second module to host it.
🤖 Generated with Claude Code