add error tests for now correctly behaving cases

Closes #6377
This commit is contained in:
Veikka Tuominen 2022-08-28 13:17:25 +03:00
parent 1401890ed5
commit 6aead18ab3
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,10 @@
pub export fn entry() void {
_ = .{ .a = 0, .a = 1 };
}
// error
// backend=stage2
// target=native
//
// :2:21: error: duplicate field
// :2:13: note: other field here

View File

@ -0,0 +1,14 @@
const MyStruct = struct { x: i32 };
fn hi(comptime T: type) usize {
return @sizeOf(T);
}
export const value = hi(MyStruct{ .x = 12 });
// error
// backend=stage2
// target=native
//
// :7:33: error: expected type 'type', found 'tmp.MyStruct'
// :1:18: note: struct declared here