forked from AbleOS/holey-bytes
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}
|
||
|
}
|