# E4191

Compiler diagnostic name: `mbt_check_non_test_toplevel`.

Non-test toplevel in an `mbt check` documentation block.

Code fences marked as `mbt check` in doc comments are treated as document-test
blocks. These blocks should contain test toplevels, such as `test { ... }`.
Ordinary toplevel declarations are skipped and reported with this diagnostic.

## Erroneous example

The following `mbt check` block declares a normal helper function:

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

MoonBit will report an error.

## Suggestion

Move the checked code into a `test { ... }` block:

```{literalinclude} /sources/error_codes/4191_fixed/top.mbt
:language: moonbit
```
