Open mavasani opened 7 years ago
The problem is not specific to pattern switch statement, it affects regular switch
as well, regular locals can be declared inside a switch and they are scoped to the switch.
Design Team Decision For switch statement and section we should expose the locals
@jinujoseph Pushing this out, its a new API.
C# declaration patterns declare locals which are owned by the enclosing statement nodes. We need to ensure that these locals are correctly exposed off the enclosing pattern case clause and pattern switch statement (for patterns in switch statement) and off the enclosing statement for is pattern expression.
As part of this work, we also need to add unit tests. See https://github.com/dotnet/roslyn/pull/20276/files#r122779797