Skip to content

Add code fixer for CA1859 - #55814

Draft
nagilson with Copilot wants to merge 2 commits into
mainfrom
copilot/auto-fixer-for-ca1859
Draft

Add code fixer for CA1859#55814
nagilson with Copilot wants to merge 2 commits into
mainfrom
copilot/auto-fixer-for-ca1859

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

CA1859 identifies declarations that can use a concrete type but previously required manual edits.

  • Code fix
    • Replaces field, property, local, parameter, and return types with the recommended concrete type.
    • Supports Fix All and preserves nullable annotations.
    • Omits fixes for shared multi-variable declarations where changing one type could affect unrelated variables.
IList<string> values = new List<string>();
// becomes
List<string> values = new List<string>();
  • Analyzer metadata
    • Carries the target type and nullability information in diagnostic properties.
    • Marks CA1859 as having an available code fix.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI linked an issue Aug 18, 2026 that may be closed by this pull request
Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add auto-fixer for CA1859 in Visual Studio Add code fixer for CA1859 Aug 18, 2026
Copilot AI requested a review from nagilson August 18, 2026 01:55
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.

CA1859 should have an auto-fixer

2 participants