C# 7 pattern matching semantics

后端 未结 1 419
难免孤独
难免孤独 2021-01-25 08:15

I have the two blocks of code that I would like to think are equal:

First the if based block

Then the exact same but converted to switch case over

相关标签:
1条回答
  • 2021-01-25 08:44

    This is a known bug when you capture (in a lambda) a pattern variable that was declared in a switch statement. See https://github.com/dotnet/roslyn/issues/16066

    0 讨论(0)
提交回复
热议问题