Add behavior test for empty tuple type

Closes #16412
This commit is contained in:
Ian Johnson 2023-10-02 23:29:29 -04:00 committed by Veikka Tuominen
parent df4853a627
commit 6734d2117e

View File

@ -465,3 +465,15 @@ test "coerce anon tuple to tuple" {
try expectEqual(x, s[0]);
try expectEqual(y, s[1]);
}
test "empty tuple type" {
const S = @Type(.{ .Struct = .{
.layout = .Auto,
.fields = &.{},
.decls = &.{},
.is_tuple = true,
} });
const s: S = .{};
try expect(s.len == 0);
}