feat(shims): hand-bridge DelegateDisposable, document non-bridgeable types (#69 session 5)#142
Merged
Conversation
…types (#69 session 5) DelegateDisposable falls in the no-accessible-ctor bucket (private ctor), but unlike the other 3 candidates it exposes its full surface via public static factories (CreateBracket × 2, SetAndRestore). A static-class shim re-exposing those factories actually helps real consumers — the factories return the canonical IDisposable, so calls flow through naturally. For the other 3 no-accessible-ctor types, hand-bridges would be empty or decorative: - AbsolutePath: dominant consumer usage is implicit string/AbsolutePath conversion and operator/ — neither can be carried by a static-class shim - AzureKeyVault, MSBuildProject: zero public statics, framework-constructed only; nothing to re-expose These three are documented as fallout-migrate rename targets in a new "What's NOT covered (and won't be)" README section. Drops 2 SHIM001 warnings (DelegateDisposable × 2 referenced-assembly paths) via the suppression mechanism from #141. Remaining no-accessible-ctor types in the live build (AbsolutePath, AzureKeyVault, MSBuildProject) are exactly the three documented fallout-migrate targets. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Closes out the remaining
no-accessible-ctorSHIM001 bucket honestly.What ships as a bridge:
Nuke.Common.Utilities.DelegateDisposable—static classre-exposingCreateBracket(Action, Action),CreateBracket<T>(Func<T>, Action<T>), andSetAndRestore<T>. All three return canonicalIDisposable, so consumer calls flow through naturally.What ships as docs (not bridge):
Fallout.Common.IO.AbsolutePathFallout.Common.Tools.AzureKeyVault.AzureKeyVaultFallout.Common.Tools.MSBuild.MSBuildProjectThese three are documented as
fallout-migraterename targets in a new "What's NOT covered (and won't be)" README section.Why those three aren't bridged
AbsolutePathCreate()+ 5 const stringsAbsolutePath path = "/foo"(implicit conversion) andparent / "child"(operator/). Astatic classshim can't carry implicit operators, and a subclass shim can't be assignment-compatible with the framework-returned canonical instances. The bridge would be decorative —AbsolutePath.Create(...)is rarely how consumers write it.AzureKeyVaultMSBuildProjectThe
fallout-migraterewrite (Nuke.Common.X.Y→Fallout.Common.X.Y) is the right tool for these — same conclusion as enums, delegates, and structs.Live impact
The 3 remaining unique
no-accessible-ctortypes match the 3 documented fallout-migrate targets exactly.Verification
src/Shims/Nuke.Commonbuilds clean (0 errors)tests/Nuke.Common.Shim.Testsbuilds clean —SampleConsumerBuild.TouchDelegateDisposableShim()exercises bothCreateBracketoverloadsDelegateDisposable, so no SHIM001 fires for it#69 roadmap status after this
Nuke.CommonshimNuke.Build+Nuke.ComponentsshimsThe
no-accessible-ctorline of attack is now closed — what remains (AbsolutePath,AzureKeyVault,MSBuildProject) is documentedfallout-migrateterritory.Test plan
kind: no-accessible-ctorcount is 6 (down from 8)using Nuke.Common.Utilities;+DelegateDisposable.CreateBracket(...)compiles🤖 Generated with Claude Code