S5944 warning implicit return value when using as a delegate

  • What language is this for?
    • Visual Basic .NET
  • Which rule?
  • Why do you believe it’s a false-positive/false-negative?
    • Getting the address of the current function to use it as a delegate, not using it for a return statement.
  • Are you using
  • How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
Public Function TestFunc() As String
    If (InvokeRequired) Then
        Return Invoke(AddressOf TestFunc)
    Else
        Return String.Empty
    End If
End Function

Hello Christophe Devos,

I can confirm that the issue is indeed a false positive. I documented the FP and created an issue in our backlog:

Thank you for reporting this.

Best, Martin