| 1 |
/** |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/code_global_scope.d(18): Error: `switch` statement must be inside function scope |
| 5 |
fail_compilation/code_global_scope.d(19): Error: `do` statement must be inside function scope |
| 6 |
fail_compilation/code_global_scope.d(20): Error: `foreach` statement must be inside function scope |
| 7 |
fail_compilation/code_global_scope.d(21): Error: `while` statement must be inside function scope |
| 8 |
fail_compilation/code_global_scope.d(22): Error: `if` statement must be inside function scope |
| 9 |
fail_compilation/code_global_scope.d(23): Error: `return` statement must be inside function scope |
| 10 |
fail_compilation/code_global_scope.d(24): Error: `goto` statement must be inside function scope |
| 11 |
fail_compilation/code_global_scope.d(25): Error: `continue` statement must be inside function scope |
| 12 |
fail_compilation/code_global_scope.d(26): Error: `break` statement must be inside function scope |
| 13 |
--- |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
switch s; |
| 19 |
do d; |
| 20 |
foreach (i; 0 .. 4) {} |
| 21 |
while (x) {} |
| 22 |
if (y) {} |
| 23 |
return 0; |
| 24 |
goto A; |
| 25 |
continue B; |
| 26 |
break; |