Skip to content

Commit 6734d21

Browse files
ianprime0509Vexu
authored andcommitted
Add behavior test for empty tuple type
Closes #16412
1 parent df4853a commit 6734d21

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/behavior/tuple.zig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,15 @@ test "coerce anon tuple to tuple" {
465465
try expectEqual(x, s[0]);
466466
try expectEqual(y, s[1]);
467467
}
468+
469+
test "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+
}

0 commit comments

Comments
 (0)