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

Code inspection - inappropriate use of IsMissing - with ParamArray #5678

Closed
ghost opened this issue Feb 28, 2021 · 0 comments
Closed

Code inspection - inappropriate use of IsMissing - with ParamArray #5678

ghost opened this issue Feb 28, 2021 · 0 comments
Labels
bug Identifies work items for known bugs

Comments

@ghost
Copy link

ghost commented Feb 28, 2021

Rubberduck version information

Version 2.5.1.5557
OS: Microsoft Windows NT 10.0.19041.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.13628.20448
Host Executable: EXCEL.EXE

Description
The 'inappropriate use of IsMissing' code inspection' appears when IsMissing is used on a ParamArray saying that IsMissing will always return False. This is incorrect, IsMissing can return True if no elements are passed into the ParamArray.

To Reproduce

Sub Testing()
    TestOfParamArrayAndIsMissing
    TestOfParamArrayAndIsMissing "Foo", "Bar"
End Sub

Sub TestOfParamArrayAndIsMissing(ParamArray vArgs() As Variant)
    If IsMissing(vArgs) Then
        Debug.Print "vArgs is missing ... IsMissing has returned True"
    Else
        Debug.Print "vArgs is present ... IsMissing has returned False"
    End If
End Sub

Expected behavior
The code inspection should not flag a problem for the use of IsMissing on a ParamArray.

@ghost ghost added the bug Identifies work items for known bugs label Feb 28, 2021
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
Projects
None yet
Development

No branches or pull requests

0 participants