docs: update wording & fix typo

pull/5387/head
joe-conigliaro 2020-06-19 01:52:21 +10:00
parent 98a48ecfb9
commit f526754535
No known key found for this signature in database
GPG Key ID: C12F7136C08206F1
1 changed files with 5 additions and 3 deletions

View File

@ -1204,13 +1204,15 @@ There are 3 ways to access the cast variant inside a match branch:
UnaryExpr { unary_expr(expr) }
...
}
// using `as` so specify a variable
// using `as` to specify a variable
match expr as actual_expr {
IfExpr { if_expr(actual_expr) }
...
}
```
Note: shadowing only works when the match expression is a variable. It will not work on struct fields, arrays indexing, or map key lookup.
## Option/Result types and error handling
```v