unbalanced-recursion-error ( word height -- * ) (original) (raw)

unbalanced-recursion-error ( word height -- * )
Factor handbook » The language » Stack effect checking » Stack checker errors

Prev: diverging-recursion-error ( word -- * )
Next: inconsistent-recursive-call-error ( word -- * )

Vocabulary
stack-checker.errors

Error description
Thrown when stack effect inference determines that an inline recursive word has an incorrect stack effect declaration.

Examples

: unbalanced-recursion-example ( quot: ( -- ? ) -- b ) dup call [ unbalanced-recursion-example ] [ drop ] if ; inline recursive

Definition

IN: stack-checker.errors

ERROR: unbalanced-recursion-error < inference-error
word height ;

Methods

USING: accessors sequences stack-checker.errors summary ;

M: unbalanced-recursion-error summary
word>> name>> "The recursive word '"
"' leaves with the stack having the wrong height" surround ;