| author | |
| committer | |
| log | 6aead18ab332a3cf809b5c824d70cdc52f0e5156 |
| tree | 356d513370db47c2159c534e02cf91514d2ba914 |
| parent | 1401890ed5194aff3469be0b6919fd8fe2614c7b |
Closes #63772 files changed, 24 insertions(+), 0 deletions(-)
test/cases/compile_errors/duplicate_field_in_discarded_anon_init.zig created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | pub export fn entry() void { | |
| 2 | _ = .{ .a = 0, .a = 1 }; | |
| 3 | } | |
| 4 | ||
| 5 | // error | |
| 6 | // backend=stage2 | |
| 7 | // target=native | |
| 8 | // | |
| 9 | // :2:21: error: duplicate field | |
| 10 | // :2:13: note: other field here |
test/cases/compile_errors/struct_init_passed_to_type_param.zig created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | const MyStruct = struct { x: i32 }; | |
| 2 | ||
| 3 | fn hi(comptime T: type) usize { | |
| 4 | return @sizeOf(T); | |
| 5 | } | |
| 6 | ||
| 7 | export const value = hi(MyStruct{ .x = 12 }); | |
| 8 | ||
| 9 | // error | |
| 10 | // backend=stage2 | |
| 11 | // target=native | |
| 12 | // | |
| 13 | // :7:33: error: expected type 'type', found 'tmp.MyStruct' | |
| 14 | // :1:18: note: struct declared here |