Right now `match` is statement-only, so you can't use it on the right side of an assignment or directly in a return. You have to introduce a mutable binding and assign inside each arm:
```
mut result = 0
match shape {
Circle(r) => { result = 3 * r * r }
Rect(w, h) => { result = w * h }
}
return result
```
If `match` were an expression this would just be:
```
return match shape {
Circle(r) => 3 * r * r
Rect(w, h) => w * h
}
```
This pairs naturally with exhaustiveness checking — an exhaustive match expression has a well-defined type.
Right now `match` is statement-only, so you can't use it on the right side of an assignment or directly in a return. You have to introduce a mutable binding and assign inside each arm:
```
mut result = 0
match shape {
Circle(r) => { result = 3 * r * r }
Rect(w, h) => { result = w * h }
}
return result
```
If `match` were an expression this would just be:
```
return match shape {
Circle(r) => 3 * r * r
Rect(w, h) => w * h
}
```
This pairs naturally with exhaustiveness checking — an exhaustive match expression has a well-defined type.