Inspection Details

ImplicitDefaultMemberAccess


Summary
Identifies the use of non-indexed default member accesses.
Reasoning
Default member accesses hide away the actually called member. This is especially misleading if there is no indication in the expression that such a call is made and can cause errors in which a member was forgotten to be called to go unnoticed.
The following code example(s) would trigger this inspection:

Public Sub DoSomething(ByVal arg As ADODB.Field)
    Dim bar As Variant
    bar = arg
End Sub

Public Sub DoSomething(ByVal arg As ADODB.Connection)
    Dim bar As String
    arg = bar
End Sub

The following code example(s) would not trigger this inspection:

Public Sub DoSomething(ByVal arg As ADODB.Field)
    Dim bar As Variant
    bar = arg.Value
End Sub

Public Sub DoSomething(ByVal arg As ADODB.Connection)
    Dim bar As String
    arg.ConnectionString = bar
End Sub


Back to List