Self Assigned Declaration
Identifies auto-assigned object declarations.
Reasoning
Auto-assigned objects are automatically re-created as soon as they are referenced. It is therefore impossible to set one such reference to 'Nothing' and then verifying whether the object 'Is Nothing': it will never be. This behavior is potentially confusing and bug-prone.
Default severity
Suggestion
Inspection type
CodeQualityIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.SelfAssignedDeclarationInspection.cs (Prerelease-v2.5.9.6289)