-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gray out unnecessary non-null suppression operator #26736
Comments
Last LDM discussion on this landed on:
|
Updated area to IDE and title to "gray out unnecessary suppression". |
@jcouv @333fred If the IDE did want to implement this, what would be the recommended way to do so? We'd just call GetTypeInfo on the thing to the left and if it's NullableFlowState.NotNull then flag it? Or is there more subtlety needed here? (We're keeing this in backlog for now but just curious if this is something we even could do or if I should move it to 'blocked by compiler API') |
More subtlety will be needed here. The suppression operator is going to change what we report for |
Definitely more subtle. The suppression operator also conversions and nested nullability. For example, |
This is blocked on #25372 |
Duplicate of #34714 |
Version Used: Nullable Reference Types Preview (7 May 2018)
Steps to Reproduce:
Expected Behavior:
A warning is provided for the use of
!
where flow analysis already determines the expression cannot be null.Actual Behavior:
No warning is provided.
The text was updated successfully, but these errors were encountered: