Comment #0 by moonlightsentinel — 2022-04-07T12:47:47Z
Forward-references to a case inside the same switch works:
void foo(int i, int j)
{
final switch (i)
{
case 1:
break;
case 2:
final switch (j)
{
case 4:
goto case 3;
case 3:
break;
}
break;
}
}
But fails if the forward-referenced case belongs to an enclosing switch statement:
void foo(int i, int j)
{
final switch (i)
{
case 1:
break;
case 2:
final switch (j)
{
case 4:
// goto case 1; // ok
goto case 3; // fails
}
break;
case 3:
break;
}
}
Comment #1 by robert.schadek — 2024-12-13T19:22:10Z