Add value-returning match expressions
This commit is contained in:
parent
b0a52de4ea
commit
ab783c33ed
12 changed files with 384 additions and 14 deletions
|
|
@ -225,6 +225,15 @@ func (c *mutabilityChecker) checkExpr(expr Expr) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
case MatchExpr:
|
||||
if err := c.checkExpr(e.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, matchCase := range e.Cases {
|
||||
if err := c.checkExpr(matchCase.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case LambdaExpr:
|
||||
bindings := map[string]bool{}
|
||||
if e.ImplicitIt {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue