| ... | @@ -0,0 +1,39 @@ |
| 1 | #target=x86_64-linux |
| 2 | #update=initial version |
| 3 | #file=main.zig |
| 4 | const SomeType = u32; |
| 5 | const S = struct { |
| 6 | x: SomeType, |
| 7 | fn foo(_: S) void {} |
| 8 | }; |
| 9 | pub fn main() void { |
| 10 | const s: S = .{ .x = 456 }; |
| 11 | s.foo(); |
| 12 | } |
| 13 | #expect_stdout="" |
| 14 | |
| 15 | #update=make S comptime-only |
| 16 | #file=main.zig |
| 17 | const SomeType = comptime_int; |
| 18 | const S = struct { |
| 19 | x: SomeType, |
| 20 | fn foo(_: S) void {} |
| 21 | }; |
| 22 | pub fn main() void { |
| 23 | const s: S = .{ .x = 456 }; |
| 24 | s.foo(); |
| 25 | } |
| 26 | #expect_stdout="" |
| 27 | |
| 28 | #update=make S runtime again |
| 29 | #file=main.zig |
| 30 | const SomeType = u16; |
| 31 | const S = struct { |
| 32 | x: SomeType, |
| 33 | fn foo(_: S) void {} |
| 34 | }; |
| 35 | pub fn main() void { |
| 36 | const s: S = .{ .x = 456 }; |
| 37 | s.foo(); |
| 38 | } |
| 39 | #expect_stdout="" |