Invalid pattern matching in switch expression leads to csc.exe exited with code -2146232797 and does not show the real error in visual studio.
Steps to Reproduce:
- Add the following code to an empty project:
public class Class1
{
public class Inner1
{
}
}
public class Class2
{
public bool Test()
{
Class1 test = new Class1.Inner1();
test switch
{
{ Inner1: "" } => ""
};
}
}
- Build the project
Expected Behavior:
It should output an error that the {Inner1: ""} pattern is wrong.
Actual Behavior:
Compiler crashes and does not report the error.
Invalid pattern matching in switch expression leads to csc.exe exited with code -2146232797 and does not show the real error in visual studio.
Steps to Reproduce:
Expected Behavior:
It should output an error that the
{Inner1: ""}pattern is wrong.Actual Behavior:
Compiler crashes and does not report the error.