Repository navigation
Do not polyfill Int128/UInt128/nint/nuint BigMul on net10 - #646
Merged
Merged
Conversation
SimonCropp
force-pushed
the
fix/bigmul-net10
branch
from
October 11, 2026 22:59
83cfa50 to
af04110
Compare
This was referenced Oct 12, 2026
This was referenced Oct 14, 2026
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.
Bug
Int128.BigMul,UInt128.BigMul,nint.BigMulandnuint.BigMul(the(left, right, out lower)overloads) were compiled for every TFM below net11, but all four exist in the net10 BCL (present in the 10.0.12 reference pack, absent from 9.0.20). On net10 the polyfills were dead code (a real static member always wins over a static extension member), added IL to consuming assemblies, and inflated the net10 API count by four.Log10in the same files really is net11-only, so the file-level guards stay.Fix
Wrap the four
BigMulmembers (and theBigMulCorehelper they share) in#if !NET10_0_OR_GREATER.Coverage
New
BigMulTests.NotPolyfilledWhereBclHasIt: reflects overPolyfills.Polyfilland asserts noBigMulpolyfill has a matching static method on the BCL type. It fails on net10.0 before the fix (listing the four methods) and passes on net48, net9.0, net10.0 and net11.0 after. The existingBigMulTestsvalue tests keep validating behaviour on every TFM.Split files and API counts regenerated (net10.0: 190 -> 186).