Using null-conditional bool? in if statement [duplicate]
问题 This question already has answers here : Converting Nullable<bool> to bool (6 answers) Compiler Error for Nullable Bool (5 answers) cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?) (9 answers) Closed 3 years ago . 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