# E4082

Variable is not bound in all patterns.

When using the `|` operator in a pattern, all variables must be bound in all
patterns. If a variable were not bound in all patterns, it would be a free
variable when the pattern is matched, which is not allowed.

## Erroneous Example

```{literalinclude} /sources/error_codes/4082_error/top.mbt
:language: moonbit
```

## Suggestion

```{literalinclude} /sources/error_codes/4082_fixed/top.mbt
:language: moonbit
```
