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 UseNullPropagationCodeFixProvider for parenthesized property access #74316

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

Orachor
Copy link

@Orachor Orachor commented Jul 9, 2024

The issue occurs when the code fix provider is calling the GetWhenPartMatch method on it's analyzer (I'm assuming this is done to make sure the analysis is still valid in case we are running multiple code fixes). While the analyzer calls the method with an expression that is already stripped of it's parentheses (array.Length), however the code fix itself calls it with the parentheses kept ((array.Length)). Simplest fix would be to remove the parentheses before the call from the code fix provider. Other solution would be looking into the method and making sure it takes this into consideration, not 100% sure which is correct.

Closes #74273

@Orachor Orachor requested a review from a team as a code owner July 9, 2024 19:17
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 9, 2024
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Jul 9, 2024
@CyrusNajmabadi
Copy link
Member

Thanks!

@Orachor
Copy link
Author

Orachor commented Jul 9, 2024

@dotnet-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
3 participants