#update=initial version
#file=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");
#expect_stdout="Z\n"

#update=change generic signature to use non-existent member
#file=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");
#expect_error=main.zig:8:31: error: root source file struct 'main' has no member named 'FooAlias'
#expect_error=main.zig:1:1: note: struct declared here

#update=add that member, fixing the error
#file=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");
#expect_stdout="Z\n"
