www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - compiler crash!

reply pguerra.ar gmail.com writes:
The following piece of code crashes the compiler (at least the Win32 version).

int main()
{
int u=2;

switch(u)
{
case 1:
void j()
{
case 2:
u++;
}
break;
}
}
Jul 28 2005
parent BCS <BCS_member pathlink.com> writes:
In article <dccftv$o1b$1 digitaldaemon.com>, pguerra.ar gmail.com says...
The following piece of code crashes the compiler (at least the Win32 version).

int main()
{
int u=2;

switch(u)
{
case 1:
void j()
{
case 2:
u++;
}
break;
}
}
What the... Is that even legal?!? Yah, it shouldn't crash the compiler. But how the heck did you end up with having a case tag in a nested function???
Jul 29 2005