#exe {
-Mroot=main.zig
#}

#write main.zig {
//! The original repro here depends on re-analysis order, which depends on
//! declaration order, so this exact declaration order must be used.
const Foo = struct { x: u8 };
pub fn main(init: std.process.Init) !void {
    const c = bar('Z').x;
    try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
}
fn bar(comptime x: u8) @This().Foo {
    return .{ .x = x };
}
const std = @import("std");
#}
#update
#check stdout {
Z
#}

#write main.zig {
//! The original repro here depends on re-analysis order, which depends on
//! declaration order, so this exact declaration order must be used.
const Foo = struct { x: u8 };
pub fn main(init: std.process.Init) !void {
    const c = bar('Z').x;
    try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
}
fn bar(comptime x: u8) @This().FooAlias {
    return .{ .x = x };
}
const std = @import("std");
#}
#update {
change generic signature to use non-existent member#}
#check errors {
main.zig:8:31: error: root source file struct 'main' has no member named 'FooAlias'
main.zig:1:1: note: struct declared here
#}

#write main.zig {
//! The original repro here depends on re-analysis order, which depends on
//! declaration order, so this exact declaration order must be used.
const Foo = struct { x: u8 };
const FooAlias = Foo;
pub fn main(init: std.process.Init) !void {
    const c = bar('Z').x;
    try std.Io.File.stdout().writeStreamingAll(init.io, &.{ c, '\n' });
}
fn bar(comptime x: u8) @This().FooAlias {
    return .{ .x = x };
}
const std = @import("std");
#}
#update {
add that member, fixing the error#}
#check stdout {
Z
#}
