Open
Description
What
The ImplicitByRefModifier
does a great job of finding places where the programmer has left out a specific ByRef
modifier, and it offers the opportunity to make it explicit. However, there are times when the parameter should have been ByVal
, instead, and having the opportunity to make it so with a QucikFix would be quite handy.
Why
Because sometimes a parameter should be ByVal
, even when it wasn't specified either way to begin with.
Example
This code should trigger the inspection:
Public Function DoSomething(foo as string)
DoSomething = foo & "bar"
End Function
QuickFixes
-
Pass parameter by value
Example code, after quickfix is applied:
Public Function DoSomething(ByVal foo as string) DoSomething = foo & "bar" End Function
Resources
N/A - existing inspection info is sufficient