-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugInteractive-EnC
Milestone
Description
See this comment: https://github.com/dotnet/roslyn/pull/50270/files#r552284955
This issue is referenced in source.
For a simple switch expression:
class C
{
static string M(object o)
{
return o switch
{
int i => $"Number: {i}",
_ => "Don't know"
};
}
}There are nested scoped emitted, each with locals that have the same name, for i:
<scope startOffset="0x0" endOffset="0x3d">
<scope startOffset="0x1" endOffset="0x3b">
<local name="i" il_index="0" il_start="0x1" il_end="0x3b" attributes="0" />
<scope startOffset="0x16" endOffset="0x2b">
<local name="i" il_index="0" il_start="0x16" il_end="0x2b" attributes="0" />
</scope>
</scope>
</scope>This also shows up during debugging (note the duplicate is):

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-CompilersBugInteractive-EnC