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

CA1070: Do not use mutable struct in readonly field #3405

Closed
wants to merge 2 commits into from

Conversation

Evangelink
Copy link
Member

Fix #2811

@Evangelink Evangelink requested a review from a team as a code owner March 20, 2020 10:09
return;
}

if (field.Type.Equals(spinLockType) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

Only looking at field type as @stephentoub was suggesting. We could make the rule more advanced and look at mutation calls rather than field definition.

@mavasani
Copy link
Contributor

How does this play out with #2831?

@Evangelink
Copy link
Member Author

@mavasani I missed it sorry. Closing this PR.

@Evangelink Evangelink closed this Mar 20, 2020
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.

New rule: using mutable structs in readonly fields
2 participants