# E3024

Constructor function of `struct` must have name `new`.

This error happens when a constructor function declared inside a `struct` is
not named `new`. MoonBit treats `new` as the constructor entry point for the
struct.

## Erroneous example

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

## Suggestion

Rename the constructor function to `new`:

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