1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Fix #1021 - Optional or branch doesn't define err

This commit is contained in:
Nick Treleaven
2019-07-06 13:52:50 +01:00
committed by Alexander Medvednikov
parent 8a2d25247f
commit af19aa5096
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
fn opt_err() ?string {return error('hi')}
fn test_err(){
v := opt_err() or {
assert err == 'hi'
return
}
assert false
println(v) // suppress not used error
}