# M0157

This error means that a type definition, or set of type definitions, is ill-defined.

A type is _productive_ if recursively expanding any outermost type constructor in its definition
eventually produces a type other than the application of a type constructor.

Motoko requires all type declarations to be productive.

For example, the type definitions:

```motoko
type Person = { first : Text; last : Text };

type List<T> = ?(T, List<T>);

type Fst<T, U> = T;

type Ok<T> = Fst<Any, Ok<T>>;
```

are all productive and legal.

But the type definitions,

```motoko
type C = C;

type D<T, U> = D<U, T>;

type E<T> = F<T>;
type F<T> = E<T>;

type G<T> = Fst<G<T>, Any>;
```

are all non-productive, since each definition will enter a loop after one or more
expansions of its body.

If you encounter this error, try to restructure your type definitions to be productive.
