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.