aboutsummaryrefslogtreecommitdiff
path: root/test/cases
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases')
-rw-r--r--test/cases/compile_errors/missing_field_in_struct_value_expression.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cases/compile_errors/missing_field_in_struct_value_expression.zig b/test/cases/compile_errors/missing_field_in_struct_value_expression.zig
index eec50ee1af..d0b09643b8 100644
--- a/test/cases/compile_errors/missing_field_in_struct_value_expression.zig
+++ b/test/cases/compile_errors/missing_field_in_struct_value_expression.zig
@@ -13,9 +13,23 @@ export fn f() void {
_ = a;
}
+const B = struct { u32, u32 };
+export fn g() void {
+ const b = B{0};
+ _ = b;
+}
+export fn h() void {
+ const c = B{};
+ _ = c;
+}
// error
// backend=stage2
// target=native
//
// :9:16: error: missing struct field: x
// :1:11: note: struct 'tmp.A' declared here
+// :18:16: error: missing tuple field with index 1
+// :16:11: note: struct declared here
+// :22:16: error: missing tuple field with index 0
+// :22:16: note: missing tuple field with index 1
+// :16:11: note: struct 'tmp.B' declared here