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:
@@ -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)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user