dotnet / csharp-tmLanguage

Syntax grammar used for C# colorization
MIT License
69 stars 34 forks source link

boolean literals in `when` clause of `switch` statement #321

Open sharpchen opened 6 months ago

sharpchen commented 6 months ago

Details

What editor are you seeing the problem in? (e.g. Atom, Visual Studio Code, etc.) vscode What version of the editor are you using? 1.88.1 What color theme are you using? darkplus

Repro

_ = (1, '2', "3") switch
{
    (var a, 'b', _) when a > 0 == true => 1,
    (object, _, string s) when s.Length > 2 == false => 2,
    var _ when false => 3,
    var _ when true => 4,
};

code

Please provide a code example and (optionally) a screenshot demonstrating the problem.