Skip to content
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

[NiceToHave]: Interface IApiResponse<out T> misses [MemberNotNullWhen(true, nameof(Content))] attribute #1671

Open
sguryev opened this issue Feb 22, 2024 · 0 comments
Labels

Comments

@sguryev
Copy link

sguryev commented Feb 22, 2024

Describe the bug 🐞

Analyzer shows the warming for the IApiResponse<out T>.Content property after checking IsSuccessStatusCode.

Step to reproduce

  1. Return IApiResponse<T> from the method.
  2. Call the method
  3. Check the response IsSuccessStatusCode == true
  4. See the error\warning

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

Analyzer should consider Content as not null after checking IsSuccessStatusCode for true

Screenshots 🖼️

image

image
image
image

IDE

No response

Operating system

Windows

Version

11

Device

No response

Refit Version

7.0.0

Additional information ℹ️

No response

@sguryev sguryev added the bug label Feb 22, 2024
@sguryev sguryev changed the title [Bug]: Interface IApiResponse<out T> misses [MemberNotNullWhen(true, nameof(Content))] attribute [NiceToHave]: Interface IApiResponse<out T> misses [MemberNotNullWhen(true, nameof(Content))] attribute Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant