Commit 74285a4ed7

Veikka Tuominen <git@vexu.eu>
2022-12-02 20:01:07
add test for error message improved by self-hosted
Closes #5099
1 parent f20e449
Changed files (1)
test
cases
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