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

AssignedByValParameterInspection shouldn't trigger for reference types unless Set is used #2601

Closed
comintern opened this issue Jan 31, 2017 · 0 comments
Assignees
Labels
bug Identifies work items for known bugs feature-inspections inspection-false-positive A bug where an inspection result appears, even though it is incorrect. parse-tree-processing

Comments

@comintern
Copy link
Contributor

In a UserForm with TextBox1:

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    If TextBox1.Text = vbNullString Then
        MsgBox "Value required"
        Cancel = True
    End If
End Sub

The AssignedByValParameterInspection triggers on this code, but MSForms.ReturnBoolean is a reference type (why MS, why?). The line Cancel = True is assigning to the default member ReturnBoolean.Value. The only reason this inspection should report for reference types is for code like:

Set Cancel = New MsForms.ReturnBoolean

Also see #2504 - this points to the need to resolve default member calls on the LHS as well.

@comintern comintern added bug Identifies work items for known bugs feature-inspections labels Jan 31, 2017
retailcoder added a commit to retailcoder/Rubberduck that referenced this issue Feb 22, 2017
@retailcoder retailcoder self-assigned this Feb 22, 2017
@retailcoder retailcoder added the inspection-false-positive A bug where an inspection result appears, even though it is incorrect. label Aug 11, 2017
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 feature-inspections inspection-false-positive A bug where an inspection result appears, even though it is incorrect. parse-tree-processing
Projects
None yet
Development

No branches or pull requests

2 participants