Synopsis: | Do not re-declare a visible name in a nested scope |
Language: | C# |
Severity Level: | 2 |
Category: | Object lifecycle |
Description: |
Repeating a name that already occurs in an outer scope is seldom intended and may be surprising in maintenance, although the behaviour is well-defined.
int foo = something; if (whatever) { double foo = 12.34; double anotherFoo = foo; // Violation. } |