holey-bytes/foo.hb

16 lines
222 B
Plaintext
Raw Normal View History

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}
}