mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-13 22:36:19 +01:00
Sema: handle sentinels in tupleToArray
This commit is contained in:
parent
ffa6f895ff
commit
b9dcbe6b4c
2 changed files with 20 additions and 3 deletions
|
|
@ -582,3 +582,14 @@ test "array with comptime only element type" {
|
|||
try testing.expect(a[0] == u32);
|
||||
try testing.expect(a[1] == i32);
|
||||
}
|
||||
|
||||
test "tuple to array handles sentinel" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
|
||||
const S = struct {
|
||||
const a = .{ 1, 2, 3 };
|
||||
var b: [3:0]u8 = a;
|
||||
};
|
||||
try expect(S.b[0] == 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue