Skip to content

refactor(utilities): rename Json-side ObjectExtensions → JsonObjectExtensions (#69 follow-up) - #145

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feature/69-rename-jsonobjectextensions
May 24, 2026
Merged

refactor(utilities): rename Json-side ObjectExtensions → JsonObjectExtensions (#69 follow-up)#145
ChrisonSimtian merged 1 commit into
mainfrom
feature/69-rename-jsonobjectextensions

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Summary

Fallout.Utilities and Fallout.Utilities.Text.Json both declare public static class ObjectExtensions under the Fallout.Common.Utilities namespace. Two assemblies declaring the same FQN is the documented "split-assembly extension class" pattern in C# (consumers see one unified API), but it blocks the TransitionShimGenerator — a shim delegating to that FQN would produce CS0433 at consumer compile. The generator's pre-pass has been flagging this as ambiguous-across-assemblies since session 1.

What it is, by member

Assembly Members
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) ToJObject

Fix

Rename the Json side to JsonObjectExtensions. Verified that ToJObject is only ever called as an extension method (obj.ToJObject(...)) — there are zero ObjectExtensions.ToJObject(...) call sites in src/, tests/, or build/. The class name is invisible to callers; the rename is a pure refactor.

The base Fallout.Utilities side keeps the ObjectExtensions name (it's the larger surface, and the rename burden should sit on the smaller satellite assembly).

Live impact

Kind Before After
ambiguous-across-assemblies 4 0
no-accessible-ctor 6 6
sealed-class 0 0
SHIM001 total 10 6

The 6 remaining SHIM001s are all documented fallout-migrate targets (AbsolutePath, AzureKeyVault, MSBuildProject × 2 paths each) that won't disappear via shim work. This is the cleanest the shim build can get without fallout-migrate.

Verification

  • dotnet build tests/Fallout.Tooling.Tests/Fallout.Tooling.Tests.csproj (the single ToJObject caller) compiles clean
  • dotnet build src/Shims/Nuke.Common/Nuke.Common.csproj clean; 0 ambiguous warnings
  • Two new shim types now auto-generate via the Easy-tier path:
    • Nuke.Common.Utilities.ObjectExtensions (mirroring Fallout.Utilities)
    • Nuke.Common.Utilities.JsonObjectExtensions (mirroring Fallout.Utilities.Text.Json)

Test plan

  • CI green
  • Live shim build: 6 SHIM001 warnings (down from 10)
  • obj.ToJObject(...) extension-method discovery unaffected

🤖 Generated with Claude Code

…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>
@ChrisonSimtian
ChrisonSimtian merged commit 20b4507 into main May 24, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feature/69-rename-jsonobjectextensions branch May 24, 2026 08:07
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.

1 participant