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