What it means. During unification, the inference engine tried to substitute a type variable T with a type that contains T. That substitution would produce an infinite type (T = List[T] with nothing to bottom out at), so Hindley-Milner rejects it.
In practice it surfaces from:
The header reads error[GALA-E0022]: occurs check failed: <var> in <type>, naming the type variable and the type it would have to expand into, with a hint suggesting an annotation or a restructured recursion.
This diagnostic comes from the Hindley-Milner unification step and is raised without a source position, so the CLI prints no framed snippet. No output is quoted on this page because no source we can construct reaches the code: the shapes that would provoke an occurs-check failure are rejected earlier, by GALA-E0033 or GALA-E0034 for the untyped parameter they require, or by the Go compiler after transpilation. The code and message text above come from the emit site.
Add an explicit annotation at the recursion point so inference does not have to discover the fixpoint itself:
func length[T any](xs List[T]) int = xs.Size()
Or restructure the value so the recursion has a base case the inferer can see. If you meant to build a genuinely recursive data shape, model it as a sealed type with an explicit terminating variant — the type then names itself through a declared constructor rather than through an inferred variable.
Occurs-check failures are rare in straight-line GALA, and the underlying diagnostic is opaque unless you know what “occurs check” means. A dedicated code lets the documentation carry the explanation instead of cramming type theory into the error message.
Scope. Hindley-Milner unification only. The transpiler’s own recursive-type guard for Immutable[Immutable[T]] emits GALA-E0001.