mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
parent
f20e449fd6
commit
74285a4ed7
17
test/cases/compile_errors/struct_type_mismatch_in_arg.zig
Normal file
17
test/cases/compile_errors/struct_type_mismatch_in_arg.zig
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user