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

all: change index expr returning optional to result too (#16097)

This commit is contained in:
yuyi
2022-10-20 02:04:16 +08:00
committed by GitHub
parent eda65ad660
commit 612faac0f0
14 changed files with 63 additions and 47 deletions

View File

@@ -1290,7 +1290,7 @@ large_index := 999
val := arr[large_index] or { panic('out of bounds') }
println(val)
// you can also do this, if you want to *propagate* the access error:
val2 := arr[333]?
val2 := arr[333]!
println(val2)
```