-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Let's make new Feature ?== or ??= #43664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FYI, ??= is an existing operator for nullable assignment. |
Yes, I think you are describing the current null-aware assignment operator: // Assign value to a
a = value;
// Assign value to b if b is null; otherwise, b stays the same
b ??= value; |
|
Sorry, I don't understand. Can you specify in a bit more detail what the semantics of this proposed construct are? |
I think the proposal is to have syntax for evaluating ((v) => v != null ? something(v) : null)(a) and, in general, to enable "subexpression null shorting" in the sense that an expression is evaluated only if certain subexpressions are non-null. We have had some discussions about this before (but there doesn't seem to be an issue specifically on that, so it must have been individual comments in other discussions, e.g., this one). |
Uh oh!
There was an error while loading. Please reload this page.
let's change to
it is a little fun feature like this
The text was updated successfully, but these errors were encountered: