# E0005

Warning name: `unused_type_variable`

Unused generic type variable.

In some cases, using types with unused generic type variables will make it
impossible for the type checker to infer the type of the unused variable,
leading to [E0013](./E0013.md). This might lead to cryptic error messages, even
unexpected runtime behavior.

## Erroneous example

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

## Suggestion

- If the type variable is indeed useless, remove the unused type variable.

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

- If you wish to keep the type variable, you can use `_` to indicate that the
  type variable is intentionally unused.

  ```{literalinclude} /sources/error_codes/0005_fixed/top.mbt
  :language: moonbit
  :start-after: use underscore
  :end-before: end use underscore
  ```
