aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>2023-11-25 17:05:51 +0300
committerGitHub <noreply@github.com>2023-11-25 14:05:51 +0000
commitbece97ef248ad36d31a48fb761b4a41324c9c5d5 (patch)
tree14a254df83aa69e8296270e13df68753fca57c02 /test
parent2fefc0b5c7618012916e75e3058b381cf48f0ebb (diff)
downloadzig-bece97ef248ad36d31a48fb761b4a41324c9c5d5.tar.gz
zig-bece97ef248ad36d31a48fb761b4a41324c9c5d5.zip
Sema: ensure tuple fields is resolved and fix internal out-of-bounds access
Diffstat (limited to 'test')
-rw-r--r--test/behavior/struct.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig
index 56231a9fea..7eb5e62282 100644
--- a/test/behavior/struct.zig
+++ b/test/behavior/struct.zig
@@ -1881,3 +1881,12 @@ test "field calls do not force struct field init resolution" {
_ = &s;
try expect(s.x == 123);
}
+
+test "tuple with comptime-only field" {
+ const x = getTuple();
+ try expect(x.@"0" == 0);
+}
+
+fn getTuple() struct { comptime_int } {
+ return struct { comptime comptime_int = 0 }{0};
+}