Skip to content

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

Closed

Description

@sguryev

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

Activity

  1. 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[/+] on Feb 22, 2024
  2. github-actions commented on Jul 5, 2024

    @github-actions

    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.

  3. locked as resolved and limited conversation to collaborators on Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions