Returning a tuple:
(bool yep, int num) Flip(int num)
{
return (num > 4, num);
}
Destructure into new variables:
var (yep, num) = Flip(someNumber);
if (yep)
{
SC is happy with this.
Destructure into existing variables:
var yep = false;
var num = 0;
(yep, num) = Flip(someNumber);
if (yep)
{
SC complains that the if condition is always false.
Colin
(Colin)
2
Hey there.
I’ve moved your post to the section on reporting false-positives. Take a look at the following post:
Specifically, can you tell us what rule an issue is being raised for?