With nullable value types like int?
, add automatic unwrapping if the valaue isn't null
#7690
Unanswered
WillPittenger
asked this question in
Language Ideas
Replies: 1 comment 4 replies
-
You can already use As for the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, with a type like
string?
, you can use the following to test for null:But with a value type like
int?
, you need a different syntax:It'd be much better if nullable value types could use the first syntax. The compiler would then map that to the second if needed.
Beta Was this translation helpful? Give feedback.
All reactions