1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/compiler/tests/defer_test.v
Alexander Medvednikov ac238a5362 allow multiple defers
2019-07-21 16:34:21 +02:00

17 lines
237 B
Go

fn foo() string {
println('foo()')
return 'foo'
}
fn foo2() string {
println('start')
defer { println('defer') }
defer { println('defer2') }
println('end')
return foo()
}
fn test_defer() {
assert foo2() == 'foo'
}