#zig build-obj {
--name test -fno-emit-bin
-Mroot=test.zig
#}

#write test.zig {
const X = struct {
    fn init() !X {
        return error.a;
    }

    fn a(x: X) void {
        _ = x;
    }
};

export fn entry() void {
    const x = X.init();
    x.a();
}
#}
#update
#check errors {
test.zig:13:6: error: no field or member function named 'a' in '@typeInfo(@typeInfo(@TypeOf(test.X.init)).@"fn".return_type.?).error_union.error_set!test.X'
test.zig:13:6: note: consider using 'try', 'catch', or 'if'
#}
