add test for error message improved by self-hosted

Closes #5099
This commit is contained in:
Veikka Tuominen 2022-12-02 21:01:07 +02:00
parent f20e449fd6
commit 74285a4ed7

View File

@ -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