# E0031

Warning name: `unused_optional_argument`

The optional argument is never supplied. If the optional argument is never
supplied, then it can be safely removed from the parameter list and be used
purely internally as a normal variable.

## Erroneous example

Note, this warning is turned off by default. To enable this warning, you have to
modify the `"warn-list"` of `moon.pkg.json`:

```{literalinclude} /sources/error_codes/0031_error/moon.pkg.json
:caption: moon.pkg.json
```

```{literalinclude} /sources/error_codes/0031_error/top.mbt
:language: moonbit
:caption: main.mbt
```

## Suggestion

You can remove the optional argument, and use a local variable definition
instead:

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