Skip to content

Commit 6c60cfc

Browse files
committed
Merge pull request #1049 from autoboosh/selfassigned
only look at self assigned variable declarations (fixes #1048)
2 parents 6c063af + 7e64a7f commit 6c60cfc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

RetailCoder.VBE/Inspections/SelfAssignedDeclarationInspection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.Generic;
22
using System.Linq;
33
using Rubberduck.Parsing.VBA;
4+
using Rubberduck.Parsing.Symbols;
45

56
namespace Rubberduck.Inspections
67
{
@@ -18,7 +19,7 @@ public SelfAssignedDeclarationInspection(RubberduckParserState state)
1819
public override IEnumerable<CodeInspectionResultBase> GetInspectionResults()
1920
{
2021
return UserDeclarations
21-
.Where(declaration => declaration.IsSelfAssigned)
22+
.Where(declaration => declaration.IsSelfAssigned && declaration.DeclarationType == DeclarationType.Variable)
2223
.Select(issue => new SelfAssignedDeclarationInspectionResult(this, issue));
2324
}
2425
}

0 commit comments

Comments
 (0)