# E4036

Cannot create values of the read-only type.

## Erroneous Example

In `lib/lib.mbt`, we declare a struct `R` with a private field `__private`:

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

In `main/main.mbt`, we try to create a value of type `R`:

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

This gives the following error on line 1:

```
Cannot create values of struct type @lib.R because it contains private field(s).
```

## Suggestion

Construct the value using the public constructor:

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