# E0011

Warning name: `partial_match`

Partial match. The match/guard/loop expression does not cover all possible
cases.

## Erroneous example

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

## Suggestion

The warning message usually contains hints about the missing patterns. Add the missing cases to avoid incomplete matches.
You can use [quick fix](https://code.visualstudio.com/docs/editing/refactoring#_code-actions-quick-fixes-and-refactorings)
when using [VSCode Plugin](/toolchain/vscode/index.md#actions).

```{literalinclude} /sources/error_codes/0011_fixed/example0.mbt
:language: moonbit
```

Or, you can use `is` syntax to use this pattern matching as a condition:

```{literalinclude} /sources/error_codes/0011_fixed/example1.mbt
:language: moonbit
```

Or, you can add a wildcard pattern to catch all remaining cases:

```{literalinclude} /sources/error_codes/0011_fixed/example2.mbt
:language: moonbit
```
