# E3024

Legacy constructor functions declared inside a `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

Define the constructor with the current top-level `Type::Type` form:

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