Inspection Details

UnreachableCase


Summary
Flags 'Case' blocks that are semantically unreachable.
Reasoning
Unreachable code is certainly unintended, and is probably either redundant, or a bug.
The following code example(s) would trigger this inspection:

Private Sub Example(ByVal value As Long)
    Select Case value
    Case 0 To 99
        ' ...
    Case 50 ' unreachable: case is covered by a preceding condition.
        ' ...
    Case Is < 100
        ' ...
    Case < 0 ' unreachable: case is covered by a preceding condition.
        ' ...
    End Select
End Sub


Back to List