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
Nullable<bool> ?? false
Install SonarAnalyzer.CSharp and compile the following code:
using System; class Program { static void Main(string[] args) { var obj = args.Length > 0 ? new Program() : null; if (obj?.Cond ?? false) { Console.WriteLine("Foo"); Console.WriteLine("Bar"); } } private bool Cond = new Random().Next() % 2 == 1; }
No warning
Warning S2583 on line 9:
Change this condition so that it does not always evaluate to 'false'; some subsequent code is never executed.
#152 and #162 are similar, but have been fixed
The text was updated successfully, but these errors were encountered:
fixed in #2497
Sorry, something went wrong.
No branches or pull requests
Repro steps
Install SonarAnalyzer.CSharp and compile the following code:
Expected behavior
No warning
Actual behavior
Warning S2583 on line 9:
Related information
#152 and #162 are similar, but have been fixed
The text was updated successfully, but these errors were encountered: