We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
S2589 is raised on a switch expression on a tuple where the second parameter is discarded but for the first one there is a guard clause.
private static string Example(string input, bool y) { return (input, y) switch { ("Foo", true) => "FooTrue", ("Foo", false) => "FooFalse", (var x, true) when x.StartsWith("ab") => "AbTrue", (var x, _) when x.StartsWith("CD") => "CD", _ => "empty", }; }
S2589 is not raised
S2589 is raised on the line containing: (var x, _) when x.StartsWith("CD") => "CD",
None/ Disable with pragma
Kindof relates to: #8008
The text was updated successfully, but these errors were encountered:
Hello @manpil,
Thank you for reporting this issue. I confirm this is a false positive.
I am adding this issue to our backlog to tackle it in the future.
Have a good day!
Sorry, something went wrong.
No branches or pull requests
Description
S2589 is raised on a switch expression on a tuple where the second parameter is discarded but for the first one there is a guard clause.
Repro steps
Expected behavior
S2589 is not raised
Actual behavior
S2589 is raised on the line containing: (var x, _) when x.StartsWith("CD") => "CD",
Known workarounds
None/ Disable with pragma
Related information
Kindof relates to: #8008
The text was updated successfully, but these errors were encountered: