Shadowed Declaration
Identifies identifiers that hide/"shadow" other identifiers otherwise accessible in that scope.
NEW! This inspection is only available in pre-release builds.
Reasoning
Global namespace contains a number of perfectly legal identifier names that user code can use. But using these names in user code effectively "hides" the global ones. In general, avoid shadowing global-scope identifiers if possible.
Default severity
DoNotShow
Inspection type
CodeQualityIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.ShadowedDeclarationInspection.cs (Prerelease-v2.5.2.6174)