1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
d2verb
2019-07-15 23:15:34 +09:00
committed by Alexander Medvednikov
parent 5a9116b697
commit 40ad868f22
2 changed files with 32 additions and 8 deletions

View File

@ -8,3 +8,18 @@ fn test_err(){
assert false
println(v) // suppress not used error
}
fn err_call(ok bool) ?int {
if !ok {
return error('Not ok!')
}
return 42
}
fn test_option_for_base_type_without_variable() {
val := err_call(true) or {
panic(err)
return
}
assert val == 42
}