Skip to content

BUG: CC0030 (MakeLocalVariableConst) - False positive on reference types initialized to Nothing (VB) #960

@SJMakin

Description

@SJMakin

CC0030 (MakeLocalVariableConst) reported when it isn't applicable on reference types initialized to Nothing. Using the latest VB extension.

To recreate:
Dim test As ArgumentException = Nothing

Gets converted to:
Const test As ArgumentException = Nothing

This results in error BC30424 "Constants must be of an intrinsic or enumerated type, not a class, structure, type parameter, or array type.".

Expecting no diagnostic when a reference type is initialized to Nothing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions