Skip to content

VariableTypeNotDeclaredInspection

Philip Wales edited this page Apr 10, 2015 · 1 revision

Description: Variable type is implicitly Variant

Type: CodeInspectionType.LanguageOpportunities

Default severity: CodeInspectionSeverity.Suggestion

This inspection finds declarations without an explicit As type declared, and without a type hint.

###Example:

foo is an implicit Variant in the below fairly common beginner mistake:

Dim foo, bar As Integer

###QuickFixes

QuickFix: Declare as explicit Variant

Not very clever, but good enough to satisfy this inspection for now:

Dim foo As Variant, bar As Integer