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

Closed
sguryev opened this issue Feb 22, 2024 · 1 comment · Fixed by #1712
Labels

Comments

@sguryev
Copy link
Contributor

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
@ChrisPulman ChrisPulman mentioned this issue Jun 9, 2024
2 tasks
Copy link

github-actions bot commented Jul 5, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant