We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Diagnostic ID: CS0219 : The variable 'variable' is assigned but its value is never used
The variable 'variable' is assigned but its value is never used
SDK: .NET 8.05
If you use this code:
namespace ConsoleApp41 { internal class Program { static void Main(string[] args) { var Values = new[] { ("A", "B", "C"), ("A", "B", "C"), ("A", "B", "C"), }; foreach (var (A, B, C) in Values) { Console.WriteLine(A + C); } var D = ""; } } }
You'll see the following in VS:
D correctly generates CS0219 but B does not. This makes it easy to miss that B's value is not being used.
D
B
B generates CS0219.
B does not generate CS0219.
I notice that B does generate IDE0059 but D generates both.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Analyzer
Diagnostic ID: CS0219 :
The variable 'variable' is assigned but its value is never used
Analyzer source
SDK: .NET 8.05
Describe the bug
If you use this code:
You'll see the following in VS:
D
correctly generates CS0219 butB
does not.This makes it easy to miss that B's value is not being used.
Expected behavior
B
generates CS0219.Actual behavior
B
does not generate CS0219.Additional context
I notice that
B
does generate IDE0059 butD
generates both.The text was updated successfully, but these errors were encountered: