Bend/tests/golden_tests/run_file/do_block_mixed.bend
2024-06-21 20:19:43 +02:00

18 lines
300 B
Plaintext

# Mixed contents in a `do` block should still work.
Result/bind r nxt = match r {
Result/Ok: ((undefer nxt) r.val)
Result/Err: r
}
main = with Result {
let x = 1
let y = (Result/Ok x)
ask y = y
if (+ x y) {
ask w = (Result/Ok x)
(Result/Ok w)
} else {
(Result/Err 0)
}
}