# E4221

Compiler diagnostic name: `control_in_with_pattern_default`.

A default expression in an or-pattern's `with` clause attempts to transfer
control with `return`, `break`, `continue`, or `raise`. The default must produce
a value locally and cannot leave its surrounding pattern.

## Erroneous example

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

## Suggestion

Use a plain value as the default and perform any control flow after the pattern
has matched.

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