refit icon indicating copy to clipboard operation
refit copied to clipboard

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

Open sguryev opened this issue 1 year ago • 0 comments

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 avatar Feb 22 '24 08:02 sguryev