Skip to content

Possible incorrect use of "NOT ... OR ..." pattern #16341

@GrabYourPitchforks

Description

@GrabYourPitchforks

Our internal tools are flagging these blocks of code as potentially improper use of the not ... or ... pattern matching syntax.

FrozenSet<string> excludeFiles = files.Where(x => x is not null or "").ToFrozenSet();

See dotnet/roslyn#75506 for more information on why this pattern is being flagged. If this logic is correct, consider restructuring it to use clarifying () parentheses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions