Commit 74285a4ed7
Changed files (1)
test
cases
compile_errors
test/cases/compile_errors/struct_type_mismatch_in_arg.zig
@@ -0,0 +1,17 @@
+const Foo = struct { i: i32 };
+const Bar = struct { j: i32 };
+
+pub fn helper(_: Foo, _: Bar) void { }
+
+comptime {
+ helper(Bar { .j = 10 }, Bar { .j = 10 });
+ helper(Bar { .i = 10 }, Bar { .j = 10 });
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :7:16: error: expected type 'tmp.Foo', found 'tmp.Bar'
+// :1:13: note: struct declared here
+// :2:13: note: struct declared here