aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/tuple.zig
diff options
context:
space:
mode:
authorr00ster91 <r00ster91@proton.me>2023-03-03 09:42:34 +0100
committerVeikka Tuominen <git@vexu.eu>2023-03-04 01:08:03 +0200
commite0d390463865340adc8055d1e34c0bc7acf4e4c3 (patch)
tree10283dc3933cd09f489595ee06dc2e1e80136d26 /test/behavior/tuple.zig
parent75ff34db9e93056482233f8476a06f78b4a2f3c2 (diff)
downloadzig-e0d390463865340adc8055d1e34c0bc7acf4e4c3.tar.gz
zig-e0d390463865340adc8055d1e34c0bc7acf4e4c3.zip
Ast: properly handle sentinel-terminated slices in tuple
Co-authored-by: Veikka Tuominen <git@vexu.eu>
Diffstat (limited to 'test/behavior/tuple.zig')
-rw-r--r--test/behavior/tuple.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/behavior/tuple.zig b/test/behavior/tuple.zig
index 13b02b40e8..f7860be34e 100644
--- a/test/behavior/tuple.zig
+++ b/test/behavior/tuple.zig
@@ -397,3 +397,22 @@ test "nested runtime conditionals in tuple initializer" {
};
try expectEqualStrings("up", x[0]);
}
+
+test "sentinel slice in tuple with other fields" {
+ const S = struct {
+ a: u32,
+ b: u32,
+ };
+
+ const Submission = union(enum) {
+ open: struct { *S, [:0]const u8, u32 },
+ };
+
+ _ = Submission;
+}
+
+test "sentinel slice in tuple" {
+ const S = struct { [:0]const u8 };
+
+ _ = S;
+}