mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: optionals default value
This commit is contained in:
committed by
Alexander Medvednikov
parent
4e64a58ac1
commit
df5faf35e5
@@ -46,6 +46,8 @@ fn test_defer_early_exit() {
|
||||
|
||||
fn test_defer_option() {
|
||||
mut ok := Num{0}
|
||||
set_num_opt(mut ok)
|
||||
set_num_opt(mut ok) or {
|
||||
assert false
|
||||
}
|
||||
assert ok.val == 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user