Using null-conditional bool? in if statement

Viewed 9972

Why this code works:

if (list?.Any() == true)

but this code doesn't:

if (list?.Any())

saying Error CS0266 Cannot implicitly convert type 'bool?' to 'bool'

So why is it not a language feature making such an implicit conversion in the if statement?

1 Answers
Related