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

IDE0059 is unnecessary in Primary Constructors #69643

Closed
CreateAndInject opened this issue Aug 21, 2023 · 0 comments · Fixed by #69748
Closed

IDE0059 is unnecessary in Primary Constructors #69643

CreateAndInject opened this issue Aug 21, 2023 · 0 comments · Fixed by #69748
Assignees
Milestone

Comments

@CreateAndInject
Copy link

CreateAndInject commented Aug 21, 2023

class My(string str) {
	public void Reset() {
		str = null; // warning IDE0059 is unnecessary, since `str` is a field in the context
	}
}

Test in 17.6.6

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 21, 2023
@CyrusNajmabadi CyrusNajmabadi added Bug Feature - IDE0059 Unused value and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 21, 2023
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Aug 21, 2023
@CreateAndInject CreateAndInject changed the title IDE0059 is unnessary in Primary Constructors IDE0059 is unnecessary in Primary Constructors Aug 21, 2023
mavasani added a commit to mavasani/roslyn that referenced this issue Aug 29, 2023
Fixes dotnet#69643

We already did so for IDE0060 (unused parameters) in a prior PR. This adds a similar bailout check in the core dataflow analysis IOperation walker for IDE0059 (unused value assignment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants