How can I find all references to fields defined by a C# 9 record?

Viewed 481

Repro:

public class TestCase
{
    public Boolean MyFieldIsFour(MyRecord myRecord)
    {
        return myRecord.MyField == 4;
    }
}

public record MyRecord(int MyField);

Right click int MyField and choose Find All References. Visual Studio can't find any references to MyField. I would have expected it to find the reference at myRecord.MyField. If MyRecord is changed to a class then Visual Studio has no problems finding the reference as expected.

Is this a bug in Visual Studio? How can I actually find references now with records?

1 Answers
Related