1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/parser/tests/defer_propagate.vv
2022-05-13 06:56:21 +03:00

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