Version Used:
Microsoft Visual Studio Professional 2019 Preview
Version 16.7.0 Preview 3.1
VisualStudio.16.Preview/16.7.0-pre.3.1+30223.230
Microsoft .NET Framework
Version 4.8.03752
Steps to Reproduce:
static class Program
{
public static void Main()
{
switch ("".Length)
{
case var i when "".Length switch { var y => y > 0 }:
{
break;
}
}
}
}
Expected Behavior:
The suggestion to remove the variable i doesn't break compilation
Actual Behavior:
The code is not compileable after the "fix"

static class Program
{
public static void Main()
{
switch ("".Length)
{
case _ when "".Length switch { var y => y > 0 }:
{
break;
}
}
}
}
Error CS0103: The name '_' does not exist in the current context (12, 12)
Version Used:
Steps to Reproduce:
Expected Behavior:
The suggestion to remove the variable
idoesn't break compilationActual Behavior:

The code is not compileable after the "fix"