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

[semi-auto-props]: Add more tests (GetMembers, speculative semantic model) #59270

Merged
merged 14 commits into from
Feb 24, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,18 @@ internal static bool TryParseAnonymousTypeParameterName(string typeParameterName
propertyName = null;
return false;
}

internal static bool TryParseBackingFieldName(string backingFieldName, [NotNullWhen(true)] out string? propertyName)
{
if (backingFieldName.StartsWith("<", StringComparison.Ordinal) &&
backingFieldName.EndsWith(">k__BackingField", StringComparison.Ordinal))
{
propertyName = backingFieldName.Substring(1, backingFieldName.Length - 17);
return true;
}

propertyName = null;
return false;
}
}
}
Loading