Skip to content

VariableTypeNotDeclaredInspection

Mathieu Guindon edited this page Feb 24, 2015 · 4 revisions

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
Clone this wiki locally