Skip to content

IDE0004 False positive #33043

@meziantou

Description

@meziantou

Version Used: VS 2019 preview 2

Steps to Reproduce:

if ((int?)1 is null)
{
}

Expected Behavior:

No diagnostic is reported

Actual Behavior:

IDE0004 is reported. If you apply the fix (remove the cast), the code doesn't compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions