-
Notifications
You must be signed in to change notification settings - Fork 510
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
SA1010 incorrectly reported on opening bracket in C# 11 list pattern #3503
Comments
@jnm2, can you point to a large public repository that uses patterns extensively and also uses stylecop? Would be good for testing, to see that at least all existing problems in that repo gets fixed before releasing the next beta. |
@bjornhellander Sorry, not off the top of my head. |
FWIW, I use patterns a fair amount in some of my projects and have quite a few StyleCop rules disabled due to bugs (some relating to patterns, some not). |
It shows up in pattern matching within internal static TransparentAddress? TryParse(ReadOnlySpan<char> address)
{
if (address.Length < 2)
{
return null;
}
Span<byte> decoded = stackalloc byte[DecodedLength];
Base58Check.Decode(address, decoded);
return decoded[..2] switch
{
[0x1c, 0xb8] or [0x1d, 0x25] => new TransparentP2PKHAddress(address),
[0x1c, 0xbd] or [0x1C, 0xBA] => new TransparentP2SHAddress(address),
_ => null,
};
} In the above snippet, |
Thanks for the example, @AArnott. The existing pull request should handle this case as well, if it gets merged. |
SDK 6.0.200 or newer required. Example csproj:
The text was updated successfully, but these errors were encountered: