-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
feature: Improve support for nullable #1302
Comments
Can you please share a sample interface definition that matches what you're doing? It's not clear what the type of |
This happens for every call that uses Line 45 in 569108a
An example could be:
|
Can you please submit a PR to add the correct attributes? |
I've submitted a PR, thanks! |
Are there other places in the public API that we need to decorate with the nullable attributes to be more accurate? |
I've looked through If you can point me to the exact properties that could also use this change I'd be happy to make another commit. |
Thanks! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
In my project I have nullable reference types enabled
<Nullable>enable</Nullable>
.I retrieve data like this:
The issue I'm seeing is that I get CS8602 warnings(Dereference of a possible null reference) for
response.Content
andresponse.Error
due to these being nullable. However I am checkingresponse.IsSuccessStatusCode
which I believe make sure that eitherContent
orError
is populated.Describe the solution you'd like
To not get these warnings.
Describe suggestions on how to achieve the feature
I believe we can add the following attributes to
IsSuccessStatusCode
to fix this issue.[MemberNotNullWhen(true, nameof(Content))]
[MemberNotNullWhen(false, nameof(Error))]
The text was updated successfully, but these errors were encountered: