# E0004

Warning name: `missing_priv`

The abstract type does not occur in public signature of current package,
consider marking it as `priv`.

If an abstract type is not used elsewhere in the public interface of a package,
then it is not possible for user to interact with the value of that type in any
way. Therefore, it is highly probable that the type is part of the private
implementation of the package. In this case, it is better to mark the type as
`priv` to indicate that it is not part of the public interface of the package.

It is also possible that, this abstract type is part of the public interface of
the package, but relevant functions, methods, or types are not marked as `pub`.

This warning is not emitted inside `main` packages which are usually not
intended to be used by others anyway. Likewise, it is not emitted inside
[whitebox test and blackbox test](/language/tests.md#blackbox-tests-and-whitebox-tests)
files.

## Erroneous example

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

## Suggestion

If the abstract type is not part of the public interface of the package, then it
should be marked as `priv`:

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

Or, if the abstract type is part of the public interface of the package, then
make relevant definitions `pub`:

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