Allow setting properties and fields with null conditional operator #4275
Answered
by
svick
JustNrik
asked this question in
Language Ideas
-
For some reason, this isn't allowed: someNullableInstance?.SomeProperty = SomeValue; I don't know why this doesn't compile, forcing the user to make a Set method or add more lines of code just to assign a value to a property when the instance isn't null. Proposal: Allow it, properties are nothing but autogenerated methods, there's no reason why this isn't allowed. |
Beta Was this translation helpful? Give feedback.
Answered by
svick
Dec 26, 2020
Replies: 2 comments 1 reply
-
There is already a championed issue about this: #2883. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
svick
-
This is definitely a dupe of #2883 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is already a championed issue about this: #2883.