Allow use of increment ++ and decrement -- operators with null conditional assignments #9461
Answered
by
RikkiGibson
fitdev
asked this question in
Language Ideas
-
Recently C# introduced support for null conditional assignments: foo?.num = 1; However it seems that while compound assignment operators were included, increment and decrement operators were not, such that: foo?.num += 1; is valid, but: foo?.num++; is an error. It would be nice if the same logic also applies to |
Beta Was this translation helpful? Give feedback.
Answered by
RikkiGibson
Jun 18, 2025
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
fitdev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For context: https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-10-28.md#increment-and-decrement-operators-in-null-conditional-access