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

parser: disallow match expr at certain places (#6490)

This commit is contained in:
Swastik Baranwal
2020-10-03 19:00:58 +05:30
committed by GitHub
parent a9da4dd437
commit 7e13518cc2
8 changed files with 71 additions and 18 deletions

View File

@ -933,6 +933,8 @@ Note that the ranges use `...` (three dots) rather than `..` (two dots). This is
because the range is *inclusive* of the last element, rather than exclusive
(as `..` ranges are). Using `..` in a match branch will throw an error.
Note: `match` as an expression is not usable in `for` loop and `if` statements.
### Defer
A defer statement defers the execution of a block of statements until the surrounding function returns.