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

Detection of IDE0059 with C# not working within try/catch statements #65220

Open
vsfeedback opened this issue Nov 3, 2022 · 1 comment
Open
Assignees
Labels
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:Other]
Detection of IDE0059 Remove unnecessary value assignment is not working when the statement is within a try/catch block. I have an .editorconfig file with the following dotnet_diagnostic.IDE0059.severity = error, and when the offending code is in a regular method it works fine, but when the offending statement is moved into a try/catch it no longer detects the issue. This detection also doesn't seem to work with top-level statements.


Original Comments

Feedback Bot on 10/30/2022, 07:51 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 3, 2022
@CyrusNajmabadi CyrusNajmabadi added Feature - IDE0059 Unused value and removed Area-IDE labels Nov 3, 2022
@jcouv
Copy link
Member

jcouv commented Nov 4, 2022

Chatted with Peter and he showed me the repro. [Corrected below] Here's the repro (expecting IDE0059 but none reported):
image

@jcouv jcouv self-assigned this Nov 4, 2022
@jcouv jcouv added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 4, 2022
@jcouv jcouv added this to the 17.5 milestone Nov 4, 2022
@jcouv jcouv modified the milestones: 17.5, 17.6 Feb 21, 2023
@jcouv jcouv modified the milestones: 17.6, C# 12.0 Mar 2, 2023
@jaredpar jaredpar modified the milestones: C# 12.0, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants