# E0007

Warning name: `unused_field`

Field is never read. This include fields in structs and fields in enum
constructors.

## Erroneous example

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

## Suggestion

- If the fields in enum constructors are unused, you can expand them in the
  pattern to use them:

  ```{literalinclude} /sources/error_codes/0007_fixed/top.mbt
  :language: moonbit
  :start-after: expand pattern
  :end-before: end expand pattern
  ```

- If the fields are indeed useless, you can remove the field from the
  constructor:

  ```{literalinclude} /sources/error_codes/0007_fixed/top.mbt
  :language: moonbit
  :start-after: remove unused
  :end-before: end remove unused
  ```

- If the fields are expected to be used by the others, you can mark the type as
  `pub` or `pub(all)`.

  ```{literalinclude} /sources/error_codes/0007_fixed/top.mbt
  :language: moonbit
  :start-after: make public
  :end-before: end make public
  ```