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

Fix S5944 FP: AddressOf(MethodName) in Return statement #9553

Open
martin-strecker-sonarsource opened this issue Jul 24, 2024 · 0 comments
Open
Labels
Area: VB.NET VB.NET rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.

Comments

@martin-strecker-sonarsource
Copy link
Contributor

martin-strecker-sonarsource commented Jul 24, 2024

First reported here https://community.sonarsource.com/t/119507

The use of AddressOf TestFunc in a return statement is not an assignment to the implicit return value variable TestFunc:

Public Function TestFunc() As String
    If (InvokeRequired) Then
        Return Invoke(AddressOf TestFunc) ' Noncompliant FP
    Else
        Return String.Empty
    End If
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VB.NET VB.NET rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

1 participant