# E4131

The type alias is a function type, not a type constructor.

This error occurs when you try to define a method for a type alias. Aliases of a
type can be used interchangeably with the type itself, and it is not possible to
define method for function types. Therefore, MoonBit disallows defining methods
for type aliases of function types.

## Erroneous example

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

## Suggestion

If you want to define a method for a function type, you should define a new type
that wraps the function type:

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