You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For cases, where the same local variable is declared inside the if and else blocks e.g.
if (flag)
{
var x = 1;
return x;
}
else
{
var x = 0;
return x;
}
The diagnostic RCS1211 Should not be raised.
Removing the else block would cause a compiler error "A local variable named 'x' cannot be declared in this scope because it would give a different meaning to 'x', which is already used in a parent or current scope to denote something else".
The same thing is true for switch case brackets (RCS1031).
For cases, where the same local variable is declared inside the if and else blocks e.g.
The diagnostic RCS1211 Should not be raised.
Removing the else block would cause a compiler error "A local variable named 'x' cannot be declared in this scope because it would give a different meaning to 'x', which is already used in a parent or current scope to denote something else".
The same thing is true for switch case brackets (RCS1031).
Fix and tests in #1039.
The text was updated successfully, but these errors were encountered: