roslyn
roslyn copied to clipboard
Rename the record parameter when its property get renamed
Fix https://github.com/dotnet/roslyn/issues/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.