Skip to content

Switch keyword in switch expression has incorrect scope #184

@alexr00

Description

@alexr00

Originally from @marlongerson in microsoft/vscode#103423

Details

What editor are you seeing the problem in? (e.g. Atom, Visual Studio Code, etc.)
VS Code
What version of the editor are you using?
1.47.2, 1.48
What color theme are you using?
N/A

Repro

public enum Foo
{
    Bar,
    Baz,
}

public class A
{
    public int B(Foo foo) =>
        foo switch
        {
            Foo.Bar => 0,
            Foo.Baz => 1,
        };
}
  1. Create switch expression
  2. Notice that switch keyword is not syntax highlighted.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions