Instrução C # Switch com / sem colchetes ... qual é a diferença?
O C # sempre permitiu omitir colchetes dentro de umswitch()
declaração entre ocase:
afirmações?
Qual é o efeito de omiti-los, como costumam fazer os programadores de javascript?
Exemplo:
switch(x)
{
case OneWay:
{ // <---- Omit this entire line
int y = 123;
FindYou(ref y);
break;
} // <---- Omit this entire line
case TheOther:
{ // <---- Omit this entire line
double y = 456.7; // legal!
GetchaGetcha(ref y);
break;
} // <---- Omit this entire line
}