mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
15 lines
178 B
V
15 lines
178 B
V
fn func1() ?int {
|
|
return 0
|
|
}
|
|
|
|
fn func2() ?(int, int) {
|
|
return func1()?, 1
|
|
}
|
|
|
|
fn test_return_optional() ? {
|
|
a, b := func2()?
|
|
println('$a, $b')
|
|
assert a == 0
|
|
assert b == 1
|
|
}
|