Skip to content

Add Pass ByVal quick fix to ImplicitByRefModifier inspection #5837

Open
@daFreeMan

Description

@daFreeMan

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

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty-02-duckyResolving these involves the internal API, but with relatively easy problems to solve.enhancementFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.feature-inspection-quickfixesfeature-inspectionsup-for-grabsUse this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions