Bug: Some values of the enum are not processed inside switch

Hi,

I have two enums:

public enum MyEnum {
    Ref,
    Value,
    Set
}

public enum YourEnum {
    Foo,
    Boo
}

And I have a switch statement inside another switch

switch(myVal)
{
    case MyEnum.Ref:
        break;
    case MyEnum.Value:
        switch(myVal2)
        {
            case YourEnum.Foo:
                break;
            case YourEnum.Boo:
                break;
            default:
                break;
        }
        break;
    default:
        break;
}

I get a suggestion that "Some values of the enum are not processed inside switch, Set" on the outer switch. Applying the suggestion will add the missing enum value to the inner switch instead. The code will look like this:

switch(myVal)
{
    case MyEnum.Ref:
        break;
    case MyEnum.Value:
        switch(myVal2)
        {
            case YourEnum.Foo:
                break;
            case YourEnum.Boo:
                break;
            case MyEnum.Set:
                break;
            default:
                break;
        }
        break;
    default:
        break;
}

Please sign in to leave a comment.