Break in C# code and evaluate the following expression in the EE:
new Action<int>(x =>
{
int F(int y)
{
switch (y)
{
case > 0: return 1;
case < 0: return -1;
case 0: return 0;
default: return 0;
}
}
F(x);
}).Invoke(1)
Result: NullReferenceException in AbstractFlowPass<,>.IsTraditionalSwitch() since compilation == null.
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.AbstractFlowPass<Microsoft.CodeAnalysis.CSharp.ControlFlowPass.LocalState, Microsoft.CodeAnalysis.CSharp.ControlFlowPass.LocalFunctionState>.IsTraditionalSwitch(Microsoft.CodeAnalysis.CSharp.BoundSwitchStatement node) Line 96 C#
...
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Binder.BindLocalFunctionStatement.__runAnalysis|872_0(Microsoft.CodeAnalysis.CSharp.BoundBlock block, Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag blockDiagnostics, ref Microsoft.CodeAnalysis.CSharp.Binder.<>c__DisplayClass872_0 value) Line 605 C#
...
Break in C# code and evaluate the following expression in the EE:
Result:
NullReferenceExceptioninAbstractFlowPass<,>.IsTraditionalSwitch()sincecompilation == null.