Skip to content

Wrong codefix for '== default' #41

@manfred-brands

Description

@manfred-brands

When I enabled this analyzer it correctly complained about checkedTypes == default,
But the code fix doesn't result in checkedType is null as expected but in default is null:

image

This is because the code tries to handle null == checkedTypes and only tests if the right hand is null:

expr.Right is LiteralExpressionSyntax { RawKind: (int)SyntaxKind.NullLiteralExpression }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions