forked from AbleOS/holey-bytes
c553c3d9e9
Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
16 lines
222 B
Plaintext
16 lines
222 B
Plaintext
|
|
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}
|
|
}
|