Reorder Try.cs overloads to satisfy SonarAnalyzer S4136#85
Merged
Chris-Wolfgang merged 2 commits intomainfrom Apr 25, 2026
Merged
Reorder Try.cs overloads to satisfy SonarAnalyzer S4136#85Chris-Wolfgang merged 2 commits intomainfrom
Chris-Wolfgang merged 2 commits intomainfrom
Conversation
Resolves S4136 (SonarAnalyzer): all Run overloads must be adjacent and all RunAsync overloads must be adjacent. Moves Run<T> above RunAsync(Action) so the Run group (Run + Run<T>) and RunAsync group (RunAsync + RunAsync<T>) are each contiguous. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves xUnit1026: the [Theory] had two [InlineData] rows but never used the 'succeeded' parameter — both rows tested the same thing. Failure is already covered by the separate Failure_sets_properties_correctly [Fact]. 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
Try.csso allRunoverloads are textually adjacent and allRunAsyncoverloads are textually adjacent.All method overloads should be adjacent), which is failing the build onmainand on every open dependabot PR (Bump Meziantou.Analyzer from 3.0.49 to 3.0.54 #82, Bump SonarAnalyzer.CSharp from 10.23.0.137933 to 10.24.0.138807 #83).Why
The previous order was
Run(Action)→RunAsync(Action)→Run<T>→RunAsync<T>, which interleaved the two overload groups. After this change the order isRun(Action)→Run<T>→RunAsync(Action)→RunAsync<T>.Test plan
dotnet build --configuration Releasesucceeds (0 warnings, 0 errors)dotnet test --configuration Release— all 96 tests pass on every TFM (net462, net48, net472, net481, net5.0–net10.0)🤖 Generated with Claude Code