authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-18 16:01:29+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-18 18:10:59+01:00
loga239d8d4e2c0e5a7f3eb4b9973f869afdb3bbe05
tree66e7d1d62876bb27414084283282c13317d123d9
parentb745fee1f8dddd92c7d112cd7440e6b540458051
signaturelock-open Commit is signed but in an unrecognized format.

test: add incremental case


1 files changed, 39 insertions(+), 0 deletions(-)

test/incremental/type_becomes_comptime_only created+39
...@@ -0,0 +1,39 @@
1#target=x86_64-linux
2#update=initial version
3#file=main.zig
4const SomeType = u32;
5const S = struct {
6 x: SomeType,
7 fn foo(_: S) void {}
8};
9pub 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
17const SomeType = comptime_int;
18const S = struct {
19 x: SomeType,
20 fn foo(_: S) void {}
21};
22pub 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
30const SomeType = u16;
31const S = struct {
32 x: SomeType,
33 fn foo(_: S) void {}
34};
35pub fn main() void {
36 const s: S = .{ .x = 456 };
37 s.foo();
38}
39#expect_stdout=""