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

#write test.zig {
fn maybe(is: bool) ?u8 {
    if (is) return @as(u8, 10) else return null;
}
const U = union {
    Ye: u8,
};
const S = struct {
    num: u8,
};
export fn entry() void {
    var u = U{ .Ye = maybe(false) };
    var s = S{ .num = maybe(false) };
    _ = &u;
    _ = &s;
}
#}
#update
#check errors {
test.zig:11:20: error: expected type 'u8', found '?u8'
test.zig:11:20: note: cannot convert optional to payload type
test.zig:11:20: note: consider using '.?', 'orelse', or 'if'
#}
