# 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

This warning is turned off by default. Enable it with the `warnings` field in
`moon.pkg`:

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

```{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
```
