authorgravatar for ian@ianjohnson.devIan Johnson <ian@ianjohnson.dev> 2023-10-02 23:29:29-04:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-10-03 16:01:08+03:00
log6734d2117e3520c1ef011609d0e2b2dd131a80aa
treeb2eaef46962a80ea8ebe4f17c0850bbb166b15b7
parentdf4853a6271b7963d77cafda7d6727274c6cbdaa

Add behavior test for empty tuple type

Closes #16412

1 files changed, 12 insertions(+), 0 deletions(-)

test/behavior/tuple.zig+12
...@@ -465,3 +465,15 @@ test "coerce anon tuple to tuple" {...@@ -465,3 +465,15 @@ test "coerce anon tuple to tuple" {
465 try expectEqual(x, s[0]);465 try expectEqual(x, s[0]);
466 try expectEqual(y, s[1]);466 try expectEqual(y, s[1]);
467}467}
468
469test "empty tuple type" {
470 const S = @Type(.{ .Struct = .{
471 .layout = .Auto,
472 .fields = &.{},
473 .decls = &.{},
474 .is_tuple = true,
475 } });
476
477 const s: S = .{};
478 try expect(s.len == 0);
479}