Skip to content

ByRef Array of Objects Parameters, Inspection False Positives #6094

@Energeer

Description

@Energeer

Rubberduck version information

Version 2.5.2.6242
OS: Microsoft Windows NT 10.0.19044.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.16026.20200
Host Executable: EXCEL.EXE

Description
Rubberduck appears to expect ByRef Array Parameters to be values, when they can be objects.

To Reproduce

Private Property Get SomethingsArray() As ISomething()
    '...    
End Property

Private Sub DoSomething(ByRef ArrayOfSomethings() As ISomething)
    '...    
End Sub

Private Sub TestSomething()
    DoSomething SomethingsArray
End Sub

Expected behavior
Not to get either of the following inspections:

  1. Implicit default member access: on SomethingsArray in TestSomething (appears if ISomething has a DefaultMember of a value type)
  2. Object used where a value is required: on SomethingsArray in TestSomething (appears if ISomething does not have a DefaultMember of a value type)

Additional context
The use of an Array of Objects over a Collection of Objects is due to using 2D arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIdentifies work items for known bugsresolverIssue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees.

    Type

    No type

    Projects

    Status

    Backlog | Resolver

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions