-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.
Milestone
Description
This is a follow-up of #2478
public class ReproIssue2478
{
public void SomeMethod()
{
ForSwitchArm x = null;
var result = (x) switch
{
null => 1,
// normally, when deconstructing in a switch, we don't actually know the type
(object x1, object x2) => 2
};
var y = new ForIsPattern();
if (y is (string a, string b)) { }
}
private sealed class ForSwitchArm
{
public void Deconstruct(out object a, out object b) { a = b = null; } // Noncompliant FP
}
private sealed class ForIsPattern
{
public void Deconstruct(out string a, out string b) { a = b = null; } // Noncompliant FP
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.