| 1 | export fn f1() void { |
| 2 | const x: usize = for ("hello") |_| {}; |
| 3 | _ = x; |
| 4 | } |
| 5 | export fn f2() void { |
| 6 | const x: usize = for ("hello") |_| { |
| 7 | break; |
| 8 | }; |
| 9 | _ = x; |
| 10 | } |
| 11 | export fn f3() void { |
| 12 | var t: bool = true; |
| 13 | _ = &t; |
| 14 | const x: usize = while (t) { |
| 15 | break; |
| 16 | }; |
| 17 | _ = x; |
| 18 | } |
| 19 | export fn f4() void { |
| 20 | const x: usize = blk: { |
| 21 | break :blk; |
| 22 | }; |
| 23 | _ = x; |
| 24 | } |
| 25 | |
| 26 | // error |
| 27 | // |
| 28 | // :2:22: error: expected type 'usize', found 'void' |
| 29 | // :7:9: error: expected type 'usize', found 'void' |
| 30 | // :15:9: error: expected type 'usize', found 'void' |
| 31 | // :21:9: error: expected type 'usize', found 'void' |