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

Null suppression does not work when Assert is fully qualified #739

Closed
RenderMichael opened this issue May 16, 2024 · 0 comments · Fixed by #740
Closed

Null suppression does not work when Assert is fully qualified #739

RenderMichael opened this issue May 16, 2024 · 0 comments · Fixed by #740
Assignees
Milestone

Comments

@RenderMichael
Copy link

The following code has a null warning on M(x)

using NUnit.Framework;

class C
{
    [Test]
    public void T()
    {
        object? x = null;
        NUnit.Framework.Assert.That(x, Is.Not.Null);
        M(x);
    }

    void M(object o)
    {
    }
}

The following code does not

using NUnit.Framework;

class C
{
    [Test]
    public void T()
    {
        object? x = null;
        Assert.That(x, Is.Not.Null);
        M(x);
    }

    void M(object o)
    {
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants