Re: case statement allows for runtime values, a case of accepts-invalid?

2011-04-19 Thread Jesse Phillips
Andrej Mitrovic Wrote:

 int foo(ref int y)
 {
 y = 5;
 return y;
 }
 
 void main()
 {
 int x = 1;
 int y = 2;
 
 switch (x = foo(y))
 {
 case y:
 writeln(x == y);
 default:
 }
 
 assert(x == 5);
 assert(y == 5);
 }

Yes bug. Not this part though

 switch (x = foo(y))


Re: case statement allows for runtime values, a case of accepts-invalid?

2011-04-19 Thread Andrej Mitrovic
On 4/19/11, Jesse Phillips jessekphillip...@gmail.com wrote:
 Yes bug. Not this part though

 switch (x = foo(y))


Yeah that I know.

Do you happen to know if this bug is already filed or should I file it?


Re: case statement allows for runtime values, a case of accepts-invalid?

2011-04-19 Thread Andrej Mitrovic
*I've searched bugzilla and couldn't find an entry for this particular case.