Please provide
- Windows
- v6.12.0.59751
- c#
- connected mode to SonarQube (8.9.6 (build 50800))
static void Main(string[] args)
{
object o = null;
var test = o.ToString(); // Noncompliant, always null
var list = new List<int>();
//var listCount = list?.Count;
Console.ReadLine();
}
Reports s2259. If commented line is uncommented (it uses null conditional operator), then the s2259 is no longer reported.