mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parent
1401890ed5
commit
6aead18ab3
@ -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
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user