v/vlib/v/parser/tests/defer_propagate.vv

17 lines
157 B
V

fn test1() ?int {
a := 3
return a
}
fn test2() ?int {
mut a := 0
defer {
a = test1()?
}
return a
fn main() {
x := test2() or { -1 }
println(x)
}