# E0029

Warning name: `unused_package`

This warning is emitted when a package is listed as an import but the current
package does not use that import directly. Explicit imports from
`moonbitlang/core` are checked as well.

Finding a method or trait implementation through a value's type does not by
itself make an explicit import necessary. An import used only for such indirect
lookup may therefore still be reported as unused.

## Erroneous example

```{literalinclude} /sources/error_codes/0029_error/moon.mod
:caption: moon.mod
:language: moonbit
```

```{literalinclude} /sources/error_codes/0029_error/lib/moon.pkg
:caption: lib/moon.pkg
```

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

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

## Suggestion

Remove the unused package. If the code needs an API from that package directly,
refer to it through the package alias instead:

```{literalinclude} /sources/error_codes/0029_fixed/moon.pkg
:caption: moon.pkg
```
