ECMA-334: 10.7.1 Name hiding
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| C# Language Specification |
| © 2006 ECMA International |
10.7.1 Name hiding
The scope of an entity typically encompasses more program text than the declaration space of the entity. In particular, the scope of an entity can include declarations that introduce new declaration spaces containing entities of the same name. Such declarations cause the original entity to become hidden. Conversely, an entity is said to be visible when it is not hidden.
Name hiding occurs when scopes overlap through nesting and when scopes overlap through inheritance. The characteristics of the two types of hiding are described in the following subclauses.
Local variables, local constants, parameters, and method type parameters cannot hide other local variables, local constants, parameters, or method type parameters (§10.3).