Skip to content

Use auto property does not remove this which is present only by necessity #77011

@RenderMichael

Description

@RenderMichael

Version Used:
17.13.0 preview 4.0

Steps to Reproduce:

class C
{
    private readonly string a;

    public C(string a)
    {
        this.a = a;
    }

    public string A => a;
}

Diagnostic Id:

Fixer for IDE0032: Use auto property does not remove this keyword which was necessary for disambiguation but otherwise unfavored per style configuration.

Expected Behavior:

class C
{
    public C(string a)
    {
        A = a;
    }

    public string A { get; }
}

Actual Behavior:

class C
{
    public C(string a)
    {
        this.A = a;
    }

    public string A { get; }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEFeature - IDE0032Use auto propertyhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Projects

    Status

    Completed

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions