Res := fn($O: type, $E: type): type return union(enum) { ok: O, err: E, } main := fn(): uint { r := do_something() if r == .err return v.err return v.ok } do_something := fn(): Res(uint, uint) { return .{ok: 0} }