DotNetAnalyzers / NullParameterCheckRefactoring

Null Parameter Check Refactoring for Reference Type Parameters
MIT License
14 stars 4 forks source link

C# 5 syntax doesn't handle @identifier syntax #25

Closed sharwell closed 10 years ago

sharwell commented 10 years ago

When the language version is set to C# 5 or earlier, the refactoring operation for the parameter of the following method is incorrect.

public void Operation(object @object)
{
}

Expected

public void Operation(object @object)
{
    if (@object == null)
    {
        throw new ArgumentNullException("object");
    }
}

Actual

public void Operation(object @object)
{
    if (@object == null)
    {
        throw new ArgumentNullException("@object");
    }
}