Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate field for const arrays in constructor declarations #7231

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

CollinAlpert
Copy link
Contributor

Affected analyzer: AvoidConstArraysAnalyzer
Affected diagnostic ID: CA1861

This PR ensures the static readonly field gets created when the code fix is applied.

Fixes #7216

@CollinAlpert CollinAlpert requested a review from a team as a code owner March 7, 2024 17:48
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.46%. Comparing base (7b1f39d) to head (23ee358).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7231      +/-   ##
==========================================
- Coverage   96.46%   96.46%   -0.01%     
==========================================
  Files        1432     1432              
  Lines      342185   342189       +4     
  Branches    11280    11281       +1     
==========================================
- Hits       330104   330098       -6     
- Misses       9230     9238       +8     
- Partials     2851     2853       +2     

Copy link
Contributor

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you @CollinAlpert

@buyaa-n buyaa-n merged commit 4d5fd9d into dotnet:main Jun 7, 2024
14 checks passed
@CollinAlpert CollinAlpert deleted the issue-7216 branch June 7, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Extract to static readonly field code fix does not generate required field
2 participants