[Proposal]: Short-circuit null-conditional for bool
types.
#4017
-
Short-Circuit Null-Conditional for
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
This shouldn't be any hard to implement, VB already does this by simply calling GetValueOrDefault(). I'm actually curious about why c# hasn't implemented this after decades... |
Beta Was this translation helpful? Give feedback.
-
It was an intentional design decision, C# expects the developer to be explicit about their conditions. https://ericlippert.com/2012/04/12/null-is-not-false-part-two/ |
Beta Was this translation helpful? Give feedback.
-
That doesn't make any sense, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification, and I can easily see the reasoning for it. 😀 |
Beta Was this translation helpful? Give feedback.
@JustNrik
It was an intentional design decision, C# expects the developer to be explicit about their conditions.
null
is notfalse
.https://ericlippert.com/2012/04/12/null-is-not-false-part-two/