Skip to content
TE152 · Type · error

Recursive `@inline(always)` contract

An always-inline body cannot recursively expand itself; use a hint or split the recursive core.

An always-inline function calls itself directly. Expanding it would never reach a finite body.

Use bare @inline to make the policy a hint, or split the recursive core from a small non-recursive wrapper.

@inline
fn factorial(n: int) -> int {
  if n <= 1 { 1 } else { n * factorial(n - 1) }
}

See the typed inline specification.

Search Zolo

9 results

en