blob: 136dfacc2dceca6b7bb849180e067c5ad1ce97a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
export fn foo() void {
const x, const y = 123;
_ = .{ x, y };
}
export fn bar() void {
var x: u32 = undefined;
x, const y: u64 = blk: {
if (false) break :blk .{ 1, 2 };
const val = .{ 3, 4, 5 };
break :blk val;
};
_ = y;
}
// error
//
// :2:24: error: type 'comptime_int' cannot be destructured
// :2:22: note: result destructured here
// :11:20: error: expected 2 elements for destructure, found 3
// :8:21: note: result destructured here
|