Skip to content

Remove duplicate IsTypeReachableFromGeneratedCode in TestClassModelBuilder#9473

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/duplicate-code-fix
Draft

Remove duplicate IsTypeReachableFromGeneratedCode in TestClassModelBuilder#9473
Copilot wants to merge 2 commits into
mainfrom
copilot/duplicate-code-fix

Conversation

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

TestClassModelBuilder.IsTypeReachableFromGeneratedCode was a semantic duplicate of SymbolAccessibilityHelper.IsAccessibleFromGeneratedCode, which is already linked into the same project and used by the sibling MSTestReflectionMetadataGenerator.

Changes

  • Deleted IsTypeReachableFromGeneratedCode from TestClassModelBuilder.cs
  • Replaced its single call site with SymbolAccessibilityHelper.IsAccessibleFromGeneratedCode

No project file changes needed — SymbolAccessibilityHelper.cs is already referenced via <Compile Include="..\Shared\SymbolAccessibilityHelper.cs" /> and using MSTest.Analyzers.Shared; was already present.

The two implementations were semantically equivalent across all Accessibility values; they differed only in allow-list vs. deny-list style. The shared helper is the canonical version and explicitly handles NotApplicable (which the duplicate only allowed implicitly).

Copilot AI self-assigned this Jun 27, 2026
Copilot AI review requested due to automatic review settings June 27, 2026 05:39
Copilot AI removed the request for review from Copilot June 27, 2026 05:39
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 27, 2026 05:45
Copilot AI changed the title [WIP] Fix duplicate code in TestClassModelBuilder Remove duplicate IsTypeReachableFromGeneratedCode in TestClassModelBuilder Jun 27, 2026
Copilot AI requested a review from Evangelink June 27, 2026 05:46
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