Skip to content

Do not polyfill Int128/UInt128/nint/nuint BigMul on net10 - #646

Merged
SimonCropp merged 4 commits into
mainfrom
fix/bigmul-net10
Oct 11, 2026
Merged

SimonCropp merged 4 commits into
mainfrom
fix/bigmul-net10

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Bug

Int128.BigMul, UInt128.BigMul, nint.BigMul and nuint.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.

Log10 in the same files really is net11-only, so the file-level guards stay.

Fix

Wrap the four BigMul members (and the BigMulCore helper they share) in #if !NET10_0_OR_GREATER.

Coverage

New BigMulTests.NotPolyfilledWhereBclHasIt: reflects over Polyfills.Polyfill and asserts no BigMul polyfill 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 existing BigMulTests value tests keep validating behaviour on every TFM.

Split files and API counts regenerated (net10.0: 190 -> 186).

@SimonCropp SimonCropp added this to the 11.4.4 milestone Oct 11, 2026
@SimonCropp
SimonCropp merged commit b3af9e9 into main Oct 11, 2026
@SimonCropp
SimonCropp deleted the fix/bigmul-net10 branch October 11, 2026 23:15
This was referenced Oct 12, 2026
This was referenced Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants