Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ByRef Array of Objects Parameters, Inspection False Positives #6094

Open
Energeer opened this issue Feb 24, 2023 · 0 comments
Open

ByRef Array of Objects Parameters, Inspection False Positives #6094

Energeer opened this issue Feb 24, 2023 · 0 comments
Labels
bug Identifies work items for known bugs resolver Issue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees.
Milestone

Comments

@Energeer
Copy link

Energeer commented Feb 24, 2023

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.

@Energeer Energeer added the bug Identifies work items for known bugs label Feb 24, 2023
@retailcoder retailcoder added the resolver Issue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees. label Feb 24, 2023
@retailcoder retailcoder added this to the 2.x Cycle milestone Jan 31, 2025
@retailcoder retailcoder moved this to Backlog | Resolver in Board-v2.99 Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs resolver Issue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees.
Projects
Status: Backlog | Resolver
Development

No branches or pull requests

2 participants