# E3023

Compiler diagnostic name: `invalid_grouped_impls`.

Invalid grouped `impl` declaration.

MoonBit does not use Rust-style grouped `impl` blocks. Each trait
implementation or method implementation is written as a single `impl ... with
method(...) { ... }` declaration.

## Erroneous example

The following example tries to put a method body inside an `impl ... { ... }`
block:

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

MoonBit will report an error.

## Suggestion

Move the method name and body into the `with` clause of the `impl` declaration:

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