Implicit Variant Return Type

Warns about 'Function' and 'Property Get' procedures that don't have an explicit return type.

Reasoning

All functions return something, whether a type is specified or not. The implicit default is 'Variant'.

Default severity

Hint

Inspection type

LanguageOpportunities

Examples

This example should trigger a result

MyModule (StandardModule)
Public Function GetFoo() GetFoo = 42 End Function

This example should NOT trigger a result

MyModule (StandardModule)
Public Function GetFoo() As Long GetFoo = 42 End Function

Rubberduck.CodeAnalysis.Inspections.Concrete.ImplicitVariantReturnTypeInspection.cs (Prerelease-v2.5.9.6289)