3 ms·
The Most Subtle C# Bugs in 2019: Null Conditional Operator with Any()
- BoorishBears 7y agoThe first thing that happened reading that code is: "Why is == true a condition" "Oh because it's a nullsble boolean" "Why is isn't the non-nullable getter being used" There's no analyzer for it, but it looks very "wrong" to your eyes to be testing equality of a boolean against true instead of just using the boolean value directly