Skip to content

IDE0004 Cast is redundant false positive VB #78185

Open
@CoolCoderSuper

Description

@CoolCoderSuper

Version Used:
17.14.0 Preview 3.0

Steps to Reproduce:

    Public Overrides Sub ProcessCommand(cmd As [Enum], arg As Object)
        MyBase.ProcessCommand(cmd, arg)
        Select Case CType(cmd, SplashScreenCommand)
            Case SplashScreenCommand.SetText
                labelStatus.Text = arg
            Case SplashScreenCommand.Close
                Close()
        End Select
    End Sub

Says the cast is reduntant however upon removing the cast I get
BC30452 - Operator '=' is not defined for types '[Enum]' and 'frmSplashScreen.SplashScreenCommand'.

Expected Behavior:

Actual Behavior:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEFeature - IDE0004Remove unnecessary casthelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    Projects

    Status

    InQueue

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions