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

Fix RCS1169 #1092

Merged
merged 4 commits into from
Jun 1, 2023
Merged

Fix RCS1169 #1092

merged 4 commits into from
Jun 1, 2023

Conversation

jamesHargreaves12
Copy link
Contributor

@jamesHargreaves12 jamesHargreaves12 commented May 30, 2023

Currently, RCS1169 will suggest setting variables to read-only in cases which would cause compile-time errors such as the following:

class C
{
    int _a;
    void M2() {M(ref _a!);} 
}

This is because when working out what symbols have values assigned to them outside a constructor it currently does not consider symbols that have the SuppressNullableWarning suffix (!).

There is another minor issue is that anything inside the ref expression is not being considered by the MakeMemberReadonlyWalker.

@josefpihrt josefpihrt merged commit bf2f6b8 into dotnet:main Jun 1, 2023
@josefpihrt
Copy link
Collaborator

Nice! 👍

Haarmees pushed a commit to Haarmees/Roslynator that referenced this pull request Oct 30, 2023
Co-authored-by: Josef Pihrt <josef.pihrt@outlook.com>
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