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

Rename the record parameter when its property get renamed #74168

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Cosifne
Copy link
Member

@Cosifne Cosifne commented Jun 26, 2024

Fix #72581

Reason:
Using code snnipet

    public record MyRecord(string MyProperty);
    public class ReferenceClass
    {
        public static void Test()
        {
            var record = new MyRecord("HelloWorld");
            var c = record.MyProperty;
        }
    }

When we rename the MyProperty in constructor, we are renaming the parameter, var c = record.MyProperty is not renamed, because it's referencing the generated property.

This PR fix by adding an additional check.

@Cosifne Cosifne requested a review from a team as a code owner June 26, 2024 18:58
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 26, 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

Successfully merging this pull request may close these issues.

[BUG] When i rename record param, not rename all references
2 participants