[Proposal]: Expand NotNullWhen
attribute to support Enum types as Generic parameter
#6170
Unanswered
YIShikunov
asked this question in
Language Ideas
Replies: 1 comment 1 reply
-
It would be good to point at some real world apis, including those shipped either in the BCL or in very popular APIs (like Json.net) that would benefit from this. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
NotNullWhen
attributeSummary
A nullable attribute specifies that a method return value is not null if Enum return value equals a given value
Motivation
One of the possible uses can be implementation of discriminated unions.
Design
A new generic attribute will be added and supported by the Code Analysis
Originally posted by @YIShikunov in #5600 (comment)
Beta Was this translation helpful? Give feedback.
All reactions