Skip to content

Commit c58ad9f

Browse files
committed
VariableNotAssigned ignores array variables
1 parent 1caa610 commit c58ad9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

RetailCoder.VBE/Inspections/VariableNotAssignedInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public IEnumerable<CodeInspectionResultBase> GetInspectionResults(VBProjectParse
2121
var declarations = parseResult.Declarations.Items.Where(declaration =>
2222
!declaration.IsBuiltIn
2323
&& declaration.DeclarationType == DeclarationType.Variable
24+
&& !declaration.IsArray() // ignore arrays... not ideal though
2425
&& !parseResult.Declarations.Items.Any(item =>
2526
item.IdentifierName == declaration.AsTypeName
2627
&& item.DeclarationType == DeclarationType.UserDefinedType) // UDT variables don't need to be assigned

0 commit comments

Comments
 (0)