Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Convert to full property generates erroneous code for semi-auto properties #75547

Open
just-ero opened this issue Oct 17, 2024 · 0 comments
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@just-ero
Copy link

Version Used

Compiler: 4.13.0-1.24503.11 (9ff81f4)
.NET: 9.0.100-rc.2.24474.11
Visual Studio Code: 1.94.2, 384ff7382de624fb94dbaf6da11977bba1ecd427, x64
C# Extension: v2.51.17
C# Dev Kit Extension: v1.12.2

Steps to Reproduce

  1. Create or open a C# project in Visual Studio Code (Visual Studio untested).
  2. Add the following code wherever syntactically applicable:
    int P
    {
        get;
        set
        {
            M(field);
            field = value;
        }
    }
    
    void M(int i) { }
  3. Apply the Convert to full property code action on P.

Expected Behavior

private int p;

int P
{
    get => p;
    set
    {
        M(p);
        p = value;
    }
}

Actual Behavior

private int p;

int P
{
    get => p;
    set => p = value
}
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant