[Proposal] Allow unboxing of Nullable<T> with HasValue and/or "is not null" pattern #4645
Unanswered
datvm
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
The syntax that works today (C# 8+) is @CyrusNajmabadi You talked about being interested in |
Beta Was this translation helpful? Give feedback.
2 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Currently after checking if a
Nullable<T>
has value or not (is null or not), we need another formal line to declare a non-nullable value of it:Proposal
Allow declaration of a variable right after
Nullable<T>.HasValue
property and/or in ais not null
pattern:Beta Was this translation helpful? Give feedback.
All reactions