| 1 | // TODO: it'd be great if we could actually check that no analysis happened! |
| 2 | #update=initial version |
| 3 | #file=main.zig |
| 4 | pub fn main() void { |
| 5 | const ptr: *const O = @ptrFromInt(0x1000); |
| 6 | _ = ptr; |
| 7 | } |
| 8 | const S = struct { foo: u32, nested: struct { x: u16 } }; |
| 9 | const U = union(enum) { a, b, c: S }; |
| 10 | const E = enum(u8) { a = @typeInfo(U).@"union".field_names.len, b = 0, c }; |
| 11 | const O = opaque { |
| 12 | comptime { |
| 13 | _ = @as(S, undefined); |
| 14 | _ = @as(U, undefined); |
| 15 | _ = @as(E, undefined); |
| 16 | const Wrapper = struct { val: S }; |
| 17 | const wrapper: Wrapper = .{ .val = .{ .foo = 123, .nested = .{ .x = 456 } } }; |
| 18 | _ = wrapper; |
| 19 | } |
| 20 | }; |
| 21 | #expect_stdout="" |
| 22 | #update=do literally nothing |
| 23 | #file=main.zig |
| 24 | pub fn main() void { |
| 25 | const ptr: *const O = @ptrFromInt(0x1000); |
| 26 | _ = ptr; |
| 27 | } |
| 28 | const S = struct { foo: u32, nested: struct { x: u16 } }; |
| 29 | const U = union(enum) { a, b, c: S }; |
| 30 | const E = enum(u8) { a = @typeInfo(U).@"union".field_names.len, b = 0, c }; |
| 31 | const O = opaque { |
| 32 | comptime { |
| 33 | _ = @as(S, undefined); |
| 34 | _ = @as(U, undefined); |
| 35 | _ = @as(E, undefined); |
| 36 | const Wrapper = struct { val: S }; |
| 37 | const wrapper: Wrapper = .{ .val = .{ .foo = 123, .nested = .{ .x = 456 } } }; |
| 38 | _ = wrapper; |
| 39 | } |
| 40 | }; |
| 41 | #expect_stdout="" |