authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-02 21:01:07+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-03 00:48:04+02:00
log74285a4ed70848452f34623454d665daae7f9522
treea81156e6778b2c58c873ac05eb5e226f5cf806d8
parentf20e449fd6ad63c58e76670f230783d0dd399b93

add test for error message improved by self-hosted

Closes #5099

1 files changed, 17 insertions(+), 0 deletions(-)

test/cases/compile_errors/struct_type_mismatch_in_arg.zig created+17
......@@ -0,0 +1,17 @@
1const Foo = struct { i: i32 };
2const Bar = struct { j: i32 };
3
4pub fn helper(_: Foo, _: Bar) void { }
5
6comptime {
7 helper(Bar { .j = 10 }, Bar { .j = 10 });
8 helper(Bar { .i = 10 }, Bar { .j = 10 });
9}
10
11// error
12// backend=stage2
13// target=native
14//
15// :7:16: error: expected type 'tmp.Foo', found 'tmp.Bar'
16// :1:13: note: struct declared here
17// :2:13: note: struct declared here