dotnet/roslyn

IDE0004 Cast is redundant false positive VB

Open

#78,185 opened on 2025年4月17日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-IDEFeature - IDE0004help wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

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:

コントリビューターガイド