1#exe {
2-Mroot=main.zig
3#}
4
5#write main.zig {
6//! The original repro here depends on re-analysis order, which depends on
7//! declaration order, so this exact declaration order must be used.
8const Foo = struct { x: u8 };
9pub fn main(init: std.process.Init) !void {
10 const c = bar('Z').x;
11 try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
12}
13fn bar(comptime x: u8) @This().Foo {
14 return .{ .x = x };
15}
16const std = @import("std");
17#}
18#update
19#check stdout {
20Z
21#}
22
23#write main.zig {
24//! The original repro here depends on re-analysis order, which depends on
25//! declaration order, so this exact declaration order must be used.
26const Foo = struct { x: u8 };
27pub fn main(init: std.process.Init) !void {
28 const c = bar('Z').x;
29 try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
30}
31fn bar(comptime x: u8) @This().FooAlias {
32 return .{ .x = x };
33}
34const std = @import("std");
35#}
36#update "change generic signature to use non-existent member"
37#check errors {
38main.zig:8:31: error: root source file struct 'main' has no member named 'FooAlias'
39main.zig:1:1: note: struct declared here
40#}
41
42#write main.zig {
43//! The original repro here depends on re-analysis order, which depends on
44//! declaration order, so this exact declaration order must be used.
45const Foo = struct { x: u8 };
46const FooAlias = Foo;
47pub fn main(init: std.process.Init) !void {
48 const c = bar('Z').x;
49 try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
50}
51fn bar(comptime x: u8) @This().FooAlias {
52 return .{ .x = x };
53}
54const std = @import("std");
55#}
56#update "add that member, fixing the error"
57#check stdout {
58Z
59#}