refactor(utilities): rename Json-side ObjectExtensions → JsonObjectExtensions (#69 follow-up) - #145
Merged
Conversation
…tensions (#69 follow-up) The Fallout.Utilities and Fallout.Utilities.Text.Json assemblies both declared `public static class ObjectExtensions` under the `Fallout.Common.Utilities` namespace. Two assemblies with the same FQN blocks the TransitionShimGenerator — a shim delegating to that name would produce CS0433 at consumer compile. Sessions 1+ have flagged it as `ambiguous-across-assemblies` ever since. The split-assembly extension class pattern is fine in C# generally (consumers see one unified API via extension-method discovery), but the shim path can't handle two same-named statics. Since `ToJObject` is only ever called as an extension method (`obj.ToJObject(...)`) — verified by inspecting all call sites in src/, tests/, and build/ — the class name is invisible to callers and a rename is the cleanest fix. Live impact on the Nuke.Common shim build: - SHIM001 ambiguous-across-assemblies: 4 → 0 - SHIM001 total: 10 → 6 (only the documented fallout-migrate targets remain) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 24, 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.
Summary
Fallout.UtilitiesandFallout.Utilities.Text.Jsonboth declarepublic static class ObjectExtensionsunder theFallout.Common.Utilitiesnamespace. Two assemblies declaring the same FQN is the documented "split-assembly extension class" pattern in C# (consumers see one unified API), but it blocks theTransitionShimGenerator— a shim delegating to that FQN would produce CS0433 at consumer compile. The generator's pre-pass has been flagging this asambiguous-across-assembliessince session 1.What it is, by member
Fallout.Utilities(3 partials:Object.Apply.cs,Object.When.cs,Object.Clone.cs)Apply,When,Clone, …Fallout.Utilities.Text.Json(single file:Object.ToJObject.cs)ToJObjectFix
Rename the Json side to
JsonObjectExtensions. Verified thatToJObjectis only ever called as an extension method (obj.ToJObject(...)) — there are zeroObjectExtensions.ToJObject(...)call sites insrc/,tests/, orbuild/. The class name is invisible to callers; the rename is a pure refactor.The base
Fallout.Utilitiesside keeps theObjectExtensionsname (it's the larger surface, and the rename burden should sit on the smaller satellite assembly).Live impact
The 6 remaining SHIM001s are all documented
fallout-migratetargets (AbsolutePath,AzureKeyVault,MSBuildProject× 2 paths each) that won't disappear via shim work. This is the cleanest the shim build can get withoutfallout-migrate.Verification
dotnet build tests/Fallout.Tooling.Tests/Fallout.Tooling.Tests.csproj(the singleToJObjectcaller) compiles cleandotnet build src/Shims/Nuke.Common/Nuke.Common.csprojclean; 0 ambiguous warningsNuke.Common.Utilities.ObjectExtensions(mirroring Fallout.Utilities)Nuke.Common.Utilities.JsonObjectExtensions(mirroring Fallout.Utilities.Text.Json)Test plan
obj.ToJObject(...)extension-method discovery unaffected🤖 Generated with Claude Code