This happens in CRC and CRR. This is for C#.
If the right hand side of an IF statement is NOT a constant, it should not offer to convert it to a switch statement.
int x;
int y;
int z;
if (x == y)
{
}
else
{
if (x == z)
{
}
should NOT offer to convert as that is not legal code in a switch statement unless Y and Z are constants.
Hi Brien,
Thank you for pointing out this issue.
I have reproduced it in CRC and CRR, and passed this ticket to our developers for research.
We will notify you when we have any results.