class C
{
void M(bool p, bool q, bool r)
{
if (r) // Invoke "Invert if (recursively)" here
{
if (p)
{
var x = 1;
M2();
}
if (q)
{
var x = 2;
M2();
}
}
}
void M2()
{
}
}
After:
class C
{
void M(bool p, bool q, bool r)
{
if (!r)
{
return;
}
if (p)
{
var x = 1; // compiler error here
M2();
}
if (!q)
{
return;
}
var x = 2;
M2();
}
void M2()
{
}
}
Product and Version Used: 4.3.0
Before:
After: